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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1435 push(rsi); | 1435 push(rsi); |
1436 push(rdi); | 1436 push(rdi); |
1437 push(r8); | 1437 push(r8); |
1438 push(r9); | 1438 push(r9); |
1439 // r10 is kScratchRegister. | 1439 // r10 is kScratchRegister. |
1440 push(r11); | 1440 push(r11); |
1441 push(r12); | 1441 push(r12); |
1442 // r13 is kRootRegister. | 1442 // r13 is kRootRegister. |
1443 push(r14); | 1443 push(r14); |
1444 // r15 is kSmiConstantRegister | 1444 // r15 is kSmiConstantRegister |
1445 STATIC_ASSERT(11 == kRegistersPushedByPushad); | 1445 STATIC_ASSERT(11 == kNumSafepointSavedRegisters); |
1446 subq(rsp, Immediate( | |
1447 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | |
Kevin Millikin (Chromium)
2011/02/14 18:42:21
I guess this needs to be nonnegative. Maybe that
| |
1446 } | 1448 } |
1447 | 1449 |
1448 | 1450 |
1449 void MacroAssembler::Popad() { | 1451 void MacroAssembler::Popad() { |
1452 addq(rsp, Immediate( | |
1453 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | |
1450 pop(r14); | 1454 pop(r14); |
1451 pop(r12); | 1455 pop(r12); |
1452 pop(r11); | 1456 pop(r11); |
1453 pop(r9); | 1457 pop(r9); |
1454 pop(r8); | 1458 pop(r8); |
1455 pop(rdi); | 1459 pop(rdi); |
1456 pop(rsi); | 1460 pop(rsi); |
1457 pop(rbx); | 1461 pop(rbx); |
1458 pop(rdx); | 1462 pop(rdx); |
1459 pop(rcx); | 1463 pop(rcx); |
1460 pop(rax); | 1464 pop(rax); |
1461 } | 1465 } |
1462 | 1466 |
1463 | 1467 |
1464 void MacroAssembler::Dropad() { | 1468 void MacroAssembler::Dropad() { |
1465 addq(rsp, Immediate(kRegistersPushedByPushad * kPointerSize)); | 1469 addq(rsp, Immediate(kNumSafepointRegisters * kPointerSize)); |
1466 } | 1470 } |
1467 | 1471 |
1468 | 1472 |
1469 // Order general registers are pushed by Pushad: | 1473 // Order general registers are pushed by Pushad: |
1470 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r12, r14. | 1474 // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r12, r14. |
1471 int MacroAssembler::kSafepointPushRegisterIndices[Register::kNumRegisters] = { | 1475 int MacroAssembler::kSafepointPushRegisterIndices[Register::kNumRegisters] = { |
1472 0, | 1476 0, |
1473 1, | 1477 1, |
1474 2, | 1478 2, |
1475 3, | 1479 3, |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2501 CPU::FlushICache(address_, size_); | 2505 CPU::FlushICache(address_, size_); |
2502 | 2506 |
2503 // Check that the code was patched as expected. | 2507 // Check that the code was patched as expected. |
2504 ASSERT(masm_.pc_ == address_ + size_); | 2508 ASSERT(masm_.pc_ == address_ + size_); |
2505 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2509 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2506 } | 2510 } |
2507 | 2511 |
2508 } } // namespace v8::internal | 2512 } } // namespace v8::internal |
2509 | 2513 |
2510 #endif // V8_TARGET_ARCH_X64 | 2514 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |