Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: src/compiler/raw-machine-assembler.cc

Issue 1283193007: [turbofan] Add control and effect inputs to RawMachineAssembler calls. (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@master
Patch Set: Remove overloaded NewNode Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 103 Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function,
104 Node** args) { 104 Node** args) {
105 int param_count = 105 int param_count =
106 static_cast<int>(desc->GetMachineSignature()->parameter_count()); 106 static_cast<int>(desc->GetMachineSignature()->parameter_count());
107 Node** buffer = zone()->NewArray<Node*>(param_count + 1); 107 Node** buffer = zone()->NewArray<Node*>(param_count + 3);
108 int index = 0; 108 int index = 0;
109 buffer[index++] = function; 109 buffer[index++] = function;
110 for (int i = 0; i < param_count; i++) { 110 for (int i = 0; i < param_count; i++) {
111 buffer[index++] = args[i]; 111 buffer[index++] = args[i];
112 } 112 }
113 Node* call = graph()->NewNode(common()->Call(desc), param_count + 1, buffer); 113 buffer[index++] = graph()->start();
114 buffer[index++] = graph()->start();
115 Node* call = graph()->NewNode(common()->Call(desc), param_count + 3, buffer);
114 schedule()->AddNode(CurrentBlock(), call); 116 schedule()->AddNode(CurrentBlock(), call);
115 return call; 117 return call;
116 } 118 }
117 119
118 120
119 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, 121 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
120 Node* context, Node* frame_state, 122 Node* context, Node* frame_state,
121 CallFunctionFlags flags) { 123 CallFunctionFlags flags) {
122 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); 124 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags);
123 CallDescriptor* desc = Linkage::GetStubCallDescriptor( 125 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
124 isolate(), zone(), callable.descriptor(), 1, 126 isolate(), zone(), callable.descriptor(), 1,
125 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); 127 CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
126 Node* stub_code = HeapConstant(callable.code()); 128 Node* stub_code = HeapConstant(callable.code());
127 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, 129 Node* call = graph()->NewNode(common()->Call(desc), stub_code, function,
128 receiver, context, frame_state); 130 receiver, context, frame_state,
131 graph()->start(), graph()->start());
129 schedule()->AddNode(CurrentBlock(), call); 132 schedule()->AddNode(CurrentBlock(), call);
130 return call; 133 return call;
131 } 134 }
132 135
133 136
134 Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver, 137 Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver,
135 Node* context, Node* frame_state) { 138 Node* context, Node* frame_state) {
136 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( 139 CallDescriptor* descriptor = Linkage::GetJSCallDescriptor(
137 zone(), false, 1, CallDescriptor::kNeedsFrameState); 140 zone(), false, 1, CallDescriptor::kNeedsFrameState);
138 Node* call = graph()->NewNode(common()->Call(descriptor), function, receiver, 141 Node* call =
139 context, frame_state); 142 graph()->NewNode(common()->Call(descriptor), function, receiver, context,
143 frame_state, graph()->start(), graph()->start());
140 schedule()->AddNode(CurrentBlock(), call); 144 schedule()->AddNode(CurrentBlock(), call);
141 return call; 145 return call;
142 } 146 }
143 147
144 148
145 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, 149 Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
146 Node* arg0, Node* context, 150 Node* arg0, Node* context,
147 Node* frame_state) { 151 Node* frame_state) {
148 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( 152 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
149 zone(), function, 1, Operator::kNoProperties); 153 zone(), function, 1, Operator::kNoProperties);
150 154
151 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); 155 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
152 Node* ref = NewNode( 156 Node* ref = NewNode(
153 common()->ExternalConstant(ExternalReference(function, isolate()))); 157 common()->ExternalConstant(ExternalReference(function, isolate())));
154 Node* arity = Int32Constant(1); 158 Node* arity = Int32Constant(1);
155 159
156 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref, 160 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref,
157 arity, context, frame_state); 161 arity, context, frame_state, graph()->start(),
162 graph()->start());
158 schedule()->AddNode(CurrentBlock(), call); 163 schedule()->AddNode(CurrentBlock(), call);
159 return call; 164 return call;
160 } 165 }
161 166
162 167
163 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, 168 Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
164 Node* function) { 169 Node* function) {
165 MachineSignature::Builder builder(zone(), 1, 0); 170 MachineSignature::Builder builder(zone(), 1, 0);
166 builder.AddReturn(return_type); 171 builder.AddReturn(return_type);
167 const CallDescriptor* descriptor = 172 const CallDescriptor* descriptor =
168 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 173 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
169 174
170 Node* call = graph()->NewNode(common()->Call(descriptor), function); 175 Node* call = graph()->NewNode(common()->Call(descriptor), function,
176 graph()->start(), graph()->start());
171 schedule()->AddNode(CurrentBlock(), call); 177 schedule()->AddNode(CurrentBlock(), call);
172 return call; 178 return call;
173 } 179 }
174 180
175 181
176 Node* RawMachineAssembler::CallCFunction1(MachineType return_type, 182 Node* RawMachineAssembler::CallCFunction1(MachineType return_type,
177 MachineType arg0_type, Node* function, 183 MachineType arg0_type, Node* function,
178 Node* arg0) { 184 Node* arg0) {
179 MachineSignature::Builder builder(zone(), 1, 1); 185 MachineSignature::Builder builder(zone(), 1, 1);
180 builder.AddReturn(return_type); 186 builder.AddReturn(return_type);
181 builder.AddParam(arg0_type); 187 builder.AddParam(arg0_type);
182 const CallDescriptor* descriptor = 188 const CallDescriptor* descriptor =
183 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 189 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
184 190
185 Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0); 191 Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
192 graph()->start(), graph()->start());
186 schedule()->AddNode(CurrentBlock(), call); 193 schedule()->AddNode(CurrentBlock(), call);
187 return call; 194 return call;
188 } 195 }
189 196
190 197
191 Node* RawMachineAssembler::CallCFunction2(MachineType return_type, 198 Node* RawMachineAssembler::CallCFunction2(MachineType return_type,
192 MachineType arg0_type, 199 MachineType arg0_type,
193 MachineType arg1_type, Node* function, 200 MachineType arg1_type, Node* function,
194 Node* arg0, Node* arg1) { 201 Node* arg0, Node* arg1) {
195 MachineSignature::Builder builder(zone(), 1, 2); 202 MachineSignature::Builder builder(zone(), 1, 2);
196 builder.AddReturn(return_type); 203 builder.AddReturn(return_type);
197 builder.AddParam(arg0_type); 204 builder.AddParam(arg0_type);
198 builder.AddParam(arg1_type); 205 builder.AddParam(arg1_type);
199 const CallDescriptor* descriptor = 206 const CallDescriptor* descriptor =
200 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 207 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
201 208
202 Node* call = 209 Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
203 graph()->NewNode(common()->Call(descriptor), function, arg0, arg1); 210 arg1, graph()->start(), graph()->start());
204 schedule()->AddNode(CurrentBlock(), call); 211 schedule()->AddNode(CurrentBlock(), call);
205 return call; 212 return call;
206 } 213 }
207 214
208 215
209 Node* RawMachineAssembler::CallCFunction8( 216 Node* RawMachineAssembler::CallCFunction8(
210 MachineType return_type, MachineType arg0_type, MachineType arg1_type, 217 MachineType return_type, MachineType arg0_type, MachineType arg1_type,
211 MachineType arg2_type, MachineType arg3_type, MachineType arg4_type, 218 MachineType arg2_type, MachineType arg3_type, MachineType arg4_type,
212 MachineType arg5_type, MachineType arg6_type, MachineType arg7_type, 219 MachineType arg5_type, MachineType arg6_type, MachineType arg7_type,
213 Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3, Node* arg4, 220 Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3, Node* arg4,
214 Node* arg5, Node* arg6, Node* arg7) { 221 Node* arg5, Node* arg6, Node* arg7) {
215 MachineSignature::Builder builder(zone(), 1, 8); 222 MachineSignature::Builder builder(zone(), 1, 8);
216 builder.AddReturn(return_type); 223 builder.AddReturn(return_type);
217 builder.AddParam(arg0_type); 224 builder.AddParam(arg0_type);
218 builder.AddParam(arg1_type); 225 builder.AddParam(arg1_type);
219 builder.AddParam(arg2_type); 226 builder.AddParam(arg2_type);
220 builder.AddParam(arg3_type); 227 builder.AddParam(arg3_type);
221 builder.AddParam(arg4_type); 228 builder.AddParam(arg4_type);
222 builder.AddParam(arg5_type); 229 builder.AddParam(arg5_type);
223 builder.AddParam(arg6_type); 230 builder.AddParam(arg6_type);
224 builder.AddParam(arg7_type); 231 builder.AddParam(arg7_type);
232 Node* args[] = {function,
233 arg0,
234 arg1,
235 arg2,
236 arg3,
237 arg4,
238 arg5,
239 arg6,
240 arg7,
241 graph()->start(),
242 graph()->start()};
225 const CallDescriptor* descriptor = 243 const CallDescriptor* descriptor =
226 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 244 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
227 245 Node* call =
228 Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0, 246 graph()->NewNode(common()->Call(descriptor), arraysize(args), args);
229 arg1, arg2, arg3, arg4, arg5, arg6, arg7);
230 schedule()->AddNode(CurrentBlock(), call); 247 schedule()->AddNode(CurrentBlock(), call);
231 return call; 248 return call;
232 } 249 }
233 250
234 251
235 Node* RawMachineAssembler::TailCallInterpreterDispatch( 252 Node* RawMachineAssembler::TailCallInterpreterDispatch(
236 const CallDescriptor* call_descriptor, Node* target, Node* arg1, Node* arg2, 253 const CallDescriptor* call_descriptor, Node* target, Node* arg1, Node* arg2,
237 Node* arg3, Node* arg4, Node* arg5) { 254 Node* arg3, Node* arg4, Node* arg5) {
238 Node* tail_call = 255 Node* tail_call =
239 graph()->NewNode(common()->TailCall(call_descriptor), target, arg1, arg2, 256 graph()->NewNode(common()->TailCall(call_descriptor), target, arg1, arg2,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 DCHECK_NOT_NULL(schedule_); 291 DCHECK_NOT_NULL(schedule_);
275 DCHECK(current_block_ != nullptr); 292 DCHECK(current_block_ != nullptr);
276 Node* node = graph()->NewNode(op, input_count, inputs); 293 Node* node = graph()->NewNode(op, input_count, inputs);
277 schedule()->AddNode(CurrentBlock(), node); 294 schedule()->AddNode(CurrentBlock(), node);
278 return node; 295 return node;
279 } 296 }
280 297
281 } // namespace compiler 298 } // namespace compiler
282 } // namespace internal 299 } // namespace internal
283 } // namespace v8 300 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698