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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 | 980 |
981 | 981 |
982 void MacroAssembler::LeaveApiExitFrame(bool restore_context) { | 982 void MacroAssembler::LeaveApiExitFrame(bool restore_context) { |
983 mov(esp, ebp); | 983 mov(esp, ebp); |
984 pop(ebp); | 984 pop(ebp); |
985 | 985 |
986 LeaveExitFrameEpilogue(restore_context); | 986 LeaveExitFrameEpilogue(restore_context); |
987 } | 987 } |
988 | 988 |
989 | 989 |
990 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 990 void MacroAssembler::PushStackHandler() { |
991 int handler_index) { | |
992 // Adjust this code if not the case. | 991 // Adjust this code if not the case. |
993 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); | 992 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
994 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 993 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
995 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | |
996 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | |
997 | |
998 // We will build up the handler from the bottom by pushing on the stack. | |
999 // First push the context. | |
1000 if (kind == StackHandler::JS_ENTRY) { | |
1001 push(Immediate(Smi::FromInt(0))); // No context. | |
1002 } else { | |
1003 push(esi); | |
1004 } | |
1005 | |
1006 // Push the index. | |
1007 push(Immediate(handler_index)); | |
1008 | 994 |
1009 // Link the current handler as the next handler. | 995 // Link the current handler as the next handler. |
1010 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 996 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
1011 push(Operand::StaticVariable(handler_address)); | 997 push(Operand::StaticVariable(handler_address)); |
| 998 |
1012 // Set this new handler as the current one. | 999 // Set this new handler as the current one. |
1013 mov(Operand::StaticVariable(handler_address), esp); | 1000 mov(Operand::StaticVariable(handler_address), esp); |
1014 } | 1001 } |
1015 | 1002 |
1016 | 1003 |
1017 void MacroAssembler::PopTryHandler() { | 1004 void MacroAssembler::PopStackHandler() { |
1018 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 1005 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
1019 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 1006 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
1020 pop(Operand::StaticVariable(handler_address)); | 1007 pop(Operand::StaticVariable(handler_address)); |
1021 add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); | 1008 add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); |
1022 } | 1009 } |
1023 | 1010 |
1024 | 1011 |
1025 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, | 1012 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, |
1026 Register scratch1, | 1013 Register scratch1, |
1027 Register scratch2, | 1014 Register scratch2, |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3115 if (mag.shift > 0) sar(edx, mag.shift); | 3102 if (mag.shift > 0) sar(edx, mag.shift); |
3116 mov(eax, dividend); | 3103 mov(eax, dividend); |
3117 shr(eax, 31); | 3104 shr(eax, 31); |
3118 add(edx, eax); | 3105 add(edx, eax); |
3119 } | 3106 } |
3120 | 3107 |
3121 | 3108 |
3122 } } // namespace v8::internal | 3109 } } // namespace v8::internal |
3123 | 3110 |
3124 #endif // V8_TARGET_ARCH_X87 | 3111 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |