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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 2493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 __ bind(&fast_case); | 2504 __ bind(&fast_case); |
2505 __ JumpIfSmi(function, &slow_case); | 2505 __ JumpIfSmi(function, &slow_case); |
2506 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); | 2506 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); |
2507 __ j(not_equal, &slow_case); | 2507 __ j(not_equal, &slow_case); |
2508 | 2508 |
2509 // Ensure that {function} has an instance prototype. | 2509 // Ensure that {function} has an instance prototype. |
2510 __ testb(FieldOperand(function_map, Map::kBitFieldOffset), | 2510 __ testb(FieldOperand(function_map, Map::kBitFieldOffset), |
2511 Immediate(1 << Map::kHasNonInstancePrototype)); | 2511 Immediate(1 << Map::kHasNonInstancePrototype)); |
2512 __ j(not_zero, &slow_case); | 2512 __ j(not_zero, &slow_case); |
2513 | 2513 |
2514 // Ensure that {function} is not bound. | |
2515 Register const shared_info = kScratchRegister; | |
2516 __ movp(shared_info, | |
2517 FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
2518 __ TestBitSharedFunctionInfoSpecialField( | |
2519 shared_info, SharedFunctionInfo::kCompilerHintsOffset, | |
2520 SharedFunctionInfo::kBoundFunction); | |
2521 __ j(not_zero, &slow_case); | |
2522 | |
2523 // Get the "prototype" (or initial map) of the {function}. | 2514 // Get the "prototype" (or initial map) of the {function}. |
2524 __ movp(function_prototype, | 2515 __ movp(function_prototype, |
2525 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 2516 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
2526 __ AssertNotSmi(function_prototype); | 2517 __ AssertNotSmi(function_prototype); |
2527 | 2518 |
2528 // Resolve the prototype if the {function} has an initial map. Afterwards the | 2519 // Resolve the prototype if the {function} has an initial map. Afterwards the |
2529 // {function_prototype} will be either the JSReceiver prototype object or the | 2520 // {function_prototype} will be either the JSReceiver prototype object or the |
2530 // hole value, which means that no instances of the {function} were created so | 2521 // hole value, which means that no instances of the {function} were created so |
2531 // far and hence we should return false. | 2522 // far and hence we should return false. |
2532 Label function_prototype_valid; | 2523 Label function_prototype_valid; |
(...skipping 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5425 kStackSpace, nullptr, return_value_operand, NULL); | 5416 kStackSpace, nullptr, return_value_operand, NULL); |
5426 } | 5417 } |
5427 | 5418 |
5428 | 5419 |
5429 #undef __ | 5420 #undef __ |
5430 | 5421 |
5431 } // namespace internal | 5422 } // namespace internal |
5432 } // namespace v8 | 5423 } // namespace v8 |
5433 | 5424 |
5434 #endif // V8_TARGET_ARCH_X64 | 5425 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |