| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 Node* stub_code = HeapConstant(callable.code()); | 172 Node* stub_code = HeapConstant(callable.code()); |
| 173 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, | 173 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, |
| 174 receiver, context, frame_state, | 174 receiver, context, frame_state, |
| 175 graph()->start(), graph()->start()); | 175 graph()->start(), graph()->start()); |
| 176 schedule()->AddNode(CurrentBlock(), call); | 176 schedule()->AddNode(CurrentBlock(), call); |
| 177 return call; | 177 return call; |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 |
| 181 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, | 181 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
| 182 Node* arg0, Node* context, | 182 Node* arg1, Node* context, |
| 183 Node* frame_state) { | 183 Node* frame_state) { |
| 184 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( | 184 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
| 185 zone(), function, 1, Operator::kNoProperties); | 185 zone(), function, 1, Operator::kNoProperties); |
| 186 | 186 |
| 187 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); | 187 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
| 188 Node* ref = NewNode( | 188 Node* ref = NewNode( |
| 189 common()->ExternalConstant(ExternalReference(function, isolate()))); | 189 common()->ExternalConstant(ExternalReference(function, isolate()))); |
| 190 Node* arity = Int32Constant(1); | 190 Node* arity = Int32Constant(1); |
| 191 | 191 |
| 192 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref, | 192 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg1, ref, |
| 193 arity, context, frame_state, graph()->start(), | 193 arity, context, frame_state, graph()->start(), |
| 194 graph()->start()); | 194 graph()->start()); |
| 195 schedule()->AddNode(CurrentBlock(), call); | 195 schedule()->AddNode(CurrentBlock(), call); |
| 196 return call; | 196 return call; |
| 197 } | 197 } |
| 198 | 198 |
| 199 | 199 |
| 200 Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function, |
| 201 Node* arg1, Node* arg2, Node* context, |
| 202 Node* frame_state) { |
| 203 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
| 204 zone(), function, 2, Operator::kNoProperties); |
| 205 |
| 206 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); |
| 207 Node* ref = NewNode( |
| 208 common()->ExternalConstant(ExternalReference(function, isolate()))); |
| 209 Node* arity = Int32Constant(2); |
| 210 |
| 211 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg1, arg2, |
| 212 ref, arity, context, frame_state, |
| 213 graph()->start(), graph()->start()); |
| 214 schedule()->AddNode(CurrentBlock(), call); |
| 215 return call; |
| 216 } |
| 217 |
| 218 |
| 200 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, | 219 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, |
| 201 Node* function) { | 220 Node* function) { |
| 202 MachineSignature::Builder builder(zone(), 1, 0); | 221 MachineSignature::Builder builder(zone(), 1, 0); |
| 203 builder.AddReturn(return_type); | 222 builder.AddReturn(return_type); |
| 204 const CallDescriptor* descriptor = | 223 const CallDescriptor* descriptor = |
| 205 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); | 224 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); |
| 206 | 225 |
| 207 Node* call = graph()->NewNode(common()->Call(descriptor), function, | 226 Node* call = graph()->NewNode(common()->Call(descriptor), function, |
| 208 graph()->start(), graph()->start()); | 227 graph()->start(), graph()->start()); |
| 209 schedule()->AddNode(CurrentBlock(), call); | 228 schedule()->AddNode(CurrentBlock(), call); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 DCHECK_NOT_NULL(schedule_); | 331 DCHECK_NOT_NULL(schedule_); |
| 313 DCHECK(current_block_ != nullptr); | 332 DCHECK(current_block_ != nullptr); |
| 314 Node* node = graph()->NewNode(op, input_count, inputs); | 333 Node* node = graph()->NewNode(op, input_count, inputs); |
| 315 schedule()->AddNode(CurrentBlock(), node); | 334 schedule()->AddNode(CurrentBlock(), node); |
| 316 return node; | 335 return node; |
| 317 } | 336 } |
| 318 | 337 |
| 319 } // namespace compiler | 338 } // namespace compiler |
| 320 } // namespace internal | 339 } // namespace internal |
| 321 } // namespace v8 | 340 } // namespace v8 |
| OLD | NEW |