| 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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | 1031 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); |
| 1032 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | 1032 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
| 1033 | 1033 |
| 1034 // We will build up the handler from the bottom by pushing on the stack. | 1034 // We will build up the handler from the bottom by pushing on the stack. |
| 1035 // First push the context. | 1035 // First push the context. |
| 1036 if (kind == StackHandler::JS_ENTRY) { | 1036 if (kind == StackHandler::JS_ENTRY) { |
| 1037 push(Immediate(Smi::FromInt(0))); // No context. | 1037 push(Immediate(Smi::FromInt(0))); // No context. |
| 1038 } else { | 1038 } else { |
| 1039 push(esi); | 1039 push(esi); |
| 1040 } | 1040 } |
| 1041 | 1041 // Push the state. |
| 1042 // Push the index. | 1042 unsigned state = |
| 1043 push(Immediate(handler_index)); | 1043 StackHandler::IndexField::encode(handler_index) | |
| 1044 StackHandler::KindField::encode(kind); |
| 1045 push(Immediate(state)); |
| 1044 | 1046 |
| 1045 // Link the current handler as the next handler. | 1047 // Link the current handler as the next handler. |
| 1046 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 1048 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
| 1047 push(Operand::StaticVariable(handler_address)); | 1049 push(Operand::StaticVariable(handler_address)); |
| 1048 // Set this new handler as the current one. | 1050 // Set this new handler as the current one. |
| 1049 mov(Operand::StaticVariable(handler_address), esp); | 1051 mov(Operand::StaticVariable(handler_address), esp); |
| 1050 } | 1052 } |
| 1051 | 1053 |
| 1052 | 1054 |
| 1053 void MacroAssembler::PopTryHandler() { | 1055 void MacroAssembler::PopTryHandler() { |
| (...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3225 if (mag.shift > 0) sar(edx, mag.shift); | 3227 if (mag.shift > 0) sar(edx, mag.shift); |
| 3226 mov(eax, dividend); | 3228 mov(eax, dividend); |
| 3227 shr(eax, 31); | 3229 shr(eax, 31); |
| 3228 add(edx, eax); | 3230 add(edx, eax); |
| 3229 } | 3231 } |
| 3230 | 3232 |
| 3231 | 3233 |
| 3232 } } // namespace v8::internal | 3234 } } // namespace v8::internal |
| 3233 | 3235 |
| 3234 #endif // V8_TARGET_ARCH_IA32 | 3236 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |