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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); | 964 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); |
965 ExternalReference context_address(Isolate::kContextAddress, isolate()); | 965 ExternalReference context_address(Isolate::kContextAddress, isolate()); |
966 mov(Operand::StaticVariable(c_entry_fp_address), ebp); | 966 mov(Operand::StaticVariable(c_entry_fp_address), ebp); |
967 mov(Operand::StaticVariable(context_address), esi); | 967 mov(Operand::StaticVariable(context_address), esi); |
968 } | 968 } |
969 | 969 |
970 | 970 |
971 void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) { | 971 void MacroAssembler::EnterExitFrameEpilogue(int argc, bool save_doubles) { |
972 // Optionally save all XMM registers. | 972 // Optionally save all XMM registers. |
973 if (save_doubles) { | 973 if (save_doubles) { |
974 int space = XMMRegister::kNumRegisters * kDoubleSize + argc * kPointerSize; | 974 int space = XMMRegister::kMaxNumRegisters * kDoubleSize + |
| 975 argc * kPointerSize; |
975 sub(esp, Immediate(space)); | 976 sub(esp, Immediate(space)); |
976 const int offset = -2 * kPointerSize; | 977 const int offset = -2 * kPointerSize; |
977 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 978 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { |
978 XMMRegister reg = XMMRegister::from_code(i); | 979 XMMRegister reg = XMMRegister::from_code(i); |
979 movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg); | 980 movsd(Operand(ebp, offset - ((i + 1) * kDoubleSize)), reg); |
980 } | 981 } |
981 } else { | 982 } else { |
982 sub(esp, Immediate(argc * kPointerSize)); | 983 sub(esp, Immediate(argc * kPointerSize)); |
983 } | 984 } |
984 | 985 |
985 // Get the required frame alignment for the OS. | 986 // Get the required frame alignment for the OS. |
986 const int kFrameAlignment = OS::ActivationFrameAlignment(); | 987 const int kFrameAlignment = OS::ActivationFrameAlignment(); |
987 if (kFrameAlignment > 0) { | 988 if (kFrameAlignment > 0) { |
(...skipping 22 matching lines...) Expand all Loading... |
1010 void MacroAssembler::EnterApiExitFrame(int argc) { | 1011 void MacroAssembler::EnterApiExitFrame(int argc) { |
1011 EnterExitFramePrologue(); | 1012 EnterExitFramePrologue(); |
1012 EnterExitFrameEpilogue(argc, false); | 1013 EnterExitFrameEpilogue(argc, false); |
1013 } | 1014 } |
1014 | 1015 |
1015 | 1016 |
1016 void MacroAssembler::LeaveExitFrame(bool save_doubles) { | 1017 void MacroAssembler::LeaveExitFrame(bool save_doubles) { |
1017 // Optionally restore all XMM registers. | 1018 // Optionally restore all XMM registers. |
1018 if (save_doubles) { | 1019 if (save_doubles) { |
1019 const int offset = -2 * kPointerSize; | 1020 const int offset = -2 * kPointerSize; |
1020 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 1021 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { |
1021 XMMRegister reg = XMMRegister::from_code(i); | 1022 XMMRegister reg = XMMRegister::from_code(i); |
1022 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); | 1023 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); |
1023 } | 1024 } |
1024 } | 1025 } |
1025 | 1026 |
1026 // Get the return address from the stack and restore the frame pointer. | 1027 // Get the return address from the stack and restore the frame pointer. |
1027 mov(ecx, Operand(ebp, 1 * kPointerSize)); | 1028 mov(ecx, Operand(ebp, 1 * kPointerSize)); |
1028 mov(ebp, Operand(ebp, 0 * kPointerSize)); | 1029 mov(ebp, Operand(ebp, 0 * kPointerSize)); |
1029 | 1030 |
1030 // Pop the arguments and the receiver from the caller stack. | 1031 // Pop the arguments and the receiver from the caller stack. |
(...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3457 if (ms.shift() > 0) sar(edx, ms.shift()); | 3458 if (ms.shift() > 0) sar(edx, ms.shift()); |
3458 mov(eax, dividend); | 3459 mov(eax, dividend); |
3459 shr(eax, 31); | 3460 shr(eax, 31); |
3460 add(edx, eax); | 3461 add(edx, eax); |
3461 } | 3462 } |
3462 | 3463 |
3463 | 3464 |
3464 } } // namespace v8::internal | 3465 } } // namespace v8::internal |
3465 | 3466 |
3466 #endif // V8_TARGET_ARCH_IA32 | 3467 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |