| 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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | 995 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); |
| 996 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | 996 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
| 997 | 997 |
| 998 // We will build up the handler from the bottom by pushing on the stack. | 998 // We will build up the handler from the bottom by pushing on the stack. |
| 999 // First push the context. | 999 // First push the context. |
| 1000 if (kind == StackHandler::JS_ENTRY) { | 1000 if (kind == StackHandler::JS_ENTRY) { |
| 1001 push(Immediate(Smi::FromInt(0))); // No context. | 1001 push(Immediate(Smi::FromInt(0))); // No context. |
| 1002 } else { | 1002 } else { |
| 1003 push(esi); | 1003 push(esi); |
| 1004 } | 1004 } |
| 1005 // Push the state. | 1005 |
| 1006 unsigned state = | 1006 // Push the index. |
| 1007 StackHandler::IndexField::encode(handler_index) | | 1007 push(Immediate(handler_index)); |
| 1008 StackHandler::KindField::encode(kind); | |
| 1009 push(Immediate(state)); | |
| 1010 | 1008 |
| 1011 // Link the current handler as the next handler. | 1009 // Link the current handler as the next handler. |
| 1012 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 1010 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
| 1013 push(Operand::StaticVariable(handler_address)); | 1011 push(Operand::StaticVariable(handler_address)); |
| 1014 // Set this new handler as the current one. | 1012 // Set this new handler as the current one. |
| 1015 mov(Operand::StaticVariable(handler_address), esp); | 1013 mov(Operand::StaticVariable(handler_address), esp); |
| 1016 } | 1014 } |
| 1017 | 1015 |
| 1018 | 1016 |
| 1019 void MacroAssembler::PopTryHandler() { | 1017 void MacroAssembler::PopTryHandler() { |
| (...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3106 if (mag.shift > 0) sar(edx, mag.shift); | 3104 if (mag.shift > 0) sar(edx, mag.shift); |
| 3107 mov(eax, dividend); | 3105 mov(eax, dividend); |
| 3108 shr(eax, 31); | 3106 shr(eax, 31); |
| 3109 add(edx, eax); | 3107 add(edx, eax); |
| 3110 } | 3108 } |
| 3111 | 3109 |
| 3112 | 3110 |
| 3113 } } // namespace v8::internal | 3111 } } // namespace v8::internal |
| 3114 | 3112 |
| 3115 #endif // V8_TARGET_ARCH_X87 | 3113 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |