| 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/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 __ bind(&fast_case); | 1416 __ bind(&fast_case); |
| 1417 __ JumpIfSmi(function, &slow_case); | 1417 __ JumpIfSmi(function, &slow_case); |
| 1418 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); | 1418 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); |
| 1419 __ bne(&slow_case); | 1419 __ bne(&slow_case); |
| 1420 | 1420 |
| 1421 // Ensure that {function} has an instance prototype. | 1421 // Ensure that {function} has an instance prototype. |
| 1422 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); | 1422 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
| 1423 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); | 1423 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); |
| 1424 __ bne(&slow_case, cr0); | 1424 __ bne(&slow_case, cr0); |
| 1425 | 1425 |
| 1426 // Ensure that {function} is not bound. | |
| 1427 Register const shared_info = scratch; | |
| 1428 __ LoadP(shared_info, | |
| 1429 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
| 1430 __ lwz(scratch, FieldMemOperand(shared_info, | |
| 1431 SharedFunctionInfo::kCompilerHintsOffset)); | |
| 1432 __ TestBit(scratch, SharedFunctionInfo::kBoundBit, r0); | |
| 1433 __ bne(&slow_case, cr0); | |
| 1434 | |
| 1435 // Get the "prototype" (or initial map) of the {function}. | 1426 // Get the "prototype" (or initial map) of the {function}. |
| 1436 __ LoadP(function_prototype, | 1427 __ LoadP(function_prototype, |
| 1437 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 1428 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
| 1438 __ AssertNotSmi(function_prototype); | 1429 __ AssertNotSmi(function_prototype); |
| 1439 | 1430 |
| 1440 // 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 |
| 1441 // {function_prototype} will be either the JSReceiver prototype object or the | 1432 // {function_prototype} will be either the JSReceiver prototype object or the |
| 1442 // hole value, which means that no instances of the {function} were created so | 1433 // hole value, which means that no instances of the {function} were created so |
| 1443 // far and hence we should return false. | 1434 // far and hence we should return false. |
| 1444 Label function_prototype_valid; | 1435 Label function_prototype_valid; |
| (...skipping 4227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5672 kStackUnwindSpace, NULL, | 5663 kStackUnwindSpace, NULL, |
| 5673 MemOperand(fp, 6 * kPointerSize), NULL); | 5664 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5674 } | 5665 } |
| 5675 | 5666 |
| 5676 | 5667 |
| 5677 #undef __ | 5668 #undef __ |
| 5678 } // namespace internal | 5669 } // namespace internal |
| 5679 } // namespace v8 | 5670 } // namespace v8 |
| 5680 | 5671 |
| 5681 #endif // V8_TARGET_ARCH_PPC | 5672 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |