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

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

Issue 1333843002: [runtime] Move binary operator fallbacks into the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: No need for frame states in bytecode handlers. Add test case. Created 5 years, 3 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
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) {
184 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( 183 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
185 zone(), function, 1, Operator::kNoProperties); 184 zone(), function, 1, Operator::kNoProperties, false);
186 185
187 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode()); 186 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
188 Node* ref = NewNode( 187 Node* ref = NewNode(
189 common()->ExternalConstant(ExternalReference(function, isolate()))); 188 common()->ExternalConstant(ExternalReference(function, isolate())));
190 Node* arity = Int32Constant(1); 189 Node* arity = Int32Constant(1);
191 190
192 Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref, 191 Node* call =
193 arity, context, frame_state, graph()->start(), 192 graph()->NewNode(common()->Call(descriptor), centry, arg1, ref, arity,
194 graph()->start()); 193 context, graph()->start(), graph()->start());
195 schedule()->AddNode(CurrentBlock(), call); 194 schedule()->AddNode(CurrentBlock(), call);
196 return call; 195 return call;
197 } 196 }
197
198
199 Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function,
200 Node* arg1, Node* arg2, Node* context) {
201 CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
202 zone(), function, 2, Operator::kNoProperties, false);
203
204 Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
205 Node* ref = NewNode(
206 common()->ExternalConstant(ExternalReference(function, isolate())));
207 Node* arity = Int32Constant(2);
208
209 Node* call =
210 graph()->NewNode(common()->Call(descriptor), centry, arg1, arg2, ref,
211 arity, context, graph()->start(), graph()->start());
212 schedule()->AddNode(CurrentBlock(), call);
213 return call;
214 }
198 215
199 216
200 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, 217 Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
201 Node* function) { 218 Node* function) {
202 MachineSignature::Builder builder(zone(), 1, 0); 219 MachineSignature::Builder builder(zone(), 1, 0);
203 builder.AddReturn(return_type); 220 builder.AddReturn(return_type);
204 const CallDescriptor* descriptor = 221 const CallDescriptor* descriptor =
205 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 222 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
206 223
207 Node* call = graph()->NewNode(common()->Call(descriptor), function, 224 Node* call = graph()->NewNode(common()->Call(descriptor), function,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 DCHECK_NOT_NULL(schedule_); 329 DCHECK_NOT_NULL(schedule_);
313 DCHECK(current_block_ != nullptr); 330 DCHECK(current_block_ != nullptr);
314 Node* node = graph()->NewNode(op, input_count, inputs); 331 Node* node = graph()->NewNode(op, input_count, inputs);
315 schedule()->AddNode(CurrentBlock(), node); 332 schedule()->AddNode(CurrentBlock(), node);
316 return node; 333 return node;
317 } 334 }
318 335
319 } // namespace compiler 336 } // namespace compiler
320 } // namespace internal 337 } // namespace internal
321 } // namespace v8 338 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698