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 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3393 Ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); | 3393 Ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
3394 Bind(&loop); | 3394 Bind(&loop); |
3395 JumpIfSmi(result, &done); | 3395 JumpIfSmi(result, &done); |
3396 CompareObjectType(result, temp, temp2, MAP_TYPE); | 3396 CompareObjectType(result, temp, temp2, MAP_TYPE); |
3397 B(ne, &done); | 3397 B(ne, &done); |
3398 Ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); | 3398 Ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
3399 B(&loop); | 3399 B(&loop); |
3400 Bind(&done); | 3400 Bind(&done); |
3401 } | 3401 } |
3402 | 3402 |
3403 | |
3404 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | |
3405 Register scratch, Label* miss) { | |
3406 DCHECK(!AreAliased(function, result, scratch)); | |
3407 | |
3408 // Get the prototype or initial map from the function. | |
3409 Ldr(result, | |
3410 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | |
3411 | |
3412 // If the prototype or initial map is the hole, don't return it and simply | |
3413 // miss the cache instead. This will allow us to allocate a prototype object | |
3414 // on-demand in the runtime system. | |
3415 JumpIfRoot(result, Heap::kTheHoleValueRootIndex, miss); | |
3416 | |
3417 // If the function does not have an initial map, we're done. | |
3418 Label done; | |
3419 JumpIfNotObjectType(result, scratch, scratch, MAP_TYPE, &done); | |
3420 | |
3421 // Get the prototype from the initial map. | |
3422 Ldr(result, FieldMemOperand(result, Map::kPrototypeOffset)); | |
3423 | |
3424 // All done. | |
3425 Bind(&done); | |
3426 } | |
3427 | |
3428 | |
3429 void MacroAssembler::PushRoot(Heap::RootListIndex index) { | 3403 void MacroAssembler::PushRoot(Heap::RootListIndex index) { |
3430 UseScratchRegisterScope temps(this); | 3404 UseScratchRegisterScope temps(this); |
3431 Register temp = temps.AcquireX(); | 3405 Register temp = temps.AcquireX(); |
3432 LoadRoot(temp, index); | 3406 LoadRoot(temp, index); |
3433 Push(temp); | 3407 Push(temp); |
3434 } | 3408 } |
3435 | 3409 |
3436 | 3410 |
3437 void MacroAssembler::CompareRoot(const Register& obj, | 3411 void MacroAssembler::CompareRoot(const Register& obj, |
3438 Heap::RootListIndex index) { | 3412 Heap::RootListIndex index) { |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4660 } | 4634 } |
4661 | 4635 |
4662 | 4636 |
4663 #undef __ | 4637 #undef __ |
4664 | 4638 |
4665 | 4639 |
4666 } // namespace internal | 4640 } // namespace internal |
4667 } // namespace v8 | 4641 } // namespace v8 |
4668 | 4642 |
4669 #endif // V8_TARGET_ARCH_ARM64 | 4643 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |