OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 DCHECK(rest->IsContextSlot() || rest->IsStackAllocated()); | 2721 DCHECK(rest->IsContextSlot() || rest->IsStackAllocated()); |
2722 // This should never lazy deopt, so it is fine to send invalid bailout id. | 2722 // This should never lazy deopt, so it is fine to send invalid bailout id. |
2723 BuildVariableAssignment(rest, object, Token::ASSIGN, BailoutId::None()); | 2723 BuildVariableAssignment(rest, object, Token::ASSIGN, BailoutId::None()); |
2724 | 2724 |
2725 return object; | 2725 return object; |
2726 } | 2726 } |
2727 | 2727 |
2728 | 2728 |
2729 Node* AstGraphBuilder::BuildHoleCheckSilent(Node* value, Node* for_hole, | 2729 Node* AstGraphBuilder::BuildHoleCheckSilent(Node* value, Node* for_hole, |
2730 Node* not_hole) { | 2730 Node* not_hole) { |
2731 IfBuilder hole_check(this); | |
2732 Node* the_hole = jsgraph()->TheHoleConstant(); | 2731 Node* the_hole = jsgraph()->TheHoleConstant(); |
2733 Node* check = NewNode(javascript()->StrictEqual(), value, the_hole); | 2732 Node* check = NewNode(javascript()->StrictEqual(), value, the_hole); |
2734 hole_check.If(check); | 2733 return NewNode(common()->Select(kMachAnyTagged, BranchHint::kFalse), check, |
2735 hole_check.Then(); | 2734 for_hole, not_hole); |
2736 environment()->Push(for_hole); | |
2737 hole_check.Else(); | |
2738 environment()->Push(not_hole); | |
2739 hole_check.End(); | |
2740 return environment()->Pop(); | |
2741 } | 2735 } |
2742 | 2736 |
2743 | 2737 |
2744 Node* AstGraphBuilder::BuildHoleCheckThrow(Node* value, Variable* variable, | 2738 Node* AstGraphBuilder::BuildHoleCheckThrow(Node* value, Variable* variable, |
2745 Node* not_hole, | 2739 Node* not_hole, |
2746 BailoutId bailout_id) { | 2740 BailoutId bailout_id) { |
2747 IfBuilder hole_check(this); | 2741 IfBuilder hole_check(this); |
2748 Node* the_hole = jsgraph()->TheHoleConstant(); | 2742 Node* the_hole = jsgraph()->TheHoleConstant(); |
2749 Node* check = NewNode(javascript()->StrictEqual(), value, the_hole); | 2743 Node* check = NewNode(javascript()->StrictEqual(), value, the_hole); |
2750 hole_check.If(check); | 2744 hole_check.If(check); |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3557 // Phi does not exist yet, introduce one. | 3551 // Phi does not exist yet, introduce one. |
3558 value = NewPhi(inputs, value, control); | 3552 value = NewPhi(inputs, value, control); |
3559 value->ReplaceInput(inputs - 1, other); | 3553 value->ReplaceInput(inputs - 1, other); |
3560 } | 3554 } |
3561 return value; | 3555 return value; |
3562 } | 3556 } |
3563 | 3557 |
3564 } // namespace compiler | 3558 } // namespace compiler |
3565 } // namespace internal | 3559 } // namespace internal |
3566 } // namespace v8 | 3560 } // namespace v8 |
OLD | NEW |