| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 Node** buffer = zone()->NewArray<Node*>(input_count); | 145 Node** buffer = zone()->NewArray<Node*>(input_count); |
| 146 int index = 0; | 146 int index = 0; |
| 147 buffer[index++] = function; | 147 buffer[index++] = function; |
| 148 for (int i = 0; i < param_count; i++) { | 148 for (int i = 0; i < param_count; i++) { |
| 149 buffer[index++] = args[i]; | 149 buffer[index++] = args[i]; |
| 150 } | 150 } |
| 151 buffer[index++] = frame_state; | 151 buffer[index++] = frame_state; |
| 152 return AddNode(common()->Call(desc), input_count, buffer); | 152 return AddNode(common()->Call(desc), input_count, buffer); |
| 153 } | 153 } |
| 154 | 154 |
| 155 Node* RawMachineAssembler::CallRuntime0(Runtime::FunctionId function, |
| 156 Node* context) { |
| 157 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
| 158 zone(), function, 0, Operator::kNoProperties, CallDescriptor::kNoFlags); |
| 159 int return_count = static_cast<int>(descriptor->ReturnCount()); |
| 160 |
| 161 Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode()); |
| 162 Node* ref = AddNode( |
| 163 common()->ExternalConstant(ExternalReference(function, isolate()))); |
| 164 Node* arity = Int32Constant(0); |
| 165 |
| 166 return AddNode(common()->Call(descriptor), centry, ref, arity, context); |
| 167 } |
| 155 | 168 |
| 156 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, | 169 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
| 157 Node* arg1, Node* context) { | 170 Node* arg1, Node* context) { |
| 158 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( | 171 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
| 159 zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags); | 172 zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags); |
| 160 int return_count = static_cast<int>(descriptor->ReturnCount()); | 173 int return_count = static_cast<int>(descriptor->ReturnCount()); |
| 161 | 174 |
| 162 Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode()); | 175 Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode()); |
| 163 Node* ref = AddNode( | 176 Node* ref = AddNode( |
| 164 common()->ExternalConstant(ExternalReference(function, isolate()))); | 177 common()->ExternalConstant(ExternalReference(function, isolate()))); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 462 |
| 450 RawMachineLabel::RawMachineLabel() | 463 RawMachineLabel::RawMachineLabel() |
| 451 : block_(nullptr), used_(false), bound_(false) {} | 464 : block_(nullptr), used_(false), bound_(false) {} |
| 452 | 465 |
| 453 | 466 |
| 454 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 467 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
| 455 | 468 |
| 456 } // namespace compiler | 469 } // namespace compiler |
| 457 } // namespace internal | 470 } // namespace internal |
| 458 } // namespace v8 | 471 } // namespace v8 |
| OLD | NEW |