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 == 4 * kPointerSize); | 3045 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); |
3046 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 3046 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
3047 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | 3047 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); |
3048 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | 3048 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
3049 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize); | |
3050 | 3049 |
3051 // For the JSEntry handler, we must preserve the live registers x0-x4. | 3050 // For the JSEntry handler, we must preserve the live registers x0-x4. |
3052 // (See JSEntryStub::GenerateBody().) | 3051 // (See JSEntryStub::GenerateBody().) |
3053 | 3052 |
3054 unsigned state = | 3053 unsigned state = |
3055 StackHandler::IndexField::encode(handler_index) | | 3054 StackHandler::IndexField::encode(handler_index) | |
3056 StackHandler::KindField::encode(kind); | 3055 StackHandler::KindField::encode(kind); |
3057 | 3056 |
3058 // Set up the state for pushing. | 3057 // Set up the state for pushing. |
3059 Mov(x11, state); | 3058 Mov(x11, state); |
3060 | 3059 |
3061 // Push the frame pointer, context, and state. | 3060 // Push the context and state. |
3062 if (kind == StackHandler::JS_ENTRY) { | 3061 if (kind == StackHandler::JS_ENTRY) { |
3063 DCHECK(Smi::FromInt(0) == 0); | 3062 DCHECK(Smi::FromInt(0) == 0); |
3064 Push(xzr, xzr, x11); | 3063 Push(xzr, x11); |
3065 } else { | 3064 } else { |
3066 Push(fp, cp, x11); | 3065 Push(cp, x11); |
3067 } | 3066 } |
3068 | 3067 |
3069 // Link the current handler as the next handler. | 3068 // Link the current handler as the next handler. |
3070 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); | 3069 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); |
3071 Ldr(x10, MemOperand(x11)); | 3070 Ldr(x10, MemOperand(x11)); |
3072 Push(x10); | 3071 Push(x10); |
3073 // Set this new handler as the current one. | 3072 // Set this new handler as the current one. |
3074 Str(jssp, MemOperand(x11)); | 3073 Str(jssp, MemOperand(x11)); |
3075 } | 3074 } |
3076 | 3075 |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5164 } | 5163 } |
5165 } | 5164 } |
5166 | 5165 |
5167 | 5166 |
5168 #undef __ | 5167 #undef __ |
5169 | 5168 |
5170 | 5169 |
5171 } } // namespace v8::internal | 5170 } } // namespace v8::internal |
5172 | 5171 |
5173 #endif // V8_TARGET_ARCH_ARM64 | 5172 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |