| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 EnterExitFrameEpilogue(3, save_doubles); | 967 EnterExitFrameEpilogue(3, save_doubles); |
| 968 } | 968 } |
| 969 | 969 |
| 970 | 970 |
| 971 void MacroAssembler::EnterApiExitFrame(int argc) { | 971 void MacroAssembler::EnterApiExitFrame(int argc) { |
| 972 EnterExitFramePrologue(); | 972 EnterExitFramePrologue(); |
| 973 EnterExitFrameEpilogue(argc, false); | 973 EnterExitFrameEpilogue(argc, false); |
| 974 } | 974 } |
| 975 | 975 |
| 976 | 976 |
| 977 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { | 977 void MacroAssembler::LeaveExitFrame(bool save_doubles) { |
| 978 // Optionally restore all XMM registers. | 978 // Optionally restore all XMM registers. |
| 979 if (save_doubles) { | 979 if (save_doubles) { |
| 980 const int offset = -2 * kPointerSize; | 980 const int offset = -2 * kPointerSize; |
| 981 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { | 981 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { |
| 982 XMMRegister reg = XMMRegister::from_code(i); | 982 XMMRegister reg = XMMRegister::from_code(i); |
| 983 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); | 983 movsd(reg, Operand(ebp, offset - ((i + 1) * kDoubleSize))); |
| 984 } | 984 } |
| 985 } | 985 } |
| 986 | 986 |
| 987 if (pop_arguments) { | 987 // Get the return address from the stack and restore the frame pointer. |
| 988 // Get the return address from the stack and restore the frame pointer. | 988 mov(ecx, Operand(ebp, 1 * kPointerSize)); |
| 989 mov(ecx, Operand(ebp, 1 * kPointerSize)); | 989 mov(ebp, Operand(ebp, 0 * kPointerSize)); |
| 990 mov(ebp, Operand(ebp, 0 * kPointerSize)); | |
| 991 | 990 |
| 992 // Pop the arguments and the receiver from the caller stack. | 991 // Pop the arguments and the receiver from the caller stack. |
| 993 lea(esp, Operand(esi, 1 * kPointerSize)); | 992 lea(esp, Operand(esi, 1 * kPointerSize)); |
| 994 | 993 |
| 995 // Push the return address to get ready to return. | 994 // Push the return address to get ready to return. |
| 996 push(ecx); | 995 push(ecx); |
| 997 } else { | |
| 998 // Otherwise just leave the exit frame. | |
| 999 leave(); | |
| 1000 } | |
| 1001 | 996 |
| 1002 LeaveExitFrameEpilogue(true); | 997 LeaveExitFrameEpilogue(true); |
| 1003 } | 998 } |
| 1004 | 999 |
| 1005 | 1000 |
| 1006 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { | 1001 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { |
| 1007 // Restore current context from top and clear it in debug mode. | 1002 // Restore current context from top and clear it in debug mode. |
| 1008 ExternalReference context_address(Isolate::kContextAddress, isolate()); | 1003 ExternalReference context_address(Isolate::kContextAddress, isolate()); |
| 1009 if (restore_context) { | 1004 if (restore_context) { |
| 1010 mov(esi, Operand::StaticVariable(context_address)); | 1005 mov(esi, Operand::StaticVariable(context_address)); |
| (...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3125 mov(eax, dividend); | 3120 mov(eax, dividend); |
| 3126 shr(eax, 31); | 3121 shr(eax, 31); |
| 3127 add(edx, eax); | 3122 add(edx, eax); |
| 3128 } | 3123 } |
| 3129 | 3124 |
| 3130 | 3125 |
| 3131 } // namespace internal | 3126 } // namespace internal |
| 3132 } // namespace v8 | 3127 } // namespace v8 |
| 3133 | 3128 |
| 3134 #endif // V8_TARGET_ARCH_IA32 | 3129 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |