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

Side by Side Diff: src/ia32/code-stubs-ia32.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 5 years 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 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 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 __ bind(&fast_case); 2524 __ bind(&fast_case);
2525 __ JumpIfSmi(function, &slow_case); 2525 __ JumpIfSmi(function, &slow_case);
2526 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); 2526 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map);
2527 __ j(not_equal, &slow_case); 2527 __ j(not_equal, &slow_case);
2528 2528
2529 // Ensure that {function} has an instance prototype. 2529 // Ensure that {function} has an instance prototype.
2530 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), 2530 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset),
2531 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); 2531 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype));
2532 __ j(not_zero, &slow_case); 2532 __ j(not_zero, &slow_case);
2533 2533
2534 // Ensure that {function} is not bound.
2535 Register const shared_info = scratch;
2536 __ mov(shared_info,
2537 FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
2538 __ BooleanBitTest(shared_info, SharedFunctionInfo::kCompilerHintsOffset,
2539 SharedFunctionInfo::kBoundFunction);
2540 __ j(not_zero, &slow_case);
2541
2542 // Get the "prototype" (or initial map) of the {function}. 2534 // Get the "prototype" (or initial map) of the {function}.
2543 __ mov(function_prototype, 2535 __ mov(function_prototype,
2544 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 2536 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
2545 __ AssertNotSmi(function_prototype); 2537 __ AssertNotSmi(function_prototype);
2546 2538
2547 // Resolve the prototype if the {function} has an initial map. Afterwards the 2539 // Resolve the prototype if the {function} has an initial map. Afterwards the
2548 // {function_prototype} will be either the JSReceiver prototype object or the 2540 // {function_prototype} will be either the JSReceiver prototype object or the
2549 // hole value, which means that no instances of the {function} were created so 2541 // hole value, which means that no instances of the {function} were created so
2550 // far and hence we should return false. 2542 // far and hence we should return false.
2551 Label function_prototype_valid; 2543 Label function_prototype_valid;
(...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after
5652 Operand(ebp, 7 * kPointerSize), NULL); 5644 Operand(ebp, 7 * kPointerSize), NULL);
5653 } 5645 }
5654 5646
5655 5647
5656 #undef __ 5648 #undef __
5657 5649
5658 } // namespace internal 5650 } // namespace internal
5659 } // namespace v8 5651 } // namespace v8
5660 5652
5661 #endif // V8_TARGET_ARCH_IA32 5653 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | src/objects-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698