diff options
author | Vladimir Marko <vmarko@google.com> | 2018-07-20 16:43:56 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2018-08-02 17:41:21 +0100 |
commit | a9f303c089aa2b2fc82d97201352945678ef54ae (patch) | |
tree | 0df0eb5294a3ee72aea8ca670762c02ca9ffa8dd /compiler/optimizing/code_generator.cc | |
parent | 1bfd891d06e276d602b4a6ccf1a9f70967195218 (diff) |
Rewrite Class init entrypoint to take a Class arg.
Fixes invalid type index being passed to the entrypoint for
class init check across dex files when the target type does
not have a TypeId in the compilation unit's DexFile.
The size of the aosp_taimen-userdebug prebuilts:
- before:
arm/boot*.oat: 16782748
arm64/boot*.oat: 19764400
oat/arm64/services.odex: 20162432
- after:
arm/boot*.oat: 16811692 (+28.3KiB, +0.17%)
arm64/boot*.oat: 19801032 (+35.8KiB, +0.19%)
oat/arm64/services.odex: 20232208 (+68.1KiB, +0.35%)
This increase comes from doing two runtime calls instead of
one for HLoadClass/kBssEntry that MustGenerateClinitCheck().
Test: Additional test in 476-clinit-inline-static-invoke
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --jit
Test: Pixel 2 XL boots.
Test: testrunner.py --target --optimizing --jit
Test: testrunner.py --jvm
Bug: 111433619
Change-Id: I2fccd6944480ab4dac514f60d38e72c1014ae7b2
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index b0a05da0b1..f6a104b7c2 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -737,14 +737,12 @@ void CodeGenerator::CreateLoadClassRuntimeCallLocationSummary(HLoadClass* cls, void CodeGenerator::GenerateLoadClassRuntimeCall(HLoadClass* cls) { DCHECK_EQ(cls->GetLoadKind(), HLoadClass::LoadKind::kRuntimeCall); + DCHECK(!cls->MustGenerateClinitCheck()); LocationSummary* locations = cls->GetLocations(); MoveConstant(locations->GetTemp(0), cls->GetTypeIndex().index_); if (cls->NeedsAccessCheck()) { CheckEntrypointTypes<kQuickInitializeTypeAndVerifyAccess, void*, uint32_t>(); InvokeRuntime(kQuickInitializeTypeAndVerifyAccess, cls, cls->GetDexPc()); - } else if (cls->MustGenerateClinitCheck()) { - CheckEntrypointTypes<kQuickInitializeStaticStorage, void*, uint32_t>(); - InvokeRuntime(kQuickInitializeStaticStorage, cls, cls->GetDexPc()); } else { CheckEntrypointTypes<kQuickInitializeType, void*, uint32_t>(); InvokeRuntime(kQuickInitializeType, cls, cls->GetDexPc()); |