OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 __ bne(&slow_case); | 1414 __ bne(&slow_case); |
1415 __ LoadRoot(r3, Heap::kFalseValueRootIndex); | 1415 __ LoadRoot(r3, Heap::kFalseValueRootIndex); |
1416 __ Ret(); | 1416 __ Ret(); |
1417 | 1417 |
1418 // Fast-case: The {function} must be a valid JSFunction. | 1418 // Fast-case: The {function} must be a valid JSFunction. |
1419 __ bind(&fast_case); | 1419 __ bind(&fast_case); |
1420 __ JumpIfSmi(function, &slow_case); | 1420 __ JumpIfSmi(function, &slow_case); |
1421 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); | 1421 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); |
1422 __ bne(&slow_case); | 1422 __ bne(&slow_case); |
1423 | 1423 |
| 1424 // Go to the runtime if the function is not a constructor. |
| 1425 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
| 1426 __ TestBit(scratch, Map::kIsConstructor, r0); |
| 1427 __ beq(&slow_case, cr0); |
| 1428 |
1424 // Ensure that {function} has an instance prototype. | 1429 // Ensure that {function} has an instance prototype. |
1425 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | |
1426 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); | 1430 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); |
1427 __ bne(&slow_case, cr0); | 1431 __ bne(&slow_case, cr0); |
1428 | 1432 |
1429 // Get the "prototype" (or initial map) of the {function}. | 1433 // Get the "prototype" (or initial map) of the {function}. |
1430 __ LoadP(function_prototype, | 1434 __ LoadP(function_prototype, |
1431 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1435 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
1432 __ AssertNotSmi(function_prototype); | 1436 __ AssertNotSmi(function_prototype); |
1433 | 1437 |
1434 // Resolve the prototype if the {function} has an initial map. Afterwards the | 1438 // Resolve the prototype if the {function} has an initial map. Afterwards the |
1435 // {function_prototype} will be either the JSReceiver prototype object or the | 1439 // {function_prototype} will be either the JSReceiver prototype object or the |
(...skipping 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5808 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5812 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5809 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5813 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5810 } | 5814 } |
5811 | 5815 |
5812 | 5816 |
5813 #undef __ | 5817 #undef __ |
5814 } // namespace internal | 5818 } // namespace internal |
5815 } // namespace v8 | 5819 } // namespace v8 |
5816 | 5820 |
5817 #endif // V8_TARGET_ARCH_PPC | 5821 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |