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

Side by Side Diff: src/compiler/js-call-reducer.cc

Issue 2601503002: Add Object::IsNullOrUndefined(Isolate*) helper method (Closed)
Patch Set: fixing merge conflicts Created 3 years, 11 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
« no previous file with comments | « src/builtins/builtins-utils.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include "src/compiler/js-call-reducer.h" 5 #include "src/compiler/js-call-reducer.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } else if (m.Value()->IsJSBoundFunction()) { 449 } else if (m.Value()->IsJSBoundFunction()) {
450 Handle<JSBoundFunction> function = 450 Handle<JSBoundFunction> function =
451 Handle<JSBoundFunction>::cast(m.Value()); 451 Handle<JSBoundFunction>::cast(m.Value());
452 Handle<JSReceiver> bound_target_function( 452 Handle<JSReceiver> bound_target_function(
453 function->bound_target_function(), isolate()); 453 function->bound_target_function(), isolate());
454 Handle<Object> bound_this(function->bound_this(), isolate()); 454 Handle<Object> bound_this(function->bound_this(), isolate());
455 Handle<FixedArray> bound_arguments(function->bound_arguments(), 455 Handle<FixedArray> bound_arguments(function->bound_arguments(),
456 isolate()); 456 isolate());
457 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); 457 CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
458 ConvertReceiverMode const convert_mode = 458 ConvertReceiverMode const convert_mode =
459 (bound_this->IsNull(isolate()) || bound_this->IsUndefined(isolate())) 459 (bound_this->IsNullOrUndefined(isolate()))
460 ? ConvertReceiverMode::kNullOrUndefined 460 ? ConvertReceiverMode::kNullOrUndefined
461 : ConvertReceiverMode::kNotNullOrUndefined; 461 : ConvertReceiverMode::kNotNullOrUndefined;
462 size_t arity = p.arity(); 462 size_t arity = p.arity();
463 DCHECK_LE(2u, arity); 463 DCHECK_LE(2u, arity);
464 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]]. 464 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]].
465 NodeProperties::ReplaceValueInput( 465 NodeProperties::ReplaceValueInput(
466 node, jsgraph()->Constant(bound_target_function), 0); 466 node, jsgraph()->Constant(bound_target_function), 0);
467 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this), 467 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this),
468 1); 468 1);
469 // Insert the [[BoundArguments]] for {node}. 469 // Insert the [[BoundArguments]] for {node}.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 return jsgraph()->javascript(); 681 return jsgraph()->javascript();
682 } 682 }
683 683
684 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { 684 SimplifiedOperatorBuilder* JSCallReducer::simplified() const {
685 return jsgraph()->simplified(); 685 return jsgraph()->simplified();
686 } 686 }
687 687
688 } // namespace compiler 688 } // namespace compiler
689 } // namespace internal 689 } // namespace internal
690 } // namespace v8 690 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-utils.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698