OLD | NEW |
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/graph-assembler.h" | 5 #include "src/compiler/graph-assembler.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 | 151 |
152 Node* GraphAssembler::ToNumber(Node* value) { | 152 Node* GraphAssembler::ToNumber(Node* value) { |
153 return current_effect_ = | 153 return current_effect_ = |
154 graph()->NewNode(ToNumberOperator(), ToNumberBuiltinConstant(), | 154 graph()->NewNode(ToNumberOperator(), ToNumberBuiltinConstant(), |
155 value, NoContextConstant(), current_effect_); | 155 value, NoContextConstant(), current_effect_); |
156 } | 156 } |
157 | 157 |
158 Node* GraphAssembler::DeoptimizeIf(DeoptimizeReason reason, Node* condition, | 158 Node* GraphAssembler::DeoptimizeIf(DeoptimizeReason reason, Node* condition, |
159 Node* frame_state) { | 159 Node* frame_state) { |
160 return current_control_ = current_effect_ = graph()->NewNode( | 160 return current_control_ = current_effect_ = |
161 common()->DeoptimizeIf(DeoptimizeKind::kEager, reason), condition, | 161 graph()->NewNode(common()->DeoptimizeIf(reason), condition, |
162 frame_state, current_effect_, current_control_); | 162 frame_state, current_effect_, current_control_); |
163 } | |
164 | |
165 Node* GraphAssembler::DeoptimizeUnless(DeoptimizeKind kind, | |
166 DeoptimizeReason reason, Node* condition, | |
167 Node* frame_state) { | |
168 return current_control_ = current_effect_ = graph()->NewNode( | |
169 common()->DeoptimizeUnless(kind, reason), condition, frame_state, | |
170 current_effect_, current_control_); | |
171 } | 163 } |
172 | 164 |
173 Node* GraphAssembler::DeoptimizeUnless(DeoptimizeReason reason, Node* condition, | 165 Node* GraphAssembler::DeoptimizeUnless(DeoptimizeReason reason, Node* condition, |
174 Node* frame_state) { | 166 Node* frame_state) { |
175 return DeoptimizeUnless(DeoptimizeKind::kEager, reason, condition, | 167 return current_control_ = current_effect_ = |
176 frame_state); | 168 graph()->NewNode(common()->DeoptimizeUnless(reason), condition, |
| 169 frame_state, current_effect_, current_control_); |
177 } | 170 } |
178 | 171 |
179 void GraphAssembler::Branch(Node* condition, | 172 void GraphAssembler::Branch(Node* condition, |
180 GraphAssemblerStaticLabel<1>* if_true, | 173 GraphAssemblerStaticLabel<1>* if_true, |
181 GraphAssemblerStaticLabel<1>* if_false) { | 174 GraphAssemblerStaticLabel<1>* if_false) { |
182 DCHECK_NOT_NULL(current_control_); | 175 DCHECK_NOT_NULL(current_control_); |
183 | 176 |
184 BranchHint hint = BranchHint::kNone; | 177 BranchHint hint = BranchHint::kNone; |
185 if (if_true->IsDeferred() != if_false->IsDeferred()) { | 178 if (if_true->IsDeferred() != if_false->IsDeferred()) { |
186 hint = if_false->IsDeferred() ? BranchHint::kTrue : BranchHint::kFalse; | 179 hint = if_false->IsDeferred() ? BranchHint::kTrue : BranchHint::kFalse; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 return representations_[phi_index]; | 278 return representations_[phi_index]; |
286 } | 279 } |
287 | 280 |
288 Node** GraphAssemblerLabel::GetControlsPtr() { return controls_; } | 281 Node** GraphAssemblerLabel::GetControlsPtr() { return controls_; } |
289 | 282 |
290 Node** GraphAssemblerLabel::GetEffectsPtr() { return effects_; } | 283 Node** GraphAssemblerLabel::GetEffectsPtr() { return effects_; } |
291 | 284 |
292 } // namespace compiler | 285 } // namespace compiler |
293 } // namespace internal | 286 } // namespace internal |
294 } // namespace v8 | 287 } // namespace v8 |
OLD | NEW |