| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); | 972 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); |
| 973 ExternalReference context_address(Isolate::kContextAddress, isolate()); | 973 ExternalReference context_address(Isolate::kContextAddress, isolate()); |
| 974 mov(Operand::StaticVariable(c_entry_fp_address), ebp); | 974 mov(Operand::StaticVariable(c_entry_fp_address), ebp); |
| 975 mov(Operand::StaticVariable(context_address), esi); | 975 mov(Operand::StaticVariable(context_address), esi); |
| 976 } | 976 } |
| 977 | 977 |
| 978 | 978 |
| 979 void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) { | 979 void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) { |
| 980 // Optionally save all XMM registers. | 980 // Optionally save all XMM registers. |
| 981 if (save_doubles) { | 981 if (save_doubles) { |
| 982 int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize; | 982 int space = XMMRegister::NumRegisters() * kDoubleSize + argc * kPointerSize; |
| 983 sub(esp, Immediate(space)); | 983 sub(esp, Immediate(space)); |
| 984 const int offset = -2 * kPointerSize; | 984 const int offset = -2 * kPointerSize; |
| 985 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 985 for (int i = 0; i < XMMRegister::NumRegisters(); i++) { |
| 986 XMMRegister reg = XMMRegister::from_code(i); | 986 XMMRegister reg = XMMRegister::from_code(i); |
| 987 movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg); | 987 movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg); |
| 988 } | 988 } |
| 989 } else { | 989 } else { |
| 990 sub(esp, Immediate(argc * kPointerSize)); | 990 sub(esp, Immediate(argc * kPointerSize)); |
| 991 } | 991 } |
| 992 | 992 |
| 993 // Get the required frame alignment for the OS. | 993 // Get the required frame alignment for the OS. |
| 994 const int kFrameAlignment = OS::ActivationFrameAlignment(); | 994 const int kFrameAlignment = OS::ActivationFrameAlignment(); |
| 995 if (kFrameAlignment > 0) { | 995 if (kFrameAlignment > 0) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1018 void MacroAssembler::EnterApiExitFrame(int argc) { | 1018 void MacroAssembler::EnterApiExitFrame(int argc) { |
| 1019 EnterExitFramePrologue(); | 1019 EnterExitFramePrologue(); |
| 1020 EnterExitFrameEpilogue(argc, false); | 1020 EnterExitFrameEpilogue(argc, false); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 | 1023 |
| 1024 void MacroAssembler::LeaveExitFrame(bool save_doubles) { | 1024 void MacroAssembler::LeaveExitFrame(bool save_doubles) { |
| 1025 // Optionally restore all XMM registers. | 1025 // Optionally restore all XMM registers. |
| 1026 if (save_doubles) { | 1026 if (save_doubles) { |
| 1027 const int offset = -2 * kPointerSize; | 1027 const int offset = -2 * kPointerSize; |
| 1028 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 1028 for (int i = 0; i < XMMRegister::NumRegisters(); i++) { |
| 1029 XMMRegister reg = XMMRegister::from_code(i); | 1029 XMMRegister reg = XMMRegister::from_code(i); |
| 1030 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); | 1030 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 // Get the return address from the stack and restore the frame pointer. | 1034 // Get the return address from the stack and restore the frame pointer. |
| 1035 mov(ecx, Operand(ebp, 1 * kPointerSize)); | 1035 mov(ecx, Operand(ebp, 1 * kPointerSize)); |
| 1036 mov(ebp, Operand(ebp, 0 * kPointerSize)); | 1036 mov(ebp, Operand(ebp, 0 * kPointerSize)); |
| 1037 | 1037 |
| 1038 // Pop the arguments and the receiver from the caller stack. | 1038 // Pop the arguments and the receiver from the caller stack. |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3465 if (ms.shift() > 0) sar(edx, ms.shift()); | 3465 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3466 mov(eax, dividend); | 3466 mov(eax, dividend); |
| 3467 shr(eax, 31); | 3467 shr(eax, 31); |
| 3468 add(edx, eax); | 3468 add(edx, eax); |
| 3469 } | 3469 } |
| 3470 | 3470 |
| 3471 | 3471 |
| 3472 } } // namespace v8::internal | 3472 } } // namespace v8::internal |
| 3473 | 3473 |
| 3474 #endif // V8_TARGET_ARCH_IA32 | 3474 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |