| 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 + 3; | 127 int input_count = param_count + 3; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 393 |
| 391 RawMachineLabel::RawMachineLabel() | 394 RawMachineLabel::RawMachineLabel() |
| 392 : block_(NULL), used_(false), bound_(false) {} | 395 : block_(NULL), used_(false), bound_(false) {} |
| 393 | 396 |
| 394 | 397 |
| 395 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 398 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
| 396 | 399 |
| 397 } // namespace compiler | 400 } // namespace compiler |
| 398 } // namespace internal | 401 } // namespace internal |
| 399 } // namespace v8 | 402 } // namespace v8 |
| OLD | NEW |