OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1271 __ mov(R3, R0); | 1271 __ mov(R3, R0); |
1272 | 1272 |
1273 Label loop, update, call_target_function; | 1273 Label loop, update, call_target_function; |
1274 __ b(&loop); | 1274 __ b(&loop); |
1275 | 1275 |
1276 __ Bind(&update); | 1276 __ Bind(&update); |
1277 __ add(R3, R3, Operand(Smi::RawValue(1))); | 1277 __ add(R3, R3, Operand(Smi::RawValue(1))); |
1278 __ Bind(&loop); | 1278 __ Bind(&loop); |
1279 __ and_(R3, R3, Operand(R1)); | 1279 __ and_(R3, R3, Operand(R1)); |
1280 const intptr_t base = Array::data_offset(); | 1280 const intptr_t base = Array::data_offset(); |
1281 // R3 is smi tagged, but table entries are 8 bytes, so LSL 2. | 1281 // R3 is smi tagged, but table entries are 16 bytes, so LSL 3. |
Florian Schneider
2014/05/20 13:12:49
...entries are 2 words, so use LSL kWordSizeLog2.
| |
1282 __ add(TMP, R2, Operand(R3, LSL, 2)); | 1282 __ add(TMP, R2, Operand(R3, LSL, 3)); |
Florian Schneider
2014/05/20 13:12:49
Use kWordSizeLog2 instead.
|
Florian Schneider
2014/05/20 13:12:49
Use kWordSizeLog2 instead.
|
1283 __ LoadFieldFromOffset(R4, TMP, base, PP); | 1283 __ LoadFieldFromOffset(R4, TMP, base, PP); |
1284 | 1284 |
1285 ASSERT(kIllegalCid == 0); | 1285 ASSERT(kIllegalCid == 0); |
1286 __ tst(R4, Operand(R4)); | 1286 __ tst(R4, Operand(R4)); |
1287 __ b(&call_target_function, EQ); | 1287 __ b(&call_target_function, EQ); |
1288 __ CompareRegisters(R4, R0); | 1288 __ CompareRegisters(R4, R0); |
1289 __ b(&update, NE); | 1289 __ b(&update, NE); |
1290 | 1290 |
1291 __ Bind(&call_target_function); | 1291 __ Bind(&call_target_function); |
1292 // Call the target found in the cache. For a class id match, this is a | 1292 // Call the target found in the cache. For a class id match, this is a |
1293 // proper target for the given name and arguments descriptor. If the | 1293 // proper target for the given name and arguments descriptor. If the |
1294 // illegal class id was found, the target is a cache miss handler that can | 1294 // illegal class id was found, the target is a cache miss handler that can |
1295 // be invoked as a normal Dart function. | 1295 // be invoked as a normal Dart function. |
1296 __ add(TMP, R2, Operand(R3, LSL, 2)); | 1296 __ add(TMP, R2, Operand(R3, LSL, 3)); |
Florian Schneider
2014/05/20 13:12:49
Use kWordSizeLog2 instead.
|
Florian Schneider
2014/05/20 13:12:49
Use kWordSizeLog2 instead.
|
1297 __ LoadFieldFromOffset(R0, TMP, base + kWordSize, PP); | 1297 __ LoadFieldFromOffset(R0, TMP, base + kWordSize, PP); |
1298 __ LoadFieldFromOffset(R1, R0, Function::code_offset(), PP); | 1298 __ LoadFieldFromOffset(R1, R0, Function::code_offset(), PP); |
1299 __ LoadFieldFromOffset(R1, R1, Code::instructions_offset(), PP); | 1299 __ LoadFieldFromOffset(R1, R1, Code::instructions_offset(), PP); |
1300 __ LoadObject(R5, ic_data, PP); | 1300 __ LoadObject(R5, ic_data, PP); |
1301 __ LoadObject(R4, arguments_descriptor, PP); | 1301 __ LoadObject(R4, arguments_descriptor, PP); |
1302 __ AddImmediate(R1, R1, Instructions::HeaderSize() - kHeapObjectTag, PP); | 1302 __ AddImmediate(R1, R1, Instructions::HeaderSize() - kHeapObjectTag, PP); |
1303 __ blr(R1); | 1303 __ blr(R1); |
1304 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); | 1304 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
1305 RecordSafepoint(locs); | 1305 RecordSafepoint(locs); |
1306 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); | 1306 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1777 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1777 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1778 UNIMPLEMENTED(); | 1778 UNIMPLEMENTED(); |
1779 } | 1779 } |
1780 | 1780 |
1781 | 1781 |
1782 #undef __ | 1782 #undef __ |
1783 | 1783 |
1784 } // namespace dart | 1784 } // namespace dart |
1785 | 1785 |
1786 #endif // defined TARGET_ARCH_ARM64 | 1786 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |