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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 == kNumSafepointSavedRegisters); | 1445 STATIC_ASSERT(11 == kNumSafepointSavedRegisters); |
1446 subq(rsp, Immediate( | 1446 // Use lea for symmetry with Popad. |
1447 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | 1447 lea(rsp, Operand(rsp, |
| 1448 -(kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); |
1448 } | 1449 } |
1449 | 1450 |
1450 | 1451 |
1451 void MacroAssembler::Popad() { | 1452 void MacroAssembler::Popad() { |
1452 addq(rsp, Immediate( | 1453 // Popad must not change the flags, so use lea instead of addq. |
| 1454 lea(rsp, Operand(rsp, |
1453 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); | 1455 (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); |
1454 pop(r14); | 1456 pop(r14); |
1455 pop(r12); | 1457 pop(r12); |
1456 pop(r11); | 1458 pop(r11); |
1457 pop(r9); | 1459 pop(r9); |
1458 pop(r8); | 1460 pop(r8); |
1459 pop(rdi); | 1461 pop(rdi); |
1460 pop(rsi); | 1462 pop(rsi); |
1461 pop(rbx); | 1463 pop(rbx); |
1462 pop(rdx); | 1464 pop(rdx); |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 CPU::FlushICache(address_, size_); | 2507 CPU::FlushICache(address_, size_); |
2506 | 2508 |
2507 // Check that the code was patched as expected. | 2509 // Check that the code was patched as expected. |
2508 ASSERT(masm_.pc_ == address_ + size_); | 2510 ASSERT(masm_.pc_ == address_ + size_); |
2509 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2511 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2510 } | 2512 } |
2511 | 2513 |
2512 } } // namespace v8::internal | 2514 } } // namespace v8::internal |
2513 | 2515 |
2514 #endif // V8_TARGET_ARCH_X64 | 2516 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |