diff options
| author | 2018-11-01 09:50:52 +0000 | |
|---|---|---|
| committer | 2018-11-01 12:17:35 +0000 | |
| commit | a2c211ca97cce4d900a6b2047049ffbe46fd5890 (patch) | |
| tree | 4fc383d217f9de000f11b99d2d5e9c834c5c8c70 /compiler/driver | |
| parent | 0708fc0c096fb4126c2029d0172830cf0c8e159b (diff) | |
Add compiling class to the DexCompilationUnit.
Use it to simplify HInstructionBuilder and reduce the
number of class resolution calls.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Change-Id: Ib4f9b4ea61235841e653a03a40755a39c7de7504
Diffstat (limited to 'compiler/driver')
| -rw-r--r-- | compiler/driver/dex_compilation_unit.cc | 6 | ||||
| -rw-r--r-- | compiler/driver/dex_compilation_unit.h | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/compiler/driver/dex_compilation_unit.cc b/compiler/driver/dex_compilation_unit.cc index c90c37d54a..654eccdad6 100644 --- a/compiler/driver/dex_compilation_unit.cc +++ b/compiler/driver/dex_compilation_unit.cc @@ -31,7 +31,8 @@ DexCompilationUnit::DexCompilationUnit(Handle<mirror::ClassLoader> class_loader, uint32_t method_idx, uint32_t access_flags, const VerifiedMethod* verified_method, - Handle<mirror::DexCache> dex_cache) + Handle<mirror::DexCache> dex_cache, + Handle<mirror::Class> compiling_class) : class_loader_(class_loader), class_linker_(class_linker), dex_file_(&dex_file), @@ -41,7 +42,8 @@ DexCompilationUnit::DexCompilationUnit(Handle<mirror::ClassLoader> class_loader, access_flags_(access_flags), verified_method_(verified_method), dex_cache_(dex_cache), - code_item_accessor_(dex_file, code_item) {} + code_item_accessor_(dex_file, code_item), + compiling_class_(compiling_class) {} const std::string& DexCompilationUnit::GetSymbol() { if (symbol_.empty()) { diff --git a/compiler/driver/dex_compilation_unit.h b/compiler/driver/dex_compilation_unit.h index c1ae3c938b..9d9c218266 100644 --- a/compiler/driver/dex_compilation_unit.h +++ b/compiler/driver/dex_compilation_unit.h @@ -27,6 +27,7 @@ namespace art { namespace mirror { +class Class; class ClassLoader; class DexCache; } // namespace mirror @@ -43,7 +44,8 @@ class DexCompilationUnit : public DeletableArenaObject<kArenaAllocMisc> { uint32_t method_idx, uint32_t access_flags, const VerifiedMethod* verified_method, - Handle<mirror::DexCache> dex_cache); + Handle<mirror::DexCache> dex_cache, + Handle<mirror::Class> compiling_class = Handle<mirror::Class>()); Handle<mirror::ClassLoader> GetClassLoader() const { return class_loader_; @@ -117,6 +119,10 @@ class DexCompilationUnit : public DeletableArenaObject<kArenaAllocMisc> { return code_item_accessor_; } + Handle<mirror::Class> GetCompilingClass() const { + return compiling_class_; + } + private: const Handle<mirror::ClassLoader> class_loader_; @@ -134,6 +140,8 @@ class DexCompilationUnit : public DeletableArenaObject<kArenaAllocMisc> { const CodeItemDataAccessor code_item_accessor_; + Handle<mirror::Class> compiling_class_; + std::string symbol_; }; |