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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 handler. |
1477 // No Result. | 1477 // LR: return address. |
1478 // R0: program_counter. | |
1479 // R1: stack_pointer. | |
1480 // R2: frame_pointer. | |
1481 // R3: error object. | |
1482 // SP: address of stacktrace object. | |
1483 // Does not return. | |
1478 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1484 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1479 __ Unimplemented("JumpToExceptionHandler Stub"); | 1485 ASSERT(kExceptionObjectReg == R0); |
1486 ASSERT(kStackTraceObjectReg == R1); | |
1487 __ mov(LR, ShifterOperand(R0)); // Program counter. | |
1488 __ mov(R0, ShifterOperand(R3)); // Error object. | |
1489 __ ldr(R1, Address(SP, 0)); // Error object. | |
zra
2013/04/18 15:45:25
Stacktrace object?
regis
2013/04/18 16:18:27
Done.
| |
1490 __ mov(FP, ShifterOperand(R2)); // Frame_pointer. | |
1491 __ mov(SP, ShifterOperand(R1)); // Stack pointer. | |
zra
2013/04/18 15:45:25
Is R1 the stack pointer here? I thought it was alr
regis
2013/04/18 16:18:27
Good catch! This stub is only used when running on
| |
1492 __ bx(LR); // Jump to the exception handler code. | |
1480 } | 1493 } |
1481 | 1494 |
1482 | 1495 |
1483 // Jump to the error handler. | 1496 // Jump to the error handler. |
1484 // No Result. | 1497 // LR: return address. |
1498 // R0: program_counter. | |
1499 // R1: stack_pointer. | |
1500 // R2: frame_pointer. | |
1501 // R3: error object. | |
1502 // Does not return. | |
1485 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { | 1503 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { |
1486 __ Unimplemented("JumpToErrorHandler Stub"); | 1504 ASSERT(kExceptionObjectReg == R0); |
1505 __ mov(LR, ShifterOperand(R0)); // Program counter. | |
1506 __ mov(R0, ShifterOperand(R3)); // Error object. | |
1507 __ mov(FP, ShifterOperand(R2)); // Frame_pointer. | |
1508 __ mov(SP, ShifterOperand(R1)); // Stack pointer. | |
1509 __ bx(LR); // Jump to the exception handler code. | |
1487 } | 1510 } |
1488 | 1511 |
1489 | 1512 |
1490 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { | 1513 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { |
1491 __ Unimplemented("EqualityWithNullArg Stub"); | 1514 __ Unimplemented("EqualityWithNullArg Stub"); |
1492 } | 1515 } |
1493 | 1516 |
1494 | 1517 |
1495 // Calls to the runtime to optimize the given function. | 1518 // Calls to the runtime to optimize the given function. |
1496 // R6: function to be reoptimized. | 1519 // R6: function to be reoptimized. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1594 __ Bind(&reference_compare); | 1617 __ Bind(&reference_compare); |
1595 __ cmp(left, ShifterOperand(right)); | 1618 __ cmp(left, ShifterOperand(right)); |
1596 __ Bind(&done); | 1619 __ Bind(&done); |
1597 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); | 1620 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); |
1598 __ Ret(); | 1621 __ Ret(); |
1599 } | 1622 } |
1600 | 1623 |
1601 } // namespace dart | 1624 } // namespace dart |
1602 | 1625 |
1603 #endif // defined TARGET_ARCH_ARM | 1626 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |