OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 } | 2659 } |
2660 | 2660 |
2661 | 2661 |
2662 void MacroAssembler::Drop(int stack_elements) { | 2662 void MacroAssembler::Drop(int stack_elements) { |
2663 if (stack_elements > 0) { | 2663 if (stack_elements > 0) { |
2664 addp(rsp, Immediate(stack_elements * kPointerSize)); | 2664 addp(rsp, Immediate(stack_elements * kPointerSize)); |
2665 } | 2665 } |
2666 } | 2666 } |
2667 | 2667 |
2668 | 2668 |
| 2669 void MacroAssembler::DropUnderReturnAddress(int stack_elements, |
| 2670 Register scratch) { |
| 2671 ASSERT(stack_elements > 0); |
| 2672 if (kPointerSize == kInt64Size && stack_elements == 1) { |
| 2673 popq(MemOperand(rsp, 0)); |
| 2674 return; |
| 2675 } |
| 2676 |
| 2677 PopReturnAddressTo(scratch); |
| 2678 Drop(stack_elements); |
| 2679 PushReturnAddressFrom(scratch); |
| 2680 } |
| 2681 |
| 2682 |
2669 void MacroAssembler::Push(Register src) { | 2683 void MacroAssembler::Push(Register src) { |
2670 if (kPointerSize == kInt64Size) { | 2684 if (kPointerSize == kInt64Size) { |
2671 pushq(src); | 2685 pushq(src); |
2672 } else { | 2686 } else { |
2673 ASSERT(kPointerSize == kInt32Size); | 2687 ASSERT(kPointerSize == kInt32Size); |
2674 // x32 uses 64-bit push for rbp in the prologue. | 2688 // x32 uses 64-bit push for rbp in the prologue. |
2675 ASSERT(src.code() != rbp.code()); | 2689 ASSERT(src.code() != rbp.code()); |
2676 leal(rsp, Operand(rsp, -4)); | 2690 leal(rsp, Operand(rsp, -4)); |
2677 movp(Operand(rsp, 0), src); | 2691 movp(Operand(rsp, 0), src); |
2678 } | 2692 } |
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5203 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); | 5217 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
5204 movl(rax, dividend); | 5218 movl(rax, dividend); |
5205 shrl(rax, Immediate(31)); | 5219 shrl(rax, Immediate(31)); |
5206 addl(rdx, rax); | 5220 addl(rdx, rax); |
5207 } | 5221 } |
5208 | 5222 |
5209 | 5223 |
5210 } } // namespace v8::internal | 5224 } } // namespace v8::internal |
5211 | 5225 |
5212 #endif // V8_TARGET_ARCH_X64 | 5226 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |