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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3262 Register map, | 3262 Register map, |
3263 Register type_reg, | 3263 Register type_reg, |
3264 InstanceType type, | 3264 InstanceType type, |
3265 Label* if_cond_pass, | 3265 Label* if_cond_pass, |
3266 Condition cond) { | 3266 Condition cond) { |
3267 CompareObjectType(object, map, type_reg, type); | 3267 CompareObjectType(object, map, type_reg, type); |
3268 B(cond, if_cond_pass); | 3268 B(cond, if_cond_pass); |
3269 } | 3269 } |
3270 | 3270 |
3271 | 3271 |
| 3272 void MacroAssembler::AllocateJSValue(Register result, Register constructor, |
| 3273 Register value, Register scratch1, |
| 3274 Register scratch2, Label* gc_required) { |
| 3275 DCHECK(!result.is(constructor)); |
| 3276 DCHECK(!result.is(scratch1)); |
| 3277 DCHECK(!result.is(scratch2)); |
| 3278 DCHECK(!result.is(value)); |
| 3279 |
| 3280 // Allocate JSValue in new space. |
| 3281 Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT); |
| 3282 |
| 3283 // Initialize the JSValue. |
| 3284 LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2); |
| 3285 Str(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 3286 LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex); |
| 3287 Str(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset)); |
| 3288 Str(scratch1, FieldMemOperand(result, JSObject::kElementsOffset)); |
| 3289 Str(value, FieldMemOperand(result, JSValue::kValueOffset)); |
| 3290 STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
| 3291 } |
| 3292 |
| 3293 |
3272 void MacroAssembler::JumpIfNotObjectType(Register object, | 3294 void MacroAssembler::JumpIfNotObjectType(Register object, |
3273 Register map, | 3295 Register map, |
3274 Register type_reg, | 3296 Register type_reg, |
3275 InstanceType type, | 3297 InstanceType type, |
3276 Label* if_not_object) { | 3298 Label* if_not_object) { |
3277 JumpIfObjectType(object, map, type_reg, type, if_not_object, ne); | 3299 JumpIfObjectType(object, map, type_reg, type, if_not_object, ne); |
3278 } | 3300 } |
3279 | 3301 |
3280 | 3302 |
3281 // Sets condition flags based on comparison, and returns type in type_reg. | 3303 // Sets condition flags based on comparison, and returns type in type_reg. |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4878 } | 4900 } |
4879 | 4901 |
4880 | 4902 |
4881 #undef __ | 4903 #undef __ |
4882 | 4904 |
4883 | 4905 |
4884 } // namespace internal | 4906 } // namespace internal |
4885 } // namespace v8 | 4907 } // namespace v8 |
4886 | 4908 |
4887 #endif // V8_TARGET_ARCH_ARM64 | 4909 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |