| 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 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 } | 1466 } |
| 1467 | 1467 |
| 1468 | 1468 |
| 1469 // Return the current stack pointer address, used to stack alignment | 1469 // Return the current stack pointer address, used to stack alignment |
| 1470 // checks. | 1470 // checks. |
| 1471 void StubCode::GenerateGetStackPointerStub(Assembler* assembler) { | 1471 void StubCode::GenerateGetStackPointerStub(Assembler* assembler) { |
| 1472 __ Unimplemented("GetStackPointer Stub"); | 1472 __ Unimplemented("GetStackPointer Stub"); |
| 1473 } | 1473 } |
| 1474 | 1474 |
| 1475 | 1475 |
| 1476 // Jump to the exception handler. | 1476 // Jump to the exception or error handler. |
| 1477 // LR: return address. | 1477 // LR: return address. |
| 1478 // R0: program_counter. | 1478 // R0: program_counter. |
| 1479 // R1: stack_pointer. | 1479 // R1: stack_pointer. |
| 1480 // R2: frame_pointer. | 1480 // R2: frame_pointer. |
| 1481 // R3: error object. | 1481 // R3: error object. |
| 1482 // SP: address of stacktrace object. | 1482 // SP: address of stacktrace object. |
| 1483 // Does not return. | 1483 // Does not return. |
| 1484 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1484 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
| 1485 ASSERT(kExceptionObjectReg == R0); | 1485 ASSERT(kExceptionObjectReg == R0); |
| 1486 ASSERT(kStackTraceObjectReg == R1); | 1486 ASSERT(kStackTraceObjectReg == R1); |
| 1487 __ mov(IP, ShifterOperand(R1)); // Stack pointer. | 1487 __ mov(IP, ShifterOperand(R1)); // Stack pointer. |
| 1488 __ mov(LR, ShifterOperand(R0)); // Program counter. | 1488 __ mov(LR, ShifterOperand(R0)); // Program counter. |
| 1489 __ mov(R0, ShifterOperand(R3)); // Exception object. | 1489 __ mov(R0, ShifterOperand(R3)); // Exception object. |
| 1490 __ ldr(R1, Address(SP, 0)); // StackTrace object. | 1490 __ ldr(R1, Address(SP, 0)); // StackTrace object. |
| 1491 __ mov(FP, ShifterOperand(R2)); // Frame_pointer. | 1491 __ mov(FP, ShifterOperand(R2)); // Frame_pointer. |
| 1492 __ mov(SP, ShifterOperand(IP)); // Stack pointer. | 1492 __ mov(SP, ShifterOperand(IP)); // Stack pointer. |
| 1493 __ bx(LR); // Jump to the exception handler code. | 1493 __ bx(LR); // Jump to the exception handler code. |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 | 1496 |
| 1497 // Jump to the error handler. | |
| 1498 // LR: return address. | |
| 1499 // R0: program_counter. | |
| 1500 // R1: stack_pointer. | |
| 1501 // R2: frame_pointer. | |
| 1502 // R3: error object. | |
| 1503 // Does not return. | |
| 1504 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { | |
| 1505 ASSERT(kExceptionObjectReg == R0); | |
| 1506 __ mov(LR, ShifterOperand(R0)); // Program counter. | |
| 1507 __ mov(R0, ShifterOperand(R3)); // Error object. | |
| 1508 __ mov(FP, ShifterOperand(R2)); // Frame_pointer. | |
| 1509 __ mov(SP, ShifterOperand(R1)); // Stack pointer. | |
| 1510 __ bx(LR); // Jump to the exception handler code. | |
| 1511 } | |
| 1512 | |
| 1513 | |
| 1514 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { | 1497 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { |
| 1515 __ Unimplemented("EqualityWithNullArg Stub"); | 1498 __ Unimplemented("EqualityWithNullArg Stub"); |
| 1516 } | 1499 } |
| 1517 | 1500 |
| 1518 | 1501 |
| 1519 // Calls to the runtime to optimize the given function. | 1502 // Calls to the runtime to optimize the given function. |
| 1520 // R6: function to be reoptimized. | 1503 // R6: function to be reoptimized. |
| 1521 // R4: argument descriptor (preserved). | 1504 // R4: argument descriptor (preserved). |
| 1522 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1505 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
| 1523 __ EnterStubFrame(); | 1506 __ EnterStubFrame(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 __ Bind(&reference_compare); | 1601 __ Bind(&reference_compare); |
| 1619 __ cmp(left, ShifterOperand(right)); | 1602 __ cmp(left, ShifterOperand(right)); |
| 1620 __ Bind(&done); | 1603 __ Bind(&done); |
| 1621 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); | 1604 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); |
| 1622 __ Ret(); | 1605 __ Ret(); |
| 1623 } | 1606 } |
| 1624 | 1607 |
| 1625 } // namespace dart | 1608 } // namespace dart |
| 1626 | 1609 |
| 1627 #endif // defined TARGET_ARCH_ARM | 1610 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |