diff options
| author | 2014-05-01 15:32:10 +0000 | |
|---|---|---|
| committer | 2014-05-01 15:32:11 +0000 | |
| commit | 69cf921f5ab4467fa2c109e30ea5caca2a20790c (patch) | |
| tree | acf3ddb2196b408354bb66a9aa44f6bee2ca015b /compiler/dex/quick/codegen_util.cc | |
| parent | 530804f158e8bda105e6bbaa986e488b87af91ac (diff) | |
| parent | ff093b31d75658c3404f9b51ee45760f346f06d9 (diff) | |
Merge "Fix a few 64-bit compilation of 32-bit code issues."
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
| -rw-r--r-- | compiler/dex/quick/codegen_util.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index c3f9b673d2..b030bb4ec8 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -555,8 +555,8 @@ static int AssignLiteralOffsetCommon(LIR* lir, CodeOffset offset) { return offset; } -static int AssignLiteralPointerOffsetCommon(LIR* lir, CodeOffset offset) { - unsigned int element_size = sizeof(void*); +static int AssignLiteralPointerOffsetCommon(LIR* lir, CodeOffset offset, + unsigned int element_size) { // Align to natural pointer size. offset = (offset + (element_size - 1)) & ~(element_size - 1); for (; lir != NULL; lir = lir->next) { @@ -726,9 +726,10 @@ void Mir2Lir::CreateNativeGcMap() { /* Determine the offset of each literal field */ 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); + unsigned int ptr_size = GetInstructionSetPointerSize(cu_->instruction_set); + offset = AssignLiteralPointerOffsetCommon(code_literal_list_, offset, ptr_size); + offset = AssignLiteralPointerOffsetCommon(method_literal_list_, offset, ptr_size); + offset = AssignLiteralPointerOffsetCommon(class_literal_list_, offset, ptr_size); return offset; } |