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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 // Fast-case: The {function} must be a valid JSFunction. | 1543 // Fast-case: The {function} must be a valid JSFunction. |
1544 __ Bind(&fast_case); | 1544 __ Bind(&fast_case); |
1545 __ JumpIfSmi(function, &slow_case); | 1545 __ JumpIfSmi(function, &slow_case); |
1546 __ JumpIfNotObjectType(function, function_map, scratch, JS_FUNCTION_TYPE, | 1546 __ JumpIfNotObjectType(function, function_map, scratch, JS_FUNCTION_TYPE, |
1547 &slow_case); | 1547 &slow_case); |
1548 | 1548 |
1549 // Ensure that {function} has an instance prototype. | 1549 // Ensure that {function} has an instance prototype. |
1550 __ Ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | 1550 __ Ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
1551 __ Tbnz(scratch, Map::kHasNonInstancePrototype, &slow_case); | 1551 __ Tbnz(scratch, Map::kHasNonInstancePrototype, &slow_case); |
1552 | 1552 |
| 1553 // Ensure that {function} is not bound. |
| 1554 Register const shared_info = scratch; |
| 1555 Register const scratch_w = scratch.W(); |
| 1556 __ Ldr(shared_info, |
| 1557 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 1558 // On 64-bit platforms, compiler hints field is not a smi. See definition of |
| 1559 // kCompilerHintsOffset in src/objects.h. |
| 1560 __ Ldr(scratch_w, FieldMemOperand(shared_info, |
| 1561 SharedFunctionInfo::kCompilerHintsOffset)); |
| 1562 __ Tbnz(scratch_w, SharedFunctionInfo::kBoundFunction, &slow_case); |
| 1563 |
1553 // Get the "prototype" (or initial map) of the {function}. | 1564 // Get the "prototype" (or initial map) of the {function}. |
1554 __ Ldr(function_prototype, | 1565 __ Ldr(function_prototype, |
1555 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1566 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
1556 __ AssertNotSmi(function_prototype); | 1567 __ AssertNotSmi(function_prototype); |
1557 | 1568 |
1558 // Resolve the prototype if the {function} has an initial map. Afterwards the | 1569 // Resolve the prototype if the {function} has an initial map. Afterwards the |
1559 // {function_prototype} will be either the JSReceiver prototype object or the | 1570 // {function_prototype} will be either the JSReceiver prototype object or the |
1560 // hole value, which means that no instances of the {function} were created so | 1571 // hole value, which means that no instances of the {function} were created so |
1561 // far and hence we should return false. | 1572 // far and hence we should return false. |
1562 Label function_prototype_valid; | 1573 Label function_prototype_valid; |
(...skipping 4276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5839 MemOperand(fp, 6 * kPointerSize), NULL); | 5850 MemOperand(fp, 6 * kPointerSize), NULL); |
5840 } | 5851 } |
5841 | 5852 |
5842 | 5853 |
5843 #undef __ | 5854 #undef __ |
5844 | 5855 |
5845 } // namespace internal | 5856 } // namespace internal |
5846 } // namespace v8 | 5857 } // namespace v8 |
5847 | 5858 |
5848 #endif // V8_TARGET_ARCH_ARM64 | 5859 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |