Chromium Code Reviews| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 isolate(), zone(), callable.descriptor(), 1, | 124 isolate(), zone(), callable.descriptor(), 1, |
| 125 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); | 125 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); |
| 126 Node* stub_code = HeapConstant(callable.code()); | 126 Node* stub_code = HeapConstant(callable.code()); |
| 127 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, | 127 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, |
| 128 receiver, context, frame_state); | 128 receiver, context, frame_state); |
| 129 schedule()->AddNode(CurrentBlock(), call); | 129 schedule()->AddNode(CurrentBlock(), call); |
| 130 return call; | 130 return call; |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver, | 134 Node* RawMachineAssembler::CallJS(Node* function, Node* receiver, Node* context, |
| 135 Node* context, Node* frame_state) { | 135 Node** args, int arg_count) { |
| 136 int node_input_count = arg_count + 5; | |
| 137 Node** buffer = zone()->NewArray<Node*>(node_input_count); | |
| 138 int index = 0; | |
| 139 buffer[index++] = function; | |
| 140 buffer[index++] = receiver; | |
| 141 for (int i = 0; i < arg_count; i++) { | |
| 142 buffer[index++] = args[i]; | |
| 143 } | |
| 144 buffer[index++] = context; | |
| 145 buffer[index++] = graph()->start(); | |
| 146 buffer[index++] = graph()->start(); | |
|
Michael Starzinger
2015/08/19 17:18:56
Please don't add effect and control inputs to the
rmcilroy
2015/08/24 11:49:07
As discussed in https://codereview.chromium.org/12
| |
| 147 | |
| 148 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( | |
|
Michael Starzinger
2015/08/19 17:18:56
Would it be possible to just use RawMachineAssembl
rmcilroy
2015/08/24 11:49:07
Done (also removed CallJs0 and renamed CallInterpr
| |
| 149 zone(), false, arg_count + 1, CallDescriptor::kNoFlags); | |
| 150 Node* call = | |
| 151 graph()->NewNode(common()->Call(descriptor), node_input_count, buffer); | |
| 152 schedule()->AddNode(CurrentBlock(), call); | |
| 153 return call; | |
| 154 } | |
| 155 | |
| 156 | |
| 157 Node* RawMachineAssembler::CallJS0WithFrameState(Node* function, Node* receiver, | |
| 158 Node* context, | |
| 159 Node* frame_state) { | |
| 136 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( | 160 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( |
| 137 zone(), false, 1, CallDescriptor::kNeedsFrameState); | 161 zone(), false, 1, CallDescriptor::kNeedsFrameState); |
| 138 Node* call = graph()->NewNode(common()->Call(descriptor), function, receiver, | 162 Node* call = graph()->NewNode(common()->Call(descriptor), function, receiver, |
| 139 context, frame_state); | 163 context, frame_state); |
| 140 schedule()->AddNode(CurrentBlock(), call); | 164 schedule()->AddNode(CurrentBlock(), call); |
| 141 return call; | 165 return call; |
| 142 } | 166 } |
| 143 | 167 |
| 144 | 168 |
| 145 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, | 169 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 DCHECK_NOT_NULL(schedule_); | 298 DCHECK_NOT_NULL(schedule_); |
| 275 DCHECK(current_block_ != nullptr); | 299 DCHECK(current_block_ != nullptr); |
| 276 Node* node = graph()->NewNode(op, input_count, inputs); | 300 Node* node = graph()->NewNode(op, input_count, inputs); |
| 277 schedule()->AddNode(CurrentBlock(), node); | 301 schedule()->AddNode(CurrentBlock(), node); |
| 278 return node; | 302 return node; |
| 279 } | 303 } |
| 280 | 304 |
| 281 } // namespace compiler | 305 } // namespace compiler |
| 282 } // namespace internal | 306 } // namespace internal |
| 283 } // namespace v8 | 307 } // namespace v8 |
| OLD | NEW |