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 3020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3031 | 3031 |
3032 void MacroAssembler::DebugBreak() { | 3032 void MacroAssembler::DebugBreak() { |
3033 Mov(x0, 0); | 3033 Mov(x0, 0); |
3034 Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate())); | 3034 Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate())); |
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::PushStackHandler() { |
3042 int handler_index) { | |
3043 DCHECK(jssp.Is(StackPointer())); | 3042 DCHECK(jssp.Is(StackPointer())); |
3044 // Adjust this code if the asserts don't hold. | 3043 // Adjust this code if the asserts don't hold. |
3045 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); | 3044 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
3046 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 3045 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
3047 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | |
3048 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | |
3049 | 3046 |
3050 // For the JSEntry handler, we must preserve the live registers x0-x4. | 3047 // For the JSEntry handler, we must preserve the live registers x0-x4. |
3051 // (See JSEntryStub::GenerateBody().) | 3048 // (See JSEntryStub::GenerateBody().) |
3052 | 3049 |
3053 // Set up the index for pushing. | |
3054 Mov(x11, handler_index); | |
3055 | |
3056 // Push the context and state. | |
3057 if (kind == StackHandler::JS_ENTRY) { | |
3058 DCHECK(Smi::FromInt(0) == 0); | |
3059 Push(xzr, x11); | |
3060 } else { | |
3061 Push(cp, x11); | |
3062 } | |
3063 | |
3064 // Link the current handler as the next handler. | 3050 // Link the current handler as the next handler. |
3065 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); | 3051 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); |
3066 Ldr(x10, MemOperand(x11)); | 3052 Ldr(x10, MemOperand(x11)); |
3067 Push(x10); | 3053 Push(x10); |
| 3054 |
3068 // Set this new handler as the current one. | 3055 // Set this new handler as the current one. |
3069 Str(jssp, MemOperand(x11)); | 3056 Str(jssp, MemOperand(x11)); |
3070 } | 3057 } |
3071 | 3058 |
3072 | 3059 |
3073 void MacroAssembler::PopTryHandler() { | 3060 void MacroAssembler::PopStackHandler() { |
3074 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 3061 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
3075 Pop(x10); | 3062 Pop(x10); |
3076 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); | 3063 Mov(x11, ExternalReference(Isolate::kHandlerAddress, isolate())); |
3077 Drop(StackHandlerConstants::kSize - kXRegSize, kByteSizeInBytes); | 3064 Drop(StackHandlerConstants::kSize - kXRegSize, kByteSizeInBytes); |
3078 Str(x10, MemOperand(x11)); | 3065 Str(x10, MemOperand(x11)); |
3079 } | 3066 } |
3080 | 3067 |
3081 | 3068 |
3082 void MacroAssembler::Allocate(int object_size, | 3069 void MacroAssembler::Allocate(int object_size, |
3083 Register result, | 3070 Register result, |
(...skipping 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5159 } | 5146 } |
5160 } | 5147 } |
5161 | 5148 |
5162 | 5149 |
5163 #undef __ | 5150 #undef __ |
5164 | 5151 |
5165 | 5152 |
5166 } } // namespace v8::internal | 5153 } } // namespace v8::internal |
5167 | 5154 |
5168 #endif // V8_TARGET_ARCH_ARM64 | 5155 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |