| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe | 5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe |
| 6 // Please update the (git) revision if we merge changes from Dart. | 6 // Please update the (git) revision if we merge changes from Dart. |
| 7 // https://code.google.com/p/dart/wiki/GettingTheSource | 7 // https://code.google.com/p/dart/wiki/GettingTheSource |
| 8 | 8 |
| 9 #ifndef VM_ASSEMBLER_ARM_H_ | 9 #ifndef VM_ASSEMBLER_ARM_H_ |
| 10 #define VM_ASSEMBLER_ARM_H_ | 10 #define VM_ASSEMBLER_ARM_H_ |
| 11 | 11 |
| 12 #ifndef VM_ASSEMBLER_H_ | 12 #ifndef VM_ASSEMBLER_H_ |
| 13 #error Do not include assembler_arm.h directly; use assembler.h instead. | 13 #error Do not include assembler_arm.h directly; use assembler.h instead. |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "platform/assert.h" | 16 #include "platform/assert.h" |
| 17 #include "platform/utils.h" | 17 #include "platform/utils.h" |
| 18 #include "vm/constants_arm.h" | 18 #include "vm/constants_arm.h" |
| 19 #include "vm/cpu.h" | 19 #include "vm/cpu.h" |
| 20 #include "vm/hash_map.h" | 20 #include "vm/hash_map.h" |
| 21 #include "vm/object.h" | 21 #include "vm/object.h" |
| 22 #include "vm/simulator.h" | 22 #include "vm/simulator.h" |
| 23 | 23 |
| 24 namespace dart { | 24 namespace dart { |
| 25 | 25 |
| 26 // Forward declarations. | 26 // Forward declarations. |
| 27 class RuntimeEntry; | 27 class RuntimeEntry; |
| 28 class StubEntry; | 28 class StubEntry; |
| 29 | 29 |
| 30 #if 0 | |
| 31 // Moved to: ARM32::AssemblerARM32. | 30 // Moved to: ARM32::AssemblerARM32. |
| 32 // Instruction encoding bits. | 31 // Instruction encoding bits. |
| 32 #if 0 |
| 33 enum { | 33 enum { |
| 34 H = 1 << 5, // halfword (or byte) | 34 H = 1 << 5, // halfword (or byte) |
| 35 L = 1 << 20, // load (or store) | 35 L = 1 << 20, // load (or store) |
| 36 S = 1 << 20, // set condition code (or leave unchanged) | 36 S = 1 << 20, // set condition code (or leave unchanged) |
| 37 W = 1 << 21, // writeback base register (or leave unchanged) | 37 W = 1 << 21, // writeback base register (or leave unchanged) |
| 38 A = 1 << 21, // accumulate in multiply instruction (or not) | 38 A = 1 << 21, // accumulate in multiply instruction (or not) |
| 39 B = 1 << 22, // unsigned byte (or word) | 39 B = 1 << 22, // unsigned byte (or word) |
| 40 D = 1 << 22, // high/lo bit of start of s/d register range | 40 D = 1 << 22, // high/lo bit of start of s/d register range |
| 41 N = 1 << 22, // long (or short) | 41 N = 1 << 22, // long (or short) |
| 42 U = 1 << 23, // positive (or negative) offset/index | 42 U = 1 << 23, // positive (or negative) offset/index |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return *this; | 132 return *this; |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Data-processing operands - Immediate. | 135 // Data-processing operands - Immediate. |
| 136 explicit Operand(uint32_t immediate) { | 136 explicit Operand(uint32_t immediate) { |
| 137 ASSERT(immediate < (1 << kImmed8Bits)); | 137 ASSERT(immediate < (1 << kImmed8Bits)); |
| 138 type_ = 1; | 138 type_ = 1; |
| 139 encoding_ = immediate; | 139 encoding_ = immediate; |
| 140 } | 140 } |
| 141 | 141 |
| 142 #if 0 |
| 143 // Moved to AssemblerARM32::encodeImm12FromFlexImm. |
| 142 // Data-processing operands - Rotated immediate. | 144 // Data-processing operands - Rotated immediate. |
| 143 Operand(uint32_t rotate, uint32_t immed8) { | 145 Operand(uint32_t rotate, uint32_t immed8) { |
| 144 ASSERT((rotate < (1 << kRotateBits)) && (immed8 < (1 << kImmed8Bits))); | 146 ASSERT((rotate < (1 << kRotateBits)) && (immed8 < (1 << kImmed8Bits))); |
| 145 type_ = 1; | 147 type_ = 1; |
| 146 encoding_ = (rotate << kRotateShift) | (immed8 << kImmed8Shift); | 148 encoding_ = (rotate << kRotateShift) | (immed8 << kImmed8Shift); |
| 147 } | 149 } |
| 150 #endif |
| 148 | 151 |
| 149 // Data-processing operands - Register. | 152 // Data-processing operands - Register. |
| 150 explicit Operand(Register rm) { | 153 explicit Operand(Register rm) { |
| 151 type_ = 0; | 154 type_ = 0; |
| 152 encoding_ = static_cast<uint32_t>(rm); | 155 encoding_ = static_cast<uint32_t>(rm); |
| 153 } | 156 } |
| 154 | 157 |
| 155 // Data-processing operands - Logical shift/rotate by immediate. | 158 // Data-processing operands - Logical shift/rotate by immediate. |
| 156 Operand(Register rm, Shift shift, uint32_t shift_imm) { | 159 Operand(Register rm, Shift shift, uint32_t shift_imm) { |
| 157 ASSERT(shift_imm < (1 << kShiftImmBits)); | 160 ASSERT(shift_imm < (1 << kShiftImmBits)); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 461 |
| 459 void teq(Register rn, Operand o, Condition cond = AL); | 462 void teq(Register rn, Operand o, Condition cond = AL); |
| 460 | 463 |
| 461 void cmp(Register rn, Operand o, Condition cond = AL); | 464 void cmp(Register rn, Operand o, Condition cond = AL); |
| 462 | 465 |
| 463 void cmn(Register rn, Operand o, Condition cond = AL); | 466 void cmn(Register rn, Operand o, Condition cond = AL); |
| 464 | 467 |
| 465 void orr(Register rd, Register rn, Operand o, Condition cond = AL); | 468 void orr(Register rd, Register rn, Operand o, Condition cond = AL); |
| 466 void orrs(Register rd, Register rn, Operand o, Condition cond = AL); | 469 void orrs(Register rd, Register rn, Operand o, Condition cond = AL); |
| 467 | 470 |
| 471 #if 0 |
| 472 // Moved to IceAssemblerARM32::mov(..FlexImm..) |
| 473 // TODO(kschimpf) other forms of move. |
| 468 void mov(Register rd, Operand o, Condition cond = AL); | 474 void mov(Register rd, Operand o, Condition cond = AL); |
| 475 #endif |
| 469 void movs(Register rd, Operand o, Condition cond = AL); | 476 void movs(Register rd, Operand o, Condition cond = AL); |
| 470 | 477 |
| 471 void bic(Register rd, Register rn, Operand o, Condition cond = AL); | 478 void bic(Register rd, Register rn, Operand o, Condition cond = AL); |
| 472 void bics(Register rd, Register rn, Operand o, Condition cond = AL); | 479 void bics(Register rd, Register rn, Operand o, Condition cond = AL); |
| 473 | 480 |
| 474 void mvn(Register rd, Operand o, Condition cond = AL); | 481 void mvn(Register rd, Operand o, Condition cond = AL); |
| 475 void mvns(Register rd, Operand o, Condition cond = AL); | 482 void mvns(Register rd, Operand o, Condition cond = AL); |
| 476 | 483 |
| 477 // Miscellaneous data-processing instructions. | 484 // Miscellaneous data-processing instructions. |
| 478 void clz(Register rd, Register rm, Condition cond = AL); | 485 void clz(Register rd, Register rm, Condition cond = AL); |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 GrowableArray<CodeComment*> comments_; | 1084 GrowableArray<CodeComment*> comments_; |
| 1078 | 1085 |
| 1079 bool constant_pool_allowed_; | 1086 bool constant_pool_allowed_; |
| 1080 | 1087 |
| 1081 void LoadObjectHelper(Register rd, | 1088 void LoadObjectHelper(Register rd, |
| 1082 const Object& object, | 1089 const Object& object, |
| 1083 Condition cond, | 1090 Condition cond, |
| 1084 bool is_unique, | 1091 bool is_unique, |
| 1085 Register pp); | 1092 Register pp); |
| 1086 | 1093 |
| 1094 #if 0 |
| 1095 // Moved to class AssemblerARM32. |
| 1087 void EmitType01(Condition cond, | 1096 void EmitType01(Condition cond, |
| 1088 int type, | 1097 int type, |
| 1089 Opcode opcode, | 1098 Opcode opcode, |
| 1090 int set_cc, | 1099 int set_cc, |
| 1091 Register rn, | 1100 Register rn, |
| 1092 Register rd, | 1101 Register rd, |
| 1093 Operand o); | 1102 Operand o); |
| 1103 #endif |
| 1094 | 1104 |
| 1095 void EmitType5(Condition cond, int32_t offset, bool link); | 1105 void EmitType5(Condition cond, int32_t offset, bool link); |
| 1096 | 1106 |
| 1097 void EmitMemOp(Condition cond, | 1107 void EmitMemOp(Condition cond, |
| 1098 bool load, | 1108 bool load, |
| 1099 bool byte, | 1109 bool byte, |
| 1100 Register rd, | 1110 Register rd, |
| 1101 Address ad); | 1111 Address ad); |
| 1102 | 1112 |
| 1103 void EmitMemOpAddressMode3(Condition cond, | 1113 void EmitMemOpAddressMode3(Condition cond, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 Register new_value, | 1222 Register new_value, |
| 1213 FieldContent old_content); | 1223 FieldContent old_content); |
| 1214 | 1224 |
| 1215 DISALLOW_ALLOCATION(); | 1225 DISALLOW_ALLOCATION(); |
| 1216 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1226 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1217 }; | 1227 }; |
| 1218 | 1228 |
| 1219 } // namespace dart | 1229 } // namespace dart |
| 1220 | 1230 |
| 1221 #endif // VM_ASSEMBLER_ARM_H_ | 1231 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |