diff options
| author | 2017-12-22 20:01:46 +0000 | |
|---|---|---|
| committer | 2017-12-22 20:01:46 +0000 | |
| commit | 9ad08a3ea53487066cd39fafa46b98bb70685b14 (patch) | |
| tree | d7f0d7cabaac5a7646c25bae584a82a9aa279cc0 /compiler/compiler.cc | |
| parent | 64bae9fb677aa0e2406d13ea9f8ebaa92e16f978 (diff) | |
| parent | 808c7a57bb913b13c22884f57cdacd59bf1fdb3f (diff) | |
Merge "Make CodeItem fields private"
Diffstat (limited to 'compiler/compiler.cc')
| -rw-r--r-- | compiler/compiler.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/compiler.cc b/compiler/compiler.cc index bb614ae7b2..47f44ff3bc 100644 --- a/compiler/compiler.cc +++ b/compiler/compiler.cc @@ -19,6 +19,7 @@ #include <android-base/logging.h> #include "base/macros.h" +#include "code_item_accessors-inl.h" #include "driver/compiler_driver.h" #include "optimizing/optimizing_compiler.h" #include "utils.h" @@ -46,15 +47,16 @@ bool Compiler::IsPathologicalCase(const DexFile::CodeItem& code_item, * Dalvik uses 16-bit uints for instruction and register counts. We'll limit to a quarter * of that, which also guarantees we cannot overflow our 16-bit internal Quick SSA name space. */ - if (code_item.insns_size_in_code_units_ >= UINT16_MAX / 4) { + CodeItemDataAccessor accessor(&dex_file, &code_item); + if (accessor.InsnsSizeInCodeUnits() >= UINT16_MAX / 4) { LOG(INFO) << "Method exceeds compiler instruction limit: " - << code_item.insns_size_in_code_units_ + << accessor.InsnsSizeInCodeUnits() << " in " << dex_file.PrettyMethod(method_idx); return true; } - if (code_item.registers_size_ >= UINT16_MAX / 4) { + if (accessor.RegistersSize() >= UINT16_MAX / 4) { LOG(INFO) << "Method exceeds compiler virtual register limit: " - << code_item.registers_size_ << " in " << dex_file.PrettyMethod(method_idx); + << accessor.RegistersSize() << " in " << dex_file.PrettyMethod(method_idx); return true; } return false; |