summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-12-12 17:47:52 +0000
committerVladimir Marko <vmarko@google.com>2017-12-14 16:05:15 +0000
commit8758454d380a2b0de1f4a99e9623cfac5460ccdf (patch)
tree0c23241949fc3ab94c826a18ffa2185218521bd4 /compiler/optimizing/code_generator.cc
parente619f6c51d0ff99a00c63d3d092e0132522e8fc8 (diff)
Clean up InstanceOf/CheckCast.
Avoid read barriers for boot image class InstanceOf. Boot image classes are non-moveable, so comparing them against from-space and to-space reference yields the same result. Change the notion of a "fatal" type check slow path to mean that the runtime call shall not return by normal path, i.e. "fatal" now includes certainly throwing in a try-block. This avoids unnecessary code to restore registers and jump back. For boot image classes the CheckCast comparisons do not need read barriers (for the same reason as for InstanceOf), so we shall not have any false negatives and can treat the check's slow paths as final in the same cases as in non-CC configs. Boot image size for aosp_taimen-userdebug in AOSP master: - before: arm boot*.oat: 37075460 arm64 boot*.oat: 43431768 - after: arm boot*.oat: 36894292 (-177KiB, -0.5%) arm64 boot*.oat: 43201256 (-225KiB, -0.5%) Also remove some obsolete helpers from CodeGenerator. Test: Additional test in 603-checker-instanceof. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing Bug: 12687968 Change-Id: Ib1381084e46a10e70320dcc618f0502ad725f0b8
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc9
1 files changed, 0 insertions, 9 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index 45eec6d744..dee74e96dc 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -295,15 +295,6 @@ void CodeGenerator::EmitJitRootPatches(uint8_t* code ATTRIBUTE_UNUSED,
DCHECK_EQ(code_generation_data_->GetNumberOfJitClassRoots(), 0u);
}
-size_t CodeGenerator::GetCacheOffset(uint32_t index) {
- return sizeof(GcRoot<mirror::Object>) * index;
-}
-
-size_t CodeGenerator::GetCachePointerOffset(uint32_t index) {
- PointerSize pointer_size = InstructionSetPointerSize(GetInstructionSet());
- return static_cast<size_t>(pointer_size) * index;
-}
-
uint32_t CodeGenerator::GetArrayLengthOffset(HArrayLength* array_length) {
return array_length->IsStringLength()
? mirror::String::CountOffset().Uint32Value()