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) { | 977 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { |
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 // Get the return address from the stack and restore the frame pointer. | 987 if (pop_arguments) { |
988 mov(ecx, Operand(ebp, 1 * kPointerSize)); | 988 // Get the return address from the stack and restore the frame pointer. |
989 mov(ebp, Operand(ebp, 0 * kPointerSize)); | 989 mov(ecx, Operand(ebp, 1 * kPointerSize)); |
| 990 mov(ebp, Operand(ebp, 0 * kPointerSize)); |
990 | 991 |
991 // Pop the arguments and the receiver from the caller stack. | 992 // Pop the arguments and the receiver from the caller stack. |
992 lea(esp, Operand(esi, 1 * kPointerSize)); | 993 lea(esp, Operand(esi, 1 * kPointerSize)); |
993 | 994 |
994 // Push the return address to get ready to return. | 995 // Push the return address to get ready to return. |
995 push(ecx); | 996 push(ecx); |
| 997 } else { |
| 998 // Otherwise just leave the exit frame. |
| 999 leave(); |
| 1000 } |
996 | 1001 |
997 LeaveExitFrameEpilogue(true); | 1002 LeaveExitFrameEpilogue(true); |
998 } | 1003 } |
999 | 1004 |
1000 | 1005 |
1001 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { | 1006 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { |
1002 // Restore current context from top and clear it in debug mode. | 1007 // Restore current context from top and clear it in debug mode. |
1003 ExternalReference context_address(Isolate::kContextAddress, isolate()); | 1008 ExternalReference context_address(Isolate::kContextAddress, isolate()); |
1004 if (restore_context) { | 1009 if (restore_context) { |
1005 mov(esi, Operand::StaticVariable(context_address)); | 1010 mov(esi, Operand::StaticVariable(context_address)); |
(...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3120 mov(eax, dividend); | 3125 mov(eax, dividend); |
3121 shr(eax, 31); | 3126 shr(eax, 31); |
3122 add(edx, eax); | 3127 add(edx, eax); |
3123 } | 3128 } |
3124 | 3129 |
3125 | 3130 |
3126 } // namespace internal | 3131 } // namespace internal |
3127 } // namespace v8 | 3132 } // namespace v8 |
3128 | 3133 |
3129 #endif // V8_TARGET_ARCH_IA32 | 3134 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |