OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 CEntryStub ces(isolate(), 1); | 3035 CEntryStub ces(isolate(), 1); |
3036 DCHECK(AllowThisStubCall(&ces)); | 3036 DCHECK(AllowThisStubCall(&ces)); |
3037 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 3037 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
3038 } | 3038 } |
3039 | 3039 |
3040 | 3040 |
3041 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 3041 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, |
3042 int handler_index) { | 3042 int handler_index) { |
3043 DCHECK(jssp.Is(StackPointer())); | 3043 DCHECK(jssp.Is(StackPointer())); |
3044 // Adjust this code if the asserts don't hold. | 3044 // Adjust this code if the asserts don't hold. |
3045 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 3045 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
3046 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 3046 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
3047 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 3047 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); |
3048 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 3048 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
3049 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 3049 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize); |
3050 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | |
3051 | 3050 |
3052 // For the JSEntry handler, we must preserve the live registers x0-x4. | 3051 // For the JSEntry handler, we must preserve the live registers x0-x4. |
3053 // (See JSEntryStub::GenerateBody().) | 3052 // (See JSEntryStub::GenerateBody().) |
3054 | 3053 |
3055 unsigned state = | 3054 unsigned state = |
3056 StackHandler::IndexField::encode(handler_index) | | 3055 StackHandler::IndexField::encode(handler_index) | |
3057 StackHandler::KindField::encode(kind); | 3056 StackHandler::KindField::encode(kind); |
3058 | 3057 |
3059 // Set up the code object and the state for pushing. | 3058 // Set up the state for pushing. |
3060 Mov(x10, Operand(CodeObject())); | |
3061 Mov(x11, state); | 3059 Mov(x11, state); |
3062 | 3060 |
3063 // Push the frame pointer, context, state, and code object. | 3061 // Push the frame pointer, context, and state. |
3064 if (kind == StackHandler::JS_ENTRY) { | 3062 if (kind == StackHandler::JS_ENTRY) { |
3065 DCHECK(Smi::FromInt(0) == 0); | 3063 DCHECK(Smi::FromInt(0) == 0); |
3066 Push(xzr, xzr, x11, x10); | 3064 Push(xzr, xzr, x11); |
3067 } else { | 3065 } else { |
3068 Push(fp, cp, x11, x10); | 3066 Push(fp, cp, x11); |
3069 } | 3067 } |
3070 | 3068 |
3071 // Link the current handler as the next handler. | 3069 // Link the current handler as the next handler. |
3072 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); | 3070 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); |
3073 Ldr(x10, MemOperand(x11)); | 3071 Ldr(x10, MemOperand(x11)); |
3074 Push(x10); | 3072 Push(x10); |
3075 // Set this new handler as the current one. | 3073 // Set this new handler as the current one. |
3076 Str(jssp, MemOperand(x11)); | 3074 Str(jssp, MemOperand(x11)); |
3077 } | 3075 } |
3078 | 3076 |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5166 } | 5164 } |
5167 } | 5165 } |
5168 | 5166 |
5169 | 5167 |
5170 #undef __ | 5168 #undef __ |
5171 | 5169 |
5172 | 5170 |
5173 } } // namespace v8::internal | 5171 } } // namespace v8::internal |
5174 | 5172 |
5175 #endif // V8_TARGET_ARCH_ARM64 | 5173 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |