| 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 __ LoadFromOffset(kWord, R0, R6, target_offset); | 1582 __ LoadFromOffset(kWord, R0, R6, target_offset); |
| 1583 __ LoadFromOffset(kWord, R1, R6, count_offset); | 1583 __ LoadFromOffset(kWord, R1, R6, count_offset); |
| 1584 __ adds(R1, R1, ShifterOperand(Smi::RawValue(1))); | 1584 __ adds(R1, R1, ShifterOperand(Smi::RawValue(1))); |
| 1585 __ StoreToOffset(kWord, R1, R6, count_offset); | 1585 __ StoreToOffset(kWord, R1, R6, count_offset); |
| 1586 __ b(&call_target_function, VC); // No overflow. | 1586 __ b(&call_target_function, VC); // No overflow. |
| 1587 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue)); | 1587 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue)); |
| 1588 __ StoreToOffset(kWord, R1, R6, count_offset); | 1588 __ StoreToOffset(kWord, R1, R6, count_offset); |
| 1589 | 1589 |
| 1590 __ Bind(&call_target_function); | 1590 __ Bind(&call_target_function); |
| 1591 // R0: target function. | 1591 // R0: target function. |
| 1592 __ ldr(R0, FieldAddress(R0, Function::code_offset())); | 1592 __ ldr(R1, FieldAddress(R0, Function::code_offset())); |
| 1593 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); | 1593 if (FLAG_collect_code) { |
| 1594 // If we are collecting code, the code object may be null. |
| 1595 Label is_compiled; |
| 1596 __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null())); |
| 1597 __ b(&is_compiled, NE); |
| 1598 __ EnterStubFrame(); |
| 1599 // Preserve arg desc. and IC data object. |
| 1600 __ PushList((1 << R4) | (1 << R5)); |
| 1601 __ Push(R0); // Pass function. |
| 1602 __ CallRuntime(kCompileFunctionRuntimeEntry, 1); |
| 1603 __ Pop(R0); // Discard argument. |
| 1604 __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data. |
| 1605 __ LeaveStubFrame(); |
| 1606 // R0: target function. |
| 1607 __ ldr(R1, FieldAddress(R0, Function::code_offset())); |
| 1608 __ Bind(&is_compiled); |
| 1609 } |
| 1610 __ ldr(R0, FieldAddress(R1, Code::instructions_offset())); |
| 1594 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); | 1611 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); |
| 1595 __ bx(R0); | 1612 __ bx(R0); |
| 1596 | 1613 |
| 1597 // Instance in R0, return its class-id in R0 as Smi. | 1614 // Instance in R0, return its class-id in R0 as Smi. |
| 1598 __ Bind(&get_class_id_as_smi); | 1615 __ Bind(&get_class_id_as_smi); |
| 1599 | 1616 |
| 1600 // Test if Smi -> load Smi class for comparison. | 1617 // Test if Smi -> load Smi class for comparison. |
| 1601 __ tst(R0, ShifterOperand(kSmiTagMask)); | 1618 __ tst(R0, ShifterOperand(kSmiTagMask)); |
| 1602 __ mov(R0, ShifterOperand(Smi::RawValue(kSmiCid)), EQ); | 1619 __ mov(R0, ShifterOperand(Smi::RawValue(kSmiCid)), EQ); |
| 1603 __ bx(LR, EQ); | 1620 __ bx(LR, EQ); |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 __ ldr(left, Address(SP, 4 * kWordSize)); | 2123 __ ldr(left, Address(SP, 4 * kWordSize)); |
| 2107 __ ldr(right, Address(SP, 3 * kWordSize)); | 2124 __ ldr(right, Address(SP, 3 * kWordSize)); |
| 2108 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2125 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2109 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); | 2126 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); |
| 2110 __ Ret(); | 2127 __ Ret(); |
| 2111 } | 2128 } |
| 2112 | 2129 |
| 2113 } // namespace dart | 2130 } // namespace dart |
| 2114 | 2131 |
| 2115 #endif // defined TARGET_ARCH_ARM | 2132 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |