Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 1542963002: [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: arm port. Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 __ bind(&fast_case); 2476 __ bind(&fast_case);
2477 __ JumpIfSmi(function, &slow_case); 2477 __ JumpIfSmi(function, &slow_case);
2478 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); 2478 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map);
2479 __ j(not_equal, &slow_case); 2479 __ j(not_equal, &slow_case);
2480 2480
2481 // Ensure that {function} has an instance prototype. 2481 // Ensure that {function} has an instance prototype.
2482 __ testb(FieldOperand(function_map, Map::kBitFieldOffset), 2482 __ testb(FieldOperand(function_map, Map::kBitFieldOffset),
2483 Immediate(1 << Map::kHasNonInstancePrototype)); 2483 Immediate(1 << Map::kHasNonInstancePrototype));
2484 __ j(not_zero, &slow_case); 2484 __ j(not_zero, &slow_case);
2485 2485
2486 // Ensure that {function} is not bound.
2487 Register const shared_info = kScratchRegister;
2488 __ movp(shared_info,
2489 FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
2490 __ TestBitSharedFunctionInfoSpecialField(
2491 shared_info, SharedFunctionInfo::kCompilerHintsOffset,
2492 SharedFunctionInfo::kBoundFunction);
2493 __ j(not_zero, &slow_case);
2494
2495 // Get the "prototype" (or initial map) of the {function}. 2486 // Get the "prototype" (or initial map) of the {function}.
2496 __ movp(function_prototype, 2487 __ movp(function_prototype,
2497 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 2488 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
2498 __ AssertNotSmi(function_prototype); 2489 __ AssertNotSmi(function_prototype);
2499 2490
2500 // Resolve the prototype if the {function} has an initial map. Afterwards the 2491 // Resolve the prototype if the {function} has an initial map. Afterwards the
2501 // {function_prototype} will be either the JSReceiver prototype object or the 2492 // {function_prototype} will be either the JSReceiver prototype object or the
2502 // hole value, which means that no instances of the {function} were created so 2493 // hole value, which means that no instances of the {function} were created so
2503 // far and hence we should return false. 2494 // far and hence we should return false.
2504 Label function_prototype_valid; 2495 Label function_prototype_valid;
(...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after
5398 kStackSpace, nullptr, return_value_operand, NULL); 5389 kStackSpace, nullptr, return_value_operand, NULL);
5399 } 5390 }
5400 5391
5401 5392
5402 #undef __ 5393 #undef __
5403 5394
5404 } // namespace internal 5395 } // namespace internal
5405 } // namespace v8 5396 } // namespace v8
5406 5397
5407 #endif // V8_TARGET_ARCH_X64 5398 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698