Chromium Code Reviews| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 BasicBlock* default_block = Use(default_label); | 88 BasicBlock* default_block = Use(default_label); |
| 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* values[] = {value, graph()->start(), graph()->start()}; |
|
titzer
2015/12/08 16:25:45
These extra inputs shouldn't be necessary in order
Michael Starzinger
2015/12/09 16:35:25
As discussed offline, this should no longer be nee
rmcilroy
2015/12/09 16:54:45
Done. PTAL, thanks.
| |
| 99 Node* ret = MakeNode(common()->Return(), 3, values); | |
| 100 NodeProperties::MergeControlToEnd(graph(), common(), ret); | |
| 99 schedule()->AddReturn(CurrentBlock(), ret); | 101 schedule()->AddReturn(CurrentBlock(), ret); |
| 100 current_block_ = nullptr; | 102 current_block_ = nullptr; |
| 101 } | 103 } |
| 102 | 104 |
| 103 | 105 |
| 104 void RawMachineAssembler::Return(Node* v1, Node* v2) { | 106 void RawMachineAssembler::Return(Node* v1, Node* v2) { |
| 105 Node* values[] = {v1, v2}; | 107 Node* values[] = {v1, v2, graph()->start(), graph()->start()}; |
| 106 Node* ret = MakeNode(common()->Return(2), 2, values); | 108 Node* ret = MakeNode(common()->Return(2), 4, values); |
| 109 NodeProperties::MergeControlToEnd(graph(), common(), ret); | |
| 107 schedule()->AddReturn(CurrentBlock(), ret); | 110 schedule()->AddReturn(CurrentBlock(), ret); |
| 108 current_block_ = nullptr; | 111 current_block_ = nullptr; |
| 109 } | 112 } |
| 110 | 113 |
| 111 | 114 |
| 112 void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3) { | 115 void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3) { |
| 113 Node* values[] = {v1, v2, v3}; | 116 Node* values[] = {v1, v2, v3, graph()->start(), graph()->start()}; |
| 114 Node* ret = MakeNode(common()->Return(3), 3, values); | 117 Node* ret = MakeNode(common()->Return(3), 5, values); |
| 118 NodeProperties::MergeControlToEnd(graph(), common(), ret); | |
| 115 schedule()->AddReturn(CurrentBlock(), ret); | 119 schedule()->AddReturn(CurrentBlock(), ret); |
| 116 current_block_ = nullptr; | 120 current_block_ = nullptr; |
| 117 } | 121 } |
| 118 | 122 |
| 119 | 123 |
| 120 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, | 124 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, |
| 121 Node** args) { | 125 Node** args) { |
| 122 int param_count = | 126 int param_count = |
| 123 static_cast<int>(desc->GetMachineSignature()->parameter_count()); | 127 static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
| 124 int input_count = param_count + 3; | 128 int input_count = param_count + 3; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 | 394 |
| 391 RawMachineLabel::RawMachineLabel() | 395 RawMachineLabel::RawMachineLabel() |
| 392 : block_(NULL), used_(false), bound_(false) {} | 396 : block_(NULL), used_(false), bound_(false) {} |
| 393 | 397 |
| 394 | 398 |
| 395 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 399 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
| 396 | 400 |
| 397 } // namespace compiler | 401 } // namespace compiler |
| 398 } // namespace internal | 402 } // namespace internal |
| 399 } // namespace v8 | 403 } // namespace v8 |
| OLD | NEW |