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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 buffer[index++] = graph()->start(); | 168 buffer[index++] = graph()->start(); |
169 buffer[index++] = graph()->start(); | 169 buffer[index++] = graph()->start(); |
170 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer); | 170 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer); |
171 schedule()->AddTailCall(CurrentBlock(), tail_call); | 171 schedule()->AddTailCall(CurrentBlock(), tail_call); |
172 current_block_ = nullptr; | 172 current_block_ = nullptr; |
173 return tail_call; | 173 return tail_call; |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, | |
178 Node* context, Node* frame_state, | |
179 CallFunctionFlags flags) { | |
180 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); | |
181 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | |
182 isolate(), zone(), callable.descriptor(), 1, | |
183 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); | |
184 Node* stub_code = HeapConstant(callable.code()); | |
185 return AddNode(common()->Call(desc), stub_code, function, receiver, context, | |
186 frame_state, graph()->start(), graph()->start()); | |
187 } | |
188 | |
189 | |
190 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, | 177 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
191 Node* arg1, Node* context) { | 178 Node* arg1, Node* context) { |
192 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( | 179 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
193 zone(), function, 1, Operator::kNoProperties, false); | 180 zone(), function, 1, Operator::kNoProperties, false); |
194 | 181 |
195 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); | 182 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
196 Node* ref = AddNode( | 183 Node* ref = AddNode( |
197 common()->ExternalConstant(ExternalReference(function, isolate()))); | 184 common()->ExternalConstant(ExternalReference(function, isolate()))); |
198 Node* arity = Int32Constant(1); | 185 Node* arity = Int32Constant(1); |
199 | 186 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, | 334 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, |
348 Node** inputs) { | 335 Node** inputs) { |
349 // The raw machine assembler nodes do not have effect and control inputs, | 336 // The raw machine assembler nodes do not have effect and control inputs, |
350 // so we disable checking input counts here. | 337 // so we disable checking input counts here. |
351 return graph()->NewNodeUnchecked(op, input_count, inputs); | 338 return graph()->NewNodeUnchecked(op, input_count, inputs); |
352 } | 339 } |
353 | 340 |
354 } // namespace compiler | 341 } // namespace compiler |
355 } // namespace internal | 342 } // namespace internal |
356 } // namespace v8 | 343 } // namespace v8 |
OLD | NEW |