summaryrefslogtreecommitdiff
path: root/compiler/dex/quick/codegen_util.cc
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2014-01-23 23:57:53 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-01-23 23:57:54 +0000
commit8c95011dad0ea0e3a88775de70256ace93488baf (patch)
treed6ec71e2b86c74fd9bdc8c438d380d9d0f95c410 /compiler/dex/quick/codegen_util.cc
parent2eea3f3c8ca18cd464fcb479acd6e2a2eea4f6c8 (diff)
parentbe1ca55db3362f5b100c4c65da5342fd299520bb (diff)
Merge "Use direct class pointers at allocation sites in the compiled code."
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
-rw-r--r--compiler/dex/quick/codegen_util.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc
index 29554c0977..2ce7ecdecc 100644
--- a/compiler/dex/quick/codegen_util.cc
+++ b/compiler/dex/quick/codegen_util.cc
@@ -440,6 +440,20 @@ void Mir2Lir::InstallLiteralPools() {
PushPointer(code_buffer_, &id);
data_lir = NEXT_LIR(data_lir);
}
+ // Push class literals.
+ data_lir = class_literal_list_;
+ while (data_lir != NULL) {
+ uint32_t target = data_lir->operands[0];
+ cu_->compiler_driver->AddClassPatch(cu_->dex_file,
+ cu_->class_def_idx,
+ cu_->method_idx,
+ target,
+ code_buffer_.size());
+ const DexFile::TypeId& id = cu_->dex_file->GetTypeId(target);
+ // unique value based on target to ensure code deduplication works
+ PushPointer(code_buffer_, &id);
+ data_lir = NEXT_LIR(data_lir);
+ }
}
/* Write the switch tables to the output stream */
@@ -772,6 +786,7 @@ int Mir2Lir::AssignLiteralOffset(CodeOffset offset) {
offset = AssignLiteralOffsetCommon(literal_list_, offset);
offset = AssignLiteralPointerOffsetCommon(code_literal_list_, offset);
offset = AssignLiteralPointerOffsetCommon(method_literal_list_, offset);
+ offset = AssignLiteralPointerOffsetCommon(class_literal_list_, offset);
return offset;
}
@@ -960,6 +975,7 @@ Mir2Lir::Mir2Lir(CompilationUnit* cu, MIRGraph* mir_graph, ArenaAllocator* arena
: Backend(arena),
literal_list_(NULL),
method_literal_list_(NULL),
+ class_literal_list_(NULL),
code_literal_list_(NULL),
first_fixup_(NULL),
cu_(cu),