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

Side by Side Diff: src/compiler/effect-control-linearizer.cc

Issue 2279213002: [turbofan] Introduce a dedicated ArrayBufferWasNeutered operator. (Closed)
Patch Set: Created 4 years, 3 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/compiler/effect-control-linearizer.h ('k') | src/compiler/js-builtin-reducer.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/effect-control-linearizer.h" 5 #include "src/compiler/effect-control-linearizer.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 break; 695 break;
696 case IrOpcode::kObjectIsSmi: 696 case IrOpcode::kObjectIsSmi:
697 state = LowerObjectIsSmi(node, *effect, *control); 697 state = LowerObjectIsSmi(node, *effect, *control);
698 break; 698 break;
699 case IrOpcode::kObjectIsString: 699 case IrOpcode::kObjectIsString:
700 state = LowerObjectIsString(node, *effect, *control); 700 state = LowerObjectIsString(node, *effect, *control);
701 break; 701 break;
702 case IrOpcode::kObjectIsUndetectable: 702 case IrOpcode::kObjectIsUndetectable:
703 state = LowerObjectIsUndetectable(node, *effect, *control); 703 state = LowerObjectIsUndetectable(node, *effect, *control);
704 break; 704 break;
705 case IrOpcode::kArrayBufferWasNeutered:
706 state = LowerArrayBufferWasNeutered(node, *effect, *control);
707 break;
705 case IrOpcode::kStringFromCharCode: 708 case IrOpcode::kStringFromCharCode:
706 state = LowerStringFromCharCode(node, *effect, *control); 709 state = LowerStringFromCharCode(node, *effect, *control);
707 break; 710 break;
708 case IrOpcode::kStringCharCodeAt: 711 case IrOpcode::kStringCharCodeAt:
709 state = LowerStringCharCodeAt(node, *effect, *control); 712 state = LowerStringCharCodeAt(node, *effect, *control);
710 break; 713 break;
711 case IrOpcode::kCheckFloat64Hole: 714 case IrOpcode::kCheckFloat64Hole:
712 state = LowerCheckFloat64Hole(node, frame_state, *effect, *control); 715 state = LowerCheckFloat64Hole(node, frame_state, *effect, *control);
713 break; 716 break;
714 case IrOpcode::kCheckTaggedHole: 717 case IrOpcode::kCheckTaggedHole:
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 1992
1990 control = graph()->NewNode(common()->Merge(2), if_true, if_false); 1993 control = graph()->NewNode(common()->Merge(2), if_true, if_false);
1991 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); 1994 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
1992 value = graph()->NewNode(common()->Phi(MachineRepresentation::kBit, 2), vtrue, 1995 value = graph()->NewNode(common()->Phi(MachineRepresentation::kBit, 2), vtrue,
1993 vfalse, control); 1996 vfalse, control);
1994 1997
1995 return ValueEffectControl(value, effect, control); 1998 return ValueEffectControl(value, effect, control);
1996 } 1999 }
1997 2000
1998 EffectControlLinearizer::ValueEffectControl 2001 EffectControlLinearizer::ValueEffectControl
2002 EffectControlLinearizer::LowerArrayBufferWasNeutered(Node* node, Node* effect,
2003 Node* control) {
2004 Node* value = node->InputAt(0);
2005
2006 Node* value_bit_field = effect = graph()->NewNode(
2007 simplified()->LoadField(AccessBuilder::ForJSArrayBufferBitField()), value,
2008 effect, control);
2009 value = graph()->NewNode(
2010 machine()->Word32Equal(),
2011 graph()->NewNode(machine()->Word32Equal(),
2012 graph()->NewNode(machine()->Word32And(), value_bit_field,
2013 jsgraph()->Int32Constant(
2014 JSArrayBuffer::WasNeutered::kMask)),
2015 jsgraph()->Int32Constant(0)),
2016 jsgraph()->Int32Constant(0));
2017
2018 return ValueEffectControl(value, effect, control);
2019 }
2020
2021 EffectControlLinearizer::ValueEffectControl
1999 EffectControlLinearizer::LowerStringCharCodeAt(Node* node, Node* effect, 2022 EffectControlLinearizer::LowerStringCharCodeAt(Node* node, Node* effect,
2000 Node* control) { 2023 Node* control) {
2001 Node* subject = node->InputAt(0); 2024 Node* subject = node->InputAt(0);
2002 Node* index = node->InputAt(1); 2025 Node* index = node->InputAt(1);
2003 2026
2004 // We may need to loop several times for ConsString/SlicedString {subject}s. 2027 // We may need to loop several times for ConsString/SlicedString {subject}s.
2005 Node* loop = 2028 Node* loop =
2006 graph()->NewNode(common()->Loop(4), control, control, control, control); 2029 graph()->NewNode(common()->Loop(4), control, control, control, control);
2007 Node* lsubject = 2030 Node* lsubject =
2008 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 4), 2031 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 4),
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3286 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3309 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3287 Operator::kEliminatable); 3310 Operator::kEliminatable);
3288 to_number_operator_.set(common()->Call(desc)); 3311 to_number_operator_.set(common()->Call(desc));
3289 } 3312 }
3290 return to_number_operator_.get(); 3313 return to_number_operator_.get();
3291 } 3314 }
3292 3315
3293 } // namespace compiler 3316 } // namespace compiler
3294 } // namespace internal 3317 } // namespace internal
3295 } // namespace v8 3318 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/effect-control-linearizer.h ('k') | src/compiler/js-builtin-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698