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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 2977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | 2988 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
2989 | 2989 |
2990 // We will build up the handler from the bottom by pushing on the stack. | 2990 // We will build up the handler from the bottom by pushing on the stack. |
2991 // First push the context. | 2991 // First push the context. |
2992 if (kind == StackHandler::JS_ENTRY) { | 2992 if (kind == StackHandler::JS_ENTRY) { |
2993 Push(Smi::FromInt(0)); // No context. | 2993 Push(Smi::FromInt(0)); // No context. |
2994 } else { | 2994 } else { |
2995 Push(rsi); | 2995 Push(rsi); |
2996 } | 2996 } |
2997 | 2997 |
2998 // Push the state. | 2998 // Push the index. |
2999 unsigned state = | 2999 Push(Immediate(handler_index)); |
3000 StackHandler::IndexField::encode(handler_index) | | |
3001 StackHandler::KindField::encode(kind); | |
3002 Push(Immediate(state)); | |
3003 | 3000 |
3004 // Link the current handler as the next handler. | 3001 // Link the current handler as the next handler. |
3005 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 3002 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
3006 Push(ExternalOperand(handler_address)); | 3003 Push(ExternalOperand(handler_address)); |
3007 // Set this new handler as the current one. | 3004 // Set this new handler as the current one. |
3008 movp(ExternalOperand(handler_address), rsp); | 3005 movp(ExternalOperand(handler_address), rsp); |
3009 } | 3006 } |
3010 | 3007 |
3011 | 3008 |
3012 void MacroAssembler::PopTryHandler() { | 3009 void MacroAssembler::PopTryHandler() { |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5079 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5076 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5080 movl(rax, dividend); | 5077 movl(rax, dividend); |
5081 shrl(rax, Immediate(31)); | 5078 shrl(rax, Immediate(31)); |
5082 addl(rdx, rax); | 5079 addl(rdx, rax); |
5083 } | 5080 } |
5084 | 5081 |
5085 | 5082 |
5086 } } // namespace v8::internal | 5083 } } // namespace v8::internal |
5087 | 5084 |
5088 #endif // V8_TARGET_ARCH_X64 | 5085 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |