OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 __ bind(&fast_case); | 2550 __ bind(&fast_case); |
2551 __ JumpIfSmi(function, &slow_case); | 2551 __ JumpIfSmi(function, &slow_case); |
2552 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); | 2552 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); |
2553 __ j(not_equal, &slow_case); | 2553 __ j(not_equal, &slow_case); |
2554 | 2554 |
2555 // Ensure that {function} has an instance prototype. | 2555 // Ensure that {function} has an instance prototype. |
2556 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), | 2556 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), |
2557 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); | 2557 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); |
2558 __ j(not_zero, &slow_case); | 2558 __ j(not_zero, &slow_case); |
2559 | 2559 |
2560 // Ensure that {function} is not bound. | |
2561 Register const shared_info = scratch; | |
2562 __ mov(shared_info, | |
2563 FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
2564 __ BooleanBitTest(shared_info, SharedFunctionInfo::kCompilerHintsOffset, | |
2565 SharedFunctionInfo::kBoundFunction); | |
2566 __ j(not_zero, &slow_case); | |
2567 | |
2568 // Get the "prototype" (or initial map) of the {function}. | 2560 // Get the "prototype" (or initial map) of the {function}. |
2569 __ mov(function_prototype, | 2561 __ mov(function_prototype, |
2570 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 2562 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
2571 __ AssertNotSmi(function_prototype); | 2563 __ AssertNotSmi(function_prototype); |
2572 | 2564 |
2573 // Resolve the prototype if the {function} has an initial map. Afterwards the | 2565 // Resolve the prototype if the {function} has an initial map. Afterwards the |
2574 // {function_prototype} will be either the JSReceiver prototype object or the | 2566 // {function_prototype} will be either the JSReceiver prototype object or the |
2575 // hole value, which means that no instances of the {function} were created so | 2567 // hole value, which means that no instances of the {function} were created so |
2576 // far and hence we should return false. | 2568 // far and hence we should return false. |
2577 Label function_prototype_valid; | 2569 Label function_prototype_valid; |
(...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5677 Operand(ebp, 7 * kPointerSize), NULL); | 5669 Operand(ebp, 7 * kPointerSize), NULL); |
5678 } | 5670 } |
5679 | 5671 |
5680 | 5672 |
5681 #undef __ | 5673 #undef __ |
5682 | 5674 |
5683 } // namespace internal | 5675 } // namespace internal |
5684 } // namespace v8 | 5676 } // namespace v8 |
5685 | 5677 |
5686 #endif // V8_TARGET_ARCH_IA32 | 5678 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |