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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 &slow_case); | 1550 &slow_case); |
1551 __ LoadRoot(x0, Heap::kFalseValueRootIndex); | 1551 __ LoadRoot(x0, Heap::kFalseValueRootIndex); |
1552 __ Ret(); | 1552 __ Ret(); |
1553 | 1553 |
1554 // Fast-case: The {function} must be a valid JSFunction. | 1554 // Fast-case: The {function} must be a valid JSFunction. |
1555 __ Bind(&fast_case); | 1555 __ Bind(&fast_case); |
1556 __ JumpIfSmi(function, &slow_case); | 1556 __ JumpIfSmi(function, &slow_case); |
1557 __ JumpIfNotObjectType(function, function_map, scratch, JS_FUNCTION_TYPE, | 1557 __ JumpIfNotObjectType(function, function_map, scratch, JS_FUNCTION_TYPE, |
1558 &slow_case); | 1558 &slow_case); |
1559 | 1559 |
| 1560 // Go to the runtime if the function is not a constructor. |
| 1561 __ Ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
| 1562 __ Tbz(scratch, Map::kIsConstructor, &slow_case); |
| 1563 |
1560 // Ensure that {function} has an instance prototype. | 1564 // Ensure that {function} has an instance prototype. |
1561 __ Ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | |
1562 __ Tbnz(scratch, Map::kHasNonInstancePrototype, &slow_case); | 1565 __ Tbnz(scratch, Map::kHasNonInstancePrototype, &slow_case); |
1563 | 1566 |
1564 // Get the "prototype" (or initial map) of the {function}. | 1567 // Get the "prototype" (or initial map) of the {function}. |
1565 __ Ldr(function_prototype, | 1568 __ Ldr(function_prototype, |
1566 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1569 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
1567 __ AssertNotSmi(function_prototype); | 1570 __ AssertNotSmi(function_prototype); |
1568 | 1571 |
1569 // Resolve the prototype if the {function} has an initial map. Afterwards the | 1572 // Resolve the prototype if the {function} has an initial map. Afterwards the |
1570 // {function_prototype} will be either the JSReceiver prototype object or the | 1573 // {function_prototype} will be either the JSReceiver prototype object or the |
1571 // hole value, which means that no instances of the {function} were created so | 1574 // hole value, which means that no instances of the {function} were created so |
(...skipping 4377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5949 return_value_operand, NULL); | 5952 return_value_operand, NULL); |
5950 } | 5953 } |
5951 | 5954 |
5952 | 5955 |
5953 #undef __ | 5956 #undef __ |
5954 | 5957 |
5955 } // namespace internal | 5958 } // namespace internal |
5956 } // namespace v8 | 5959 } // namespace v8 |
5957 | 5960 |
5958 #endif // V8_TARGET_ARCH_ARM64 | 5961 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |