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/pipeline.h" | 8 #include "src/compiler/pipeline.h" |
9 #include "src/compiler/scheduler.h" | 9 #include "src/compiler/scheduler.h" |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 schedule()->AddReturn(CurrentBlock(), ret); | 99 schedule()->AddReturn(CurrentBlock(), ret); |
100 current_block_ = nullptr; | 100 current_block_ = nullptr; |
101 } | 101 } |
102 | 102 |
103 | 103 |
| 104 void RawMachineAssembler::Return(Node* v1, Node* v2) { |
| 105 Node* values[] = {v1, v2}; |
| 106 Node* ret = MakeNode(common()->Return(2), 2, values); |
| 107 schedule()->AddReturn(CurrentBlock(), ret); |
| 108 current_block_ = nullptr; |
| 109 } |
| 110 |
| 111 |
| 112 void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3) { |
| 113 Node* values[] = {v1, v2, v3}; |
| 114 Node* ret = MakeNode(common()->Return(3), 3, values); |
| 115 schedule()->AddReturn(CurrentBlock(), ret); |
| 116 current_block_ = nullptr; |
| 117 } |
| 118 |
| 119 |
104 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, | 120 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, |
105 Node** args) { | 121 Node** args) { |
106 int param_count = | 122 int param_count = |
107 static_cast<int>(desc->GetMachineSignature()->parameter_count()); | 123 static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
108 int input_count = param_count + 3; | 124 int input_count = param_count + 3; |
109 Node** buffer = zone()->NewArray<Node*>(input_count); | 125 Node** buffer = zone()->NewArray<Node*>(input_count); |
110 int index = 0; | 126 int index = 0; |
111 buffer[index++] = function; | 127 buffer[index++] = function; |
112 for (int i = 0; i < param_count; i++) { | 128 for (int i = 0; i < param_count; i++) { |
113 buffer[index++] = args[i]; | 129 buffer[index++] = args[i]; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, | 331 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, |
316 Node** inputs) { | 332 Node** inputs) { |
317 // The raw machine assembler nodes do not have effect and control inputs, | 333 // The raw machine assembler nodes do not have effect and control inputs, |
318 // so we disable checking input counts here. | 334 // so we disable checking input counts here. |
319 return graph()->NewNodeUnchecked(op, input_count, inputs); | 335 return graph()->NewNodeUnchecked(op, input_count, inputs); |
320 } | 336 } |
321 | 337 |
322 } // namespace compiler | 338 } // namespace compiler |
323 } // namespace internal | 339 } // namespace internal |
324 } // namespace v8 | 340 } // namespace v8 |
OLD | NEW |