| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 __ bne(&slow_case); | 1407 __ bne(&slow_case); |
| 1408 __ LoadRoot(r2, Heap::kFalseValueRootIndex); | 1408 __ LoadRoot(r2, Heap::kFalseValueRootIndex); |
| 1409 __ Ret(); | 1409 __ Ret(); |
| 1410 | 1410 |
| 1411 // Fast-case: The {function} must be a valid JSFunction. | 1411 // Fast-case: The {function} must be a valid JSFunction. |
| 1412 __ bind(&fast_case); | 1412 __ bind(&fast_case); |
| 1413 __ JumpIfSmi(function, &slow_case); | 1413 __ JumpIfSmi(function, &slow_case); |
| 1414 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); | 1414 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); |
| 1415 __ bne(&slow_case); | 1415 __ bne(&slow_case); |
| 1416 | 1416 |
| 1417 // Go to the runtime if the function is not a constructor. |
| 1418 __ LoadlB(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
| 1419 __ TestBit(scratch, Map::kIsConstructor, r0); |
| 1420 __ beq(&slow_case); |
| 1421 |
| 1417 // Ensure that {function} has an instance prototype. | 1422 // Ensure that {function} has an instance prototype. |
| 1418 __ LoadlB(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | |
| 1419 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); | 1423 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); |
| 1420 __ bne(&slow_case); | 1424 __ bne(&slow_case); |
| 1421 | 1425 |
| 1422 // Get the "prototype" (or initial map) of the {function}. | 1426 // Get the "prototype" (or initial map) of the {function}. |
| 1423 __ LoadP(function_prototype, | 1427 __ LoadP(function_prototype, |
| 1424 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1428 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
| 1425 __ AssertNotSmi(function_prototype); | 1429 __ AssertNotSmi(function_prototype); |
| 1426 | 1430 |
| 1427 // Resolve the prototype if the {function} has an initial map. Afterwards the | 1431 // Resolve the prototype if the {function} has an initial map. Afterwards the |
| 1428 // {function_prototype} will be either the JSReceiver prototype object or the | 1432 // {function_prototype} will be either the JSReceiver prototype object or the |
| (...skipping 4281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5710 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5714 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5711 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5715 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5712 } | 5716 } |
| 5713 | 5717 |
| 5714 #undef __ | 5718 #undef __ |
| 5715 | 5719 |
| 5716 } // namespace internal | 5720 } // namespace internal |
| 5717 } // namespace v8 | 5721 } // namespace v8 |
| 5718 | 5722 |
| 5719 #endif // V8_TARGET_ARCH_S390 | 5723 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |