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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 | 1016 |
1017 | 1017 |
1018 void MacroAssembler::LeaveApiExitFrame(bool restore_context) { | 1018 void MacroAssembler::LeaveApiExitFrame(bool restore_context) { |
1019 mov(esp, ebp); | 1019 mov(esp, ebp); |
1020 pop(ebp); | 1020 pop(ebp); |
1021 | 1021 |
1022 LeaveExitFrameEpilogue(restore_context); | 1022 LeaveExitFrameEpilogue(restore_context); |
1023 } | 1023 } |
1024 | 1024 |
1025 | 1025 |
1026 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 1026 void MacroAssembler::PushStackHandler() { |
1027 int handler_index) { | |
1028 // Adjust this code if not the case. | 1027 // Adjust this code if not the case. |
1029 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); | 1028 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
1030 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 1029 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
1031 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | |
1032 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | |
1033 | |
1034 // We will build up the handler from the bottom by pushing on the stack. | |
1035 // First push the context. | |
1036 if (kind == StackHandler::JS_ENTRY) { | |
1037 push(Immediate(Smi::FromInt(0))); // No context. | |
1038 } else { | |
1039 push(esi); | |
1040 } | |
1041 | |
1042 // Push the index. | |
1043 push(Immediate(handler_index)); | |
1044 | 1030 |
1045 // Link the current handler as the next handler. | 1031 // Link the current handler as the next handler. |
1046 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 1032 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
1047 push(Operand::StaticVariable(handler_address)); | 1033 push(Operand::StaticVariable(handler_address)); |
| 1034 |
1048 // Set this new handler as the current one. | 1035 // Set this new handler as the current one. |
1049 mov(Operand::StaticVariable(handler_address), esp); | 1036 mov(Operand::StaticVariable(handler_address), esp); |
1050 } | 1037 } |
1051 | 1038 |
1052 | 1039 |
1053 void MacroAssembler::PopTryHandler() { | 1040 void MacroAssembler::PopStackHandler() { |
1054 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 1041 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
1055 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 1042 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
1056 pop(Operand::StaticVariable(handler_address)); | 1043 pop(Operand::StaticVariable(handler_address)); |
1057 add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); | 1044 add(esp, Immediate(StackHandlerConstants::kSize - kPointerSize)); |
1058 } | 1045 } |
1059 | 1046 |
1060 | 1047 |
1061 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, | 1048 void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, |
1062 Register scratch1, | 1049 Register scratch1, |
1063 Register scratch2, | 1050 Register scratch2, |
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3236 if (mag.shift > 0) sar(edx, mag.shift); | 3223 if (mag.shift > 0) sar(edx, mag.shift); |
3237 mov(eax, dividend); | 3224 mov(eax, dividend); |
3238 shr(eax, 31); | 3225 shr(eax, 31); |
3239 add(edx, eax); | 3226 add(edx, eax); |
3240 } | 3227 } |
3241 | 3228 |
3242 | 3229 |
3243 } } // namespace v8::internal | 3230 } } // namespace v8::internal |
3244 | 3231 |
3245 #endif // V8_TARGET_ARCH_IA32 | 3232 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |