| 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/raw-machine-assembler.h" | 5 #include "src/compiler/raw-machine-assembler.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 #include "src/compiler/scheduler.h" | 10 #include "src/compiler/scheduler.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 Node* default_node = graph()->NewNode(common()->IfDefault(), switch_node); | 89 Node* default_node = graph()->NewNode(common()->IfDefault(), switch_node); |
| 90 schedule()->AddNode(default_block, default_node); | 90 schedule()->AddNode(default_block, default_node); |
| 91 succ_blocks[case_count] = default_block; | 91 succ_blocks[case_count] = default_block; |
| 92 schedule()->AddSwitch(CurrentBlock(), switch_node, succ_blocks, succ_count); | 92 schedule()->AddSwitch(CurrentBlock(), switch_node, succ_blocks, succ_count); |
| 93 current_block_ = nullptr; | 93 current_block_ = nullptr; |
| 94 } | 94 } |
| 95 | 95 |
| 96 | 96 |
| 97 void RawMachineAssembler::Return(Node* value) { | 97 void RawMachineAssembler::Return(Node* value) { |
| 98 Node* ret = MakeNode(common()->Return(), 1, &value); | 98 Node* ret = MakeNode(common()->Return(), 1, &value); |
| 99 NodeProperties::MergeControlToEnd(graph(), common(), ret); |
| 99 schedule()->AddReturn(CurrentBlock(), ret); | 100 schedule()->AddReturn(CurrentBlock(), ret); |
| 100 current_block_ = nullptr; | 101 current_block_ = nullptr; |
| 101 } | 102 } |
| 102 | 103 |
| 103 | 104 |
| 104 void RawMachineAssembler::Return(Node* v1, Node* v2) { | 105 void RawMachineAssembler::Return(Node* v1, Node* v2) { |
| 105 Node* values[] = {v1, v2}; | 106 Node* values[] = {v1, v2}; |
| 106 Node* ret = MakeNode(common()->Return(2), 2, values); | 107 Node* ret = MakeNode(common()->Return(2), 2, values); |
| 108 NodeProperties::MergeControlToEnd(graph(), common(), ret); |
| 107 schedule()->AddReturn(CurrentBlock(), ret); | 109 schedule()->AddReturn(CurrentBlock(), ret); |
| 108 current_block_ = nullptr; | 110 current_block_ = nullptr; |
| 109 } | 111 } |
| 110 | 112 |
| 111 | 113 |
| 112 void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3) { | 114 void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3) { |
| 113 Node* values[] = {v1, v2, v3}; | 115 Node* values[] = {v1, v2, v3}; |
| 114 Node* ret = MakeNode(common()->Return(3), 3, values); | 116 Node* ret = MakeNode(common()->Return(3), 3, values); |
| 117 NodeProperties::MergeControlToEnd(graph(), common(), ret); |
| 115 schedule()->AddReturn(CurrentBlock(), ret); | 118 schedule()->AddReturn(CurrentBlock(), ret); |
| 116 current_block_ = nullptr; | 119 current_block_ = nullptr; |
| 117 } | 120 } |
| 118 | 121 |
| 119 | 122 |
| 120 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, | 123 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, |
| 121 Node** args) { | 124 Node** args) { |
| 122 int param_count = | 125 int param_count = |
| 123 static_cast<int>(desc->GetMachineSignature()->parameter_count()); | 126 static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
| 124 int input_count = param_count + 1; | 127 int input_count = param_count + 1; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 375 |
| 373 RawMachineLabel::RawMachineLabel() | 376 RawMachineLabel::RawMachineLabel() |
| 374 : block_(NULL), used_(false), bound_(false) {} | 377 : block_(NULL), used_(false), bound_(false) {} |
| 375 | 378 |
| 376 | 379 |
| 377 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 380 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
| 378 | 381 |
| 379 } // namespace compiler | 382 } // namespace compiler |
| 380 } // namespace internal | 383 } // namespace internal |
| 381 } // namespace v8 | 384 } // namespace v8 |
| OLD | NEW |