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 4069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4080 #endif | 4080 #endif |
4081 | 4081 |
4082 // Load the native context of the current context. | 4082 // Load the native context of the current context. |
4083 int offset = | 4083 int offset = |
4084 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | 4084 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; |
4085 Ldr(scratch1, FieldMemOperand(scratch1, offset)); | 4085 Ldr(scratch1, FieldMemOperand(scratch1, offset)); |
4086 Ldr(scratch1, FieldMemOperand(scratch1, GlobalObject::kNativeContextOffset)); | 4086 Ldr(scratch1, FieldMemOperand(scratch1, GlobalObject::kNativeContextOffset)); |
4087 | 4087 |
4088 // Check the context is a native context. | 4088 // Check the context is a native context. |
4089 if (emit_debug_code()) { | 4089 if (emit_debug_code()) { |
4090 // Read the first word and compare to the global_context_map. | 4090 // Read the first word and compare to the native_context_map. |
4091 Ldr(scratch2, FieldMemOperand(scratch1, HeapObject::kMapOffset)); | 4091 Ldr(scratch2, FieldMemOperand(scratch1, HeapObject::kMapOffset)); |
4092 CompareRoot(scratch2, Heap::kNativeContextMapRootIndex); | 4092 CompareRoot(scratch2, Heap::kNativeContextMapRootIndex); |
4093 Check(eq, kExpectedNativeContext); | 4093 Check(eq, kExpectedNativeContext); |
4094 } | 4094 } |
4095 | 4095 |
4096 // Check if both contexts are the same. | 4096 // Check if both contexts are the same. |
4097 Ldr(scratch2, FieldMemOperand(holder_reg, | 4097 Ldr(scratch2, FieldMemOperand(holder_reg, |
4098 JSGlobalProxy::kNativeContextOffset)); | 4098 JSGlobalProxy::kNativeContextOffset)); |
4099 Cmp(scratch1, scratch2); | 4099 Cmp(scratch1, scratch2); |
4100 B(&same_contexts, eq); | 4100 B(&same_contexts, eq); |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5388 } | 5388 } |
5389 } | 5389 } |
5390 | 5390 |
5391 | 5391 |
5392 #undef __ | 5392 #undef __ |
5393 | 5393 |
5394 | 5394 |
5395 } } // namespace v8::internal | 5395 } } // namespace v8::internal |
5396 | 5396 |
5397 #endif // V8_TARGET_ARCH_ARM64 | 5397 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |