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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 void RawMachineAssembler::Return(Node* value) { | 96 void RawMachineAssembler::Return(Node* value) { |
97 Node* ret = graph()->NewNode(common()->Return(), value); | 97 Node* ret = graph()->NewNode(common()->Return(), value); |
98 schedule()->AddReturn(CurrentBlock(), ret); | 98 schedule()->AddReturn(CurrentBlock(), ret); |
99 current_block_ = nullptr; | 99 current_block_ = nullptr; |
100 } | 100 } |
101 | 101 |
102 | 102 |
103 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, | |
104 Node** args) { | |
105 int param_count = | |
106 static_cast<int>(desc->GetMachineSignature()->parameter_count()); | |
107 Node** buffer = zone()->NewArray<Node*>(param_count + 1); | |
108 int index = 0; | |
109 buffer[index++] = function; | |
110 for (int i = 0; i < param_count; i++) { | |
111 buffer[index++] = args[i]; | |
112 } | |
113 Node* call = graph()->NewNode(common()->Call(desc), param_count + 1, buffer); | |
114 schedule()->AddNode(CurrentBlock(), call); | |
115 return call; | |
116 } | |
117 | |
118 | |
119 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, | 103 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, |
120 Node* context, Node* frame_state, | 104 Node* context, Node* frame_state, |
121 CallFunctionFlags flags) { | 105 CallFunctionFlags flags) { |
122 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); | 106 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); |
123 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 107 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
124 isolate(), zone(), callable.descriptor(), 1, | 108 isolate(), zone(), callable.descriptor(), 1, |
125 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); | 109 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); |
126 Node* stub_code = HeapConstant(callable.code()); | 110 Node* stub_code = HeapConstant(callable.code()); |
127 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, | 111 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, |
128 receiver, context, frame_state); | 112 receiver, context, frame_state); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 DCHECK_NOT_NULL(schedule_); | 247 DCHECK_NOT_NULL(schedule_); |
264 DCHECK(current_block_ != nullptr); | 248 DCHECK(current_block_ != nullptr); |
265 Node* node = graph()->NewNode(op, input_count, inputs); | 249 Node* node = graph()->NewNode(op, input_count, inputs); |
266 schedule()->AddNode(CurrentBlock(), node); | 250 schedule()->AddNode(CurrentBlock(), node); |
267 return node; | 251 return node; |
268 } | 252 } |
269 | 253 |
270 } // namespace compiler | 254 } // namespace compiler |
271 } // namespace internal | 255 } // namespace internal |
272 } // namespace v8 | 256 } // namespace v8 |
OLD | NEW |