diff options
author | Jeff Hao <jeffhao@google.com> | 2014-01-15 13:49:50 -0800 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2015-04-27 18:54:52 -0700 |
commit | 848f70a3d73833fc1bf3032a9ff6812e429661d9 (patch) | |
tree | b0349b3a40aab5a915af491b100659a5ca9fbbf6 /compiler/dex/quick/arm/call_arm.cc | |
parent | d14438f0c5071962be7fab572b54687d32d9d087 (diff) | |
download | art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.gz art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.bz2 art-848f70a3d73833fc1bf3032a9ff6812e429661d9.zip |
Replace String CharArray with internal uint16_t array.
Summary of high level changes:
- Adds compiler inliner support to identify string init methods
- Adds compiler support (quick & optimizing) with new invoke code path
that calls method off the thread pointer
- Adds thread entrypoints for all string init methods
- Adds map to verifier to log when receiver of string init has been
copied to other registers. used by compiler and interpreter
Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
Diffstat (limited to 'compiler/dex/quick/arm/call_arm.cc')
-rw-r--r-- | compiler/dex/quick/arm/call_arm.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/compiler/dex/quick/arm/call_arm.cc b/compiler/dex/quick/arm/call_arm.cc index 6ba4016260..2b2d6af326 100644 --- a/compiler/dex/quick/arm/call_arm.cc +++ b/compiler/dex/quick/arm/call_arm.cc @@ -21,6 +21,7 @@ #include "arm_lir.h" #include "base/logging.h" #include "dex/mir_graph.h" +#include "dex/quick/dex_file_to_method_inliner_map.h" #include "dex/quick/mir_to_lir-inl.h" #include "driver/compiler_driver.h" #include "driver/compiler_options.h" @@ -619,13 +620,31 @@ static bool ArmUseRelativeCall(CompilationUnit* cu, const MethodReference& targe * Bit of a hack here - in the absence of a real scheduling pass, * emit the next instruction in static & direct invoke sequences. */ -int ArmMir2Lir::ArmNextSDCallInsn(CompilationUnit* cu, CallInfo* info ATTRIBUTE_UNUSED, +int ArmMir2Lir::ArmNextSDCallInsn(CompilationUnit* cu, CallInfo* info, int state, const MethodReference& target_method, uint32_t unused_idx ATTRIBUTE_UNUSED, uintptr_t direct_code, uintptr_t direct_method, InvokeType type) { ArmMir2Lir* cg = static_cast<ArmMir2Lir*>(cu->cg.get()); - if (direct_code != 0 && direct_method != 0) { + if (info->string_init_offset != 0) { + RegStorage arg0_ref = cg->TargetReg(kArg0, kRef); + switch (state) { + case 0: { // Grab target method* from thread pointer + cg->LoadRefDisp(rs_rARM_SELF, info->string_init_offset, arg0_ref, kNotVolatile); + break; + } + case 1: // Grab the code from the method* + if (direct_code == 0) { + // kInvokeTgt := arg0_ref->entrypoint + cg->LoadWordDisp(arg0_ref, + mirror::ArtMethod::EntryPointFromQuickCompiledCodeOffset( + kArmPointerSize).Int32Value(), cg->TargetPtrReg(kInvokeTgt)); + } + break; + default: + return -1; + } + } else if (direct_code != 0 && direct_method != 0) { switch (state) { case 0: // Get the current Method* [sets kArg0] if (direct_code != static_cast<uintptr_t>(-1)) { |