OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 push(r8); | 1439 push(r8); |
1440 push(r9); | 1440 push(r9); |
1441 // r10 is kScratchRegister. | 1441 // r10 is kScratchRegister. |
1442 push(r11); | 1442 push(r11); |
1443 push(r12); | 1443 push(r12); |
1444 // r13 is kRootRegister. | 1444 // r13 is kRootRegister. |
1445 push(r14); | 1445 push(r14); |
1446 // r15 is kSmiConstantRegister | 1446 // r15 is kSmiConstantRegister |
1447 STATIC_ASSERT(11 == kNumSafepointSavedRegisters); | 1447 STATIC_ASSERT(11 == kNumSafepointSavedRegisters); |
1448 // Use lea for symmetry with Popad. | 1448 // Use lea for symmetry with Popad. |
1449 lea(rsp, Operand(rsp, | 1449 int sp_delta = |
1450 -(kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | 1450 (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize; |
| 1451 lea(rsp, Operand(rsp, -sp_delta)); |
1451 } | 1452 } |
1452 | 1453 |
1453 | 1454 |
1454 void MacroAssembler::Popad() { | 1455 void MacroAssembler::Popad() { |
1455 // Popad must not change the flags, so use lea instead of addq. | 1456 // Popad must not change the flags, so use lea instead of addq. |
1456 lea(rsp, Operand(rsp, | 1457 int sp_delta = |
1457 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | 1458 (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize; |
| 1459 lea(rsp, Operand(rsp, sp_delta)); |
1458 pop(r14); | 1460 pop(r14); |
1459 pop(r12); | 1461 pop(r12); |
1460 pop(r11); | 1462 pop(r11); |
1461 pop(r9); | 1463 pop(r9); |
1462 pop(r8); | 1464 pop(r8); |
1463 pop(rdi); | 1465 pop(rdi); |
1464 pop(rsi); | 1466 pop(rsi); |
1465 pop(rbx); | 1467 pop(rbx); |
1466 pop(rdx); | 1468 pop(rdx); |
1467 pop(rcx); | 1469 pop(rcx); |
(...skipping 21 matching lines...) Expand all Loading... |
1489 7, | 1491 7, |
1490 -1, | 1492 -1, |
1491 8, | 1493 8, |
1492 9, | 1494 9, |
1493 -1, | 1495 -1, |
1494 10, | 1496 10, |
1495 -1 | 1497 -1 |
1496 }; | 1498 }; |
1497 | 1499 |
1498 | 1500 |
| 1501 void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) { |
| 1502 movq(SafepointRegisterSlot(dst), src); |
| 1503 } |
| 1504 |
| 1505 |
| 1506 Operand MacroAssembler::SafepointRegisterSlot(Register reg) { |
| 1507 return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); |
| 1508 } |
| 1509 |
| 1510 |
1499 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 1511 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
1500 HandlerType type) { | 1512 HandlerType type) { |
1501 // Adjust this code if not the case. | 1513 // Adjust this code if not the case. |
1502 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 1514 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
1503 | 1515 |
1504 // The pc (return address) is already on TOS. This code pushes state, | 1516 // The pc (return address) is already on TOS. This code pushes state, |
1505 // frame pointer and current handler. Check that they are expected | 1517 // frame pointer and current handler. Check that they are expected |
1506 // next on the stack, in that order. | 1518 // next on the stack, in that order. |
1507 ASSERT_EQ(StackHandlerConstants::kStateOffset, | 1519 ASSERT_EQ(StackHandlerConstants::kStateOffset, |
1508 StackHandlerConstants::kPCOffset - kPointerSize); | 1520 StackHandlerConstants::kPCOffset - kPointerSize); |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 CPU::FlushICache(address_, size_); | 2634 CPU::FlushICache(address_, size_); |
2623 | 2635 |
2624 // Check that the code was patched as expected. | 2636 // Check that the code was patched as expected. |
2625 ASSERT(masm_.pc_ == address_ + size_); | 2637 ASSERT(masm_.pc_ == address_ + size_); |
2626 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2638 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2627 } | 2639 } |
2628 | 2640 |
2629 } } // namespace v8::internal | 2641 } } // namespace v8::internal |
2630 | 2642 |
2631 #endif // V8_TARGET_ARCH_X64 | 2643 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |