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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 EnterExitFrameEpilogue(3, save_doubles); | 936 EnterExitFrameEpilogue(3, save_doubles); |
937 } | 937 } |
938 | 938 |
939 | 939 |
940 void MacroAssembler::EnterApiExitFrame(int argc) { | 940 void MacroAssembler::EnterApiExitFrame(int argc) { |
941 EnterExitFramePrologue(); | 941 EnterExitFramePrologue(); |
942 EnterExitFrameEpilogue(argc, false); | 942 EnterExitFrameEpilogue(argc, false); |
943 } | 943 } |
944 | 944 |
945 | 945 |
946 void MacroAssembler::LeaveExitFrame(bool save_doubles) { | 946 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { |
947 // Optionally restore FPU state. | 947 // Optionally restore FPU state. |
948 if (save_doubles) { | 948 if (save_doubles) { |
949 const int offset = -2 * kPointerSize; | 949 const int offset = -2 * kPointerSize; |
950 frstor(MemOperand(ebp, offset - 108)); | 950 frstor(MemOperand(ebp, offset - 108)); |
951 } | 951 } |
952 | 952 |
953 // Get the return address from the stack and restore the frame pointer. | 953 if (pop_arguments) { |
954 mov(ecx, Operand(ebp, 1 * kPointerSize)); | 954 // Get the return address from the stack and restore the frame pointer. |
955 mov(ebp, Operand(ebp, 0 * kPointerSize)); | 955 mov(ecx, Operand(ebp, 1 * kPointerSize)); |
| 956 mov(ebp, Operand(ebp, 0 * kPointerSize)); |
956 | 957 |
957 // Pop the arguments and the receiver from the caller stack. | 958 // Pop the arguments and the receiver from the caller stack. |
958 lea(esp, Operand(esi, 1 * kPointerSize)); | 959 lea(esp, Operand(esi, 1 * kPointerSize)); |
959 | 960 |
960 // Push the return address to get ready to return. | 961 // Push the return address to get ready to return. |
961 push(ecx); | 962 push(ecx); |
| 963 } else { |
| 964 // Otherwise just leave the exit frame. |
| 965 leave(); |
| 966 } |
962 | 967 |
963 LeaveExitFrameEpilogue(true); | 968 LeaveExitFrameEpilogue(true); |
964 } | 969 } |
965 | 970 |
966 | 971 |
967 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { | 972 void MacroAssembler::LeaveExitFrameEpilogue(bool restore_context) { |
968 // Restore current context from top and clear it in debug mode. | 973 // Restore current context from top and clear it in debug mode. |
969 ExternalReference context_address(Isolate::kContextAddress, isolate()); | 974 ExternalReference context_address(Isolate::kContextAddress, isolate()); |
970 if (restore_context) { | 975 if (restore_context) { |
971 mov(esi, Operand::StaticVariable(context_address)); | 976 mov(esi, Operand::StaticVariable(context_address)); |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 mov(eax, dividend); | 3001 mov(eax, dividend); |
2997 shr(eax, 31); | 3002 shr(eax, 31); |
2998 add(edx, eax); | 3003 add(edx, eax); |
2999 } | 3004 } |
3000 | 3005 |
3001 | 3006 |
3002 } // namespace internal | 3007 } // namespace internal |
3003 } // namespace v8 | 3008 } // namespace v8 |
3004 | 3009 |
3005 #endif // V8_TARGET_ARCH_X87 | 3010 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |