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/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 | 305 |
306 void CodeAssembler::BranchIf(Node* condition, Label* if_true, Label* if_false) { | 306 void CodeAssembler::BranchIf(Node* condition, Label* if_true, Label* if_false) { |
307 Label if_condition_is_true(this), if_condition_is_false(this); | 307 Label if_condition_is_true(this), if_condition_is_false(this); |
308 Branch(condition, &if_condition_is_true, &if_condition_is_false); | 308 Branch(condition, &if_condition_is_true, &if_condition_is_false); |
309 Bind(&if_condition_is_true); | 309 Bind(&if_condition_is_true); |
310 Goto(if_true); | 310 Goto(if_true); |
311 Bind(&if_condition_is_false); | 311 Bind(&if_condition_is_false); |
312 Goto(if_false); | 312 Goto(if_false); |
313 } | 313 } |
314 | 314 |
315 void CodeAssembler::BranchIfSuccess(Node* node, Label* if_success, | |
316 Label* if_exception, | |
317 Variable* exception_var) { | |
318 Label exception(this); | |
Michael Starzinger
2016/08/19 08:53:56
Let's mark this label as deferred, to move the han
caitp
2016/08/19 15:38:53
Done.
| |
319 if_success->MergeVariables(); | |
320 exception.MergeVariables(); | |
321 DCHECK(!node->op()->HasProperty(Operator::kNoThrow)); | |
322 | |
323 raw_assembler_->BranchIfSuccess(node, if_success->label_, exception.label_); | |
324 | |
325 Bind(&exception); | |
326 const Operator* op = raw_assembler_->common()->IfException(); | |
327 raw_assembler_->AddNode(op, node, node); | |
328 if (exception_var != nullptr) { | |
329 exception_var->Bind(node); | |
330 } | |
331 Goto(if_exception); | |
332 } | |
333 | |
334 void CodeAssembler::GotoIfException(Node* node, Label* if_exception, | |
Michael Starzinger
2016/08/19 08:53:56
It seems that users of the CodeAssembler will be m
caitp
2016/08/19 15:38:53
I've merged them into just GotoIfException --- I j
| |
335 Variable* exception_var) { | |
336 Label if_success(this); | |
337 BranchIfSuccess(node, &if_success, if_exception, exception_var); | |
338 Bind(&if_success); | |
339 } | |
340 | |
315 Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target, | 341 Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
316 Node** args) { | 342 Node** args) { |
317 CallPrologue(); | 343 CallPrologue(); |
318 Node* return_value = raw_assembler_->CallN(descriptor, code_target, args); | 344 Node* return_value = raw_assembler_->CallN(descriptor, code_target, args); |
319 CallEpilogue(); | 345 CallEpilogue(); |
320 return return_value; | 346 return return_value; |
321 } | 347 } |
322 | 348 |
323 Node* CodeAssembler::TailCallN(CallDescriptor* descriptor, Node* code_target, | 349 Node* CodeAssembler::TailCallN(CallDescriptor* descriptor, Node* code_target, |
324 Node** args) { | 350 Node** args) { |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1052 } | 1078 } |
1053 } | 1079 } |
1054 } | 1080 } |
1055 | 1081 |
1056 bound_ = true; | 1082 bound_ = true; |
1057 } | 1083 } |
1058 | 1084 |
1059 } // namespace compiler | 1085 } // namespace compiler |
1060 } // namespace internal | 1086 } // namespace internal |
1061 } // namespace v8 | 1087 } // namespace v8 |
OLD | NEW |