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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 514643002: [turbofan] Explicitly mark call sites as patchable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/graph-inl.h" 7 #include "src/compiler/graph-inl.h"
8 #include "src/compiler/js-generic-lowering.h" 8 #include "src/compiler/js-generic-lowering.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-aux-data-inl.h" 10 #include "src/compiler/node-aux-data-inl.h"
11 #include "src/compiler/node-properties-inl.h" 11 #include "src/compiler/node-properties-inl.h"
12 #include "src/unique.h" 12 #include "src/unique.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 namespace compiler { 16 namespace compiler {
17 17
18 18
19 // TODO(mstarzinger): This is a temporary workaround for non-hydrogen stubs for 19 // TODO(mstarzinger): This is a temporary workaround for non-hydrogen stubs for
20 // which we don't have an interface descriptor yet. Use ReplaceWithICStubCall 20 // which we don't have an interface descriptor yet. Use ReplaceWithStubCall
21 // once these stub have been made into a HydrogenCodeStub. 21 // once these stub have been made into a HydrogenCodeStub.
22 template <typename T> 22 template <typename T>
23 static CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate, 23 static CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate,
24 T* stub) { 24 T* stub) {
25 CodeStub::Major key = static_cast<CodeStub*>(stub)->MajorKey(); 25 CodeStub::Major key = static_cast<CodeStub*>(stub)->MajorKey();
26 CodeStubInterfaceDescriptor* d = isolate->code_stub_interface_descriptor(key); 26 CodeStubInterfaceDescriptor* d = isolate->code_stub_interface_descriptor(key);
27 stub->InitializeInterfaceDescriptor(d); 27 stub->InitializeInterfaceDescriptor(d);
28 return d; 28 return d;
29 } 29 }
30 30
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 #undef DECLARE_CASE 211 #undef DECLARE_CASE
212 default: 212 default:
213 // Nothing to see. 213 // Nothing to see.
214 return NoChange(); 214 return NoChange();
215 } 215 }
216 DCHECK_EQ(node, replacement); 216 DCHECK_EQ(node, replacement);
217 return Changed(replacement); 217 return Changed(replacement);
218 } 218 }
219 219
220 220
221 #define REPLACE_IC_STUB_CALL(op, StubDeclaration) \ 221 #define REPLACE_BINARY_OP_IC_CALL(op, token) \
222 Node* JSGenericLowering::Lower##op(Node* node) { \ 222 Node* JSGenericLowering::Lower##op(Node* node) { \
223 StubDeclaration; \ 223 BinaryOpICStub stub(isolate(), token); \
224 ReplaceWithICStubCall(node, &stub); \ 224 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite | \
Michael Starzinger 2014/08/27 12:50:11 nit: Can we use the kPatchableCallSiteWithNop shor
Benedikt Meurer 2014/08/28 11:46:57 Done.
225 return node; \ 225 CallDescriptor::kNeedsNopAfterCall); \
226 return node; \
226 } 227 }
227 REPLACE_IC_STUB_CALL(JSBitwiseOr, BinaryOpICStub stub(isolate(), Token::BIT_OR)) 228 REPLACE_BINARY_OP_IC_CALL(JSBitwiseOr, Token::BIT_OR)
228 REPLACE_IC_STUB_CALL(JSBitwiseXor, 229 REPLACE_BINARY_OP_IC_CALL(JSBitwiseXor, Token::BIT_XOR)
229 BinaryOpICStub stub(isolate(), Token::BIT_XOR)) 230 REPLACE_BINARY_OP_IC_CALL(JSBitwiseAnd, Token::BIT_AND)
230 REPLACE_IC_STUB_CALL(JSBitwiseAnd, 231 REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL)
231 BinaryOpICStub stub(isolate(), Token::BIT_AND)) 232 REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR)
232 REPLACE_IC_STUB_CALL(JSShiftLeft, BinaryOpICStub stub(isolate(), Token::SHL)) 233 REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR)
233 REPLACE_IC_STUB_CALL(JSShiftRight, BinaryOpICStub stub(isolate(), Token::SAR)) 234 REPLACE_BINARY_OP_IC_CALL(JSAdd, Token::ADD)
234 REPLACE_IC_STUB_CALL(JSShiftRightLogical, 235 REPLACE_BINARY_OP_IC_CALL(JSSubtract, Token::SUB)
235 BinaryOpICStub stub(isolate(), Token::SHR)) 236 REPLACE_BINARY_OP_IC_CALL(JSMultiply, Token::MUL)
236 REPLACE_IC_STUB_CALL(JSAdd, BinaryOpICStub stub(isolate(), Token::ADD)) 237 REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV)
237 REPLACE_IC_STUB_CALL(JSSubtract, BinaryOpICStub stub(isolate(), Token::SUB)) 238 REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD)
238 REPLACE_IC_STUB_CALL(JSMultiply, BinaryOpICStub stub(isolate(), Token::MUL)) 239 #undef REPLACE_BINARY_OP_IC_CALL
239 REPLACE_IC_STUB_CALL(JSDivide, BinaryOpICStub stub(isolate(), Token::DIV)) 240
240 REPLACE_IC_STUB_CALL(JSModulus, BinaryOpICStub stub(isolate(), Token::MOD)) 241
241 REPLACE_IC_STUB_CALL(JSToNumber, ToNumberStub stub(isolate())) 242 #define REPLACE_STUB_CALL(op, StubDeclaration) \
242 #undef REPLACE_IC_STUB_CALL 243 Node* JSGenericLowering::Lower##op(Node* node) { \
244 StubDeclaration; \
245 ReplaceWithStubCall(node, &stub, CallDescriptor::kNoFlags); \
246 return node; \
247 }
248 REPLACE_STUB_CALL(JSToNumber, ToNumberStub stub(isolate()))
249 #undef REPLACE_STUB_CALL
243 250
244 251
245 #define REPLACE_COMPARE_IC_CALL(op, token, pure) \ 252 #define REPLACE_COMPARE_IC_CALL(op, token, pure) \
246 Node* JSGenericLowering::Lower##op(Node* node) { \ 253 Node* JSGenericLowering::Lower##op(Node* node) { \
247 ReplaceWithCompareIC(node, token, pure); \ 254 ReplaceWithCompareIC(node, token, pure); \
248 return node; \ 255 return node; \
249 } 256 }
250 REPLACE_COMPARE_IC_CALL(JSEqual, Token::EQ, false) 257 REPLACE_COMPARE_IC_CALL(JSEqual, Token::EQ, false)
251 REPLACE_COMPARE_IC_CALL(JSNotEqual, Token::NE, false) 258 REPLACE_COMPARE_IC_CALL(JSNotEqual, Token::NE, false)
252 REPLACE_COMPARE_IC_CALL(JSStrictEqual, Token::EQ_STRICT, true) 259 REPLACE_COMPARE_IC_CALL(JSStrictEqual, Token::EQ_STRICT, true)
(...skipping 26 matching lines...) Expand all
279 UNIMPLEMENTED(); \ 286 UNIMPLEMENTED(); \
280 return node; \ 287 return node; \
281 } 288 }
282 REPLACE_UNIMPLEMENTED(JSToString) 289 REPLACE_UNIMPLEMENTED(JSToString)
283 REPLACE_UNIMPLEMENTED(JSToName) 290 REPLACE_UNIMPLEMENTED(JSToName)
284 REPLACE_UNIMPLEMENTED(JSYield) 291 REPLACE_UNIMPLEMENTED(JSYield)
285 REPLACE_UNIMPLEMENTED(JSDebugger) 292 REPLACE_UNIMPLEMENTED(JSDebugger)
286 #undef REPLACE_UNIMPLEMENTED 293 #undef REPLACE_UNIMPLEMENTED
287 294
288 295
289 static CallDescriptor::DeoptimizationSupport DeoptimizationSupportForNode( 296 static CallDescriptor::Flags FlagsForNode(Node* node) {
290 Node* node) { 297 CallDescriptor::Flags result = CallDescriptor::kNoFlags;
291 int result = CallDescriptor::kNoDeoptimization;
292 if (OperatorProperties::CanLazilyDeoptimize(node->op())) { 298 if (OperatorProperties::CanLazilyDeoptimize(node->op())) {
293 result |= CallDescriptor::kLazyDeoptimization; 299 result |= CallDescriptor::kLazyDeoptimization;
294 } 300 }
295 if (OperatorProperties::HasFrameStateInput(node->op())) { 301 if (OperatorProperties::HasFrameStateInput(node->op())) {
296 result |= CallDescriptor::kNeedsFrameState; 302 result |= CallDescriptor::kNeedsFrameState;
297 } 303 }
298 return static_cast<CallDescriptor::DeoptimizationSupport>(result); 304 return result;
299 } 305 }
300 306
301 307
302 void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token, 308 void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
303 bool pure) { 309 bool pure) {
304 BinaryOpICStub stub(isolate(), Token::ADD); // TODO(mstarzinger): Hack. 310 BinaryOpICStub stub(isolate(), Token::ADD); // TODO(mstarzinger): Hack.
305 CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor(); 311 CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor();
306 CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(d); 312 CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(
313 d, 0, CallDescriptor::kPatchableCallSiteWithNop);
307 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), token); 314 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), token);
308 Node* compare; 315 Node* compare;
309 if (pure) { 316 if (pure) {
310 // A pure (strict) comparison doesn't have an effect or control. 317 // A pure (strict) comparison doesn't have an effect or control.
311 // But for the graph, we need to add these inputs. 318 // But for the graph, we need to add these inputs.
312 compare = graph()->NewNode(common()->Call(desc_compare), CodeConstant(ic), 319 compare = graph()->NewNode(common()->Call(desc_compare), CodeConstant(ic),
313 NodeProperties::GetValueInput(node, 0), 320 NodeProperties::GetValueInput(node, 0),
314 NodeProperties::GetValueInput(node, 1), 321 NodeProperties::GetValueInput(node, 1),
315 NodeProperties::GetContextInput(node), 322 NodeProperties::GetContextInput(node),
316 graph()->start(), graph()->start()); 323 graph()->start(), graph()->start());
317 } else { 324 } else {
318 compare = graph()->NewNode(common()->Call(desc_compare), CodeConstant(ic), 325 compare = graph()->NewNode(common()->Call(desc_compare), CodeConstant(ic),
319 NodeProperties::GetValueInput(node, 0), 326 NodeProperties::GetValueInput(node, 0),
320 NodeProperties::GetValueInput(node, 1), 327 NodeProperties::GetValueInput(node, 1),
321 NodeProperties::GetContextInput(node), 328 NodeProperties::GetContextInput(node),
322 NodeProperties::GetEffectInput(node), 329 NodeProperties::GetEffectInput(node),
323 NodeProperties::GetControlInput(node)); 330 NodeProperties::GetControlInput(node));
324 } 331 }
325 node->ReplaceInput(0, compare); 332 node->ReplaceInput(0, compare);
326 node->ReplaceInput(1, SmiConstant(token)); 333 node->ReplaceInput(1, SmiConstant(token));
327 ReplaceWithRuntimeCall(node, Runtime::kBooleanize); 334 ReplaceWithRuntimeCall(node, Runtime::kBooleanize);
328 } 335 }
329 336
330 337
331 void JSGenericLowering::ReplaceWithICStubCall(Node* node, 338 void JSGenericLowering::ReplaceWithStubCall(Node* node, HydrogenCodeStub* stub,
332 HydrogenCodeStub* stub) { 339 CallDescriptor::Flags flags) {
333 CodeStubInterfaceDescriptor* d = stub->GetInterfaceDescriptor(); 340 CodeStubInterfaceDescriptor* d = stub->GetInterfaceDescriptor();
334 CallDescriptor* desc = linkage()->GetStubCallDescriptor( 341 CallDescriptor* desc =
335 d, 0, DeoptimizationSupportForNode(node)); 342 linkage()->GetStubCallDescriptor(d, 0, flags | FlagsForNode(node));
336 Node* stub_code = CodeConstant(stub->GetCode()); 343 Node* stub_code = CodeConstant(stub->GetCode());
337 PatchInsertInput(node, 0, stub_code); 344 PatchInsertInput(node, 0, stub_code);
338 PatchOperator(node, common()->Call(desc)); 345 PatchOperator(node, common()->Call(desc));
339 } 346 }
340 347
341 348
342 void JSGenericLowering::ReplaceWithBuiltinCall(Node* node, 349 void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
343 Builtins::JavaScript id, 350 Builtins::JavaScript id,
344 int nargs) { 351 int nargs) {
345 CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS); 352 CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
(...skipping 10 matching lines...) Expand all
356 PatchOperator(node, common()->Call(desc)); 363 PatchOperator(node, common()->Call(desc));
357 } 364 }
358 365
359 366
360 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, 367 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node,
361 Runtime::FunctionId f, 368 Runtime::FunctionId f,
362 int nargs_override) { 369 int nargs_override) {
363 Operator::Property props = node->op()->properties(); 370 Operator::Property props = node->op()->properties();
364 const Runtime::Function* fun = Runtime::FunctionForId(f); 371 const Runtime::Function* fun = Runtime::FunctionForId(f);
365 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override; 372 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override;
366 CallDescriptor* desc = linkage()->GetRuntimeCallDescriptor( 373 CallDescriptor* desc =
367 f, nargs, props, DeoptimizationSupportForNode(node)); 374 linkage()->GetRuntimeCallDescriptor(f, nargs, props, FlagsForNode(node));
368 Node* ref = ExternalConstant(ExternalReference(f, isolate())); 375 Node* ref = ExternalConstant(ExternalReference(f, isolate()));
369 Node* arity = Int32Constant(nargs); 376 Node* arity = Int32Constant(nargs);
370 if (!centrystub_constant_.is_set()) { 377 if (!centrystub_constant_.is_set()) {
371 centrystub_constant_.set(CodeConstant(CEntryStub(isolate(), 1).GetCode())); 378 centrystub_constant_.set(CodeConstant(CEntryStub(isolate(), 1).GetCode()));
372 } 379 }
373 PatchInsertInput(node, 0, centrystub_constant_.get()); 380 PatchInsertInput(node, 0, centrystub_constant_.get());
374 PatchInsertInput(node, nargs + 1, ref); 381 PatchInsertInput(node, nargs + 1, ref);
375 PatchInsertInput(node, nargs + 2, arity); 382 PatchInsertInput(node, nargs + 2, arity);
376 PatchOperator(node, common()->Call(desc)); 383 PatchOperator(node, common()->Call(desc));
377 } 384 }
378 385
379 386
380 Node* JSGenericLowering::LowerBranch(Node* node) { 387 Node* JSGenericLowering::LowerBranch(Node* node) {
381 Node* test = graph()->NewNode(machine()->WordEqual(), node->InputAt(0), 388 Node* test = graph()->NewNode(machine()->WordEqual(), node->InputAt(0),
382 jsgraph()->TrueConstant()); 389 jsgraph()->TrueConstant());
383 node->ReplaceInput(0, test); 390 node->ReplaceInput(0, test);
384 return node; 391 return node;
385 } 392 }
386 393
387 394
388 Node* JSGenericLowering::LowerJSUnaryNot(Node* node) { 395 Node* JSGenericLowering::LowerJSUnaryNot(Node* node) {
389 ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL); 396 ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL);
390 ReplaceWithICStubCall(node, &stub); 397 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
391 return node; 398 return node;
392 } 399 }
393 400
394 401
395 Node* JSGenericLowering::LowerJSToBoolean(Node* node) { 402 Node* JSGenericLowering::LowerJSToBoolean(Node* node) {
396 ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_ODDBALL); 403 ToBooleanStub stub(isolate(), ToBooleanStub::RESULT_AS_ODDBALL);
397 ReplaceWithICStubCall(node, &stub); 404 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
398 return node; 405 return node;
399 } 406 }
400 407
401 408
402 Node* JSGenericLowering::LowerJSToObject(Node* node) { 409 Node* JSGenericLowering::LowerJSToObject(Node* node) {
403 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1); 410 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1);
404 return node; 411 return node;
405 } 412 }
406 413
407 414
408 Node* JSGenericLowering::LowerJSLoadProperty(Node* node) { 415 Node* JSGenericLowering::LowerJSLoadProperty(Node* node) {
409 KeyedLoadICStubShim stub(isolate()); 416 KeyedLoadICStubShim stub(isolate());
410 ReplaceWithICStubCall(node, &stub); 417 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
411 return node; 418 return node;
412 } 419 }
413 420
414 421
415 Node* JSGenericLowering::LowerJSLoadNamed(Node* node) { 422 Node* JSGenericLowering::LowerJSLoadNamed(Node* node) {
416 LoadNamedParameters p = OpParameter<LoadNamedParameters>(node); 423 LoadNamedParameters p = OpParameter<LoadNamedParameters>(node);
417 LoadICStubShim stub(isolate(), p.contextual_mode); 424 LoadICStubShim stub(isolate(), p.contextual_mode);
418 PatchInsertInput(node, 1, jsgraph()->HeapConstant(p.name)); 425 PatchInsertInput(node, 1, jsgraph()->HeapConstant(p.name));
419 ReplaceWithICStubCall(node, &stub); 426 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
420 return node; 427 return node;
421 } 428 }
422 429
423 430
424 Node* JSGenericLowering::LowerJSStoreProperty(Node* node) { 431 Node* JSGenericLowering::LowerJSStoreProperty(Node* node) {
425 // TODO(mstarzinger): The strict_mode needs to be carried along in the 432 // TODO(mstarzinger): The strict_mode needs to be carried along in the
426 // operator so that graphs are fully compositional for inlining. 433 // operator so that graphs are fully compositional for inlining.
427 StrictMode strict_mode = info()->strict_mode(); 434 StrictMode strict_mode = info()->strict_mode();
428 KeyedStoreICStubShim stub(isolate(), strict_mode); 435 KeyedStoreICStubShim stub(isolate(), strict_mode);
429 ReplaceWithICStubCall(node, &stub); 436 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
430 return node; 437 return node;
431 } 438 }
432 439
433 440
434 Node* JSGenericLowering::LowerJSStoreNamed(Node* node) { 441 Node* JSGenericLowering::LowerJSStoreNamed(Node* node) {
435 PrintableUnique<Name> key = OpParameter<PrintableUnique<Name> >(node); 442 PrintableUnique<Name> key = OpParameter<PrintableUnique<Name> >(node);
436 // TODO(mstarzinger): The strict_mode needs to be carried along in the 443 // TODO(mstarzinger): The strict_mode needs to be carried along in the
437 // operator so that graphs are fully compositional for inlining. 444 // operator so that graphs are fully compositional for inlining.
438 StrictMode strict_mode = info()->strict_mode(); 445 StrictMode strict_mode = info()->strict_mode();
439 StoreICStubShim stub(isolate(), strict_mode); 446 StoreICStubShim stub(isolate(), strict_mode);
440 PatchInsertInput(node, 1, jsgraph()->HeapConstant(key)); 447 PatchInsertInput(node, 1, jsgraph()->HeapConstant(key));
441 ReplaceWithICStubCall(node, &stub); 448 ReplaceWithStubCall(node, &stub, CallDescriptor::kPatchableCallSite);
442 return node; 449 return node;
443 } 450 }
444 451
445 452
446 Node* JSGenericLowering::LowerJSDeleteProperty(Node* node) { 453 Node* JSGenericLowering::LowerJSDeleteProperty(Node* node) {
447 StrictMode strict_mode = OpParameter<StrictMode>(node); 454 StrictMode strict_mode = OpParameter<StrictMode>(node);
448 PatchInsertInput(node, 2, SmiConstant(strict_mode)); 455 PatchInsertInput(node, 2, SmiConstant(strict_mode));
449 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); 456 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3);
450 return node; 457 return node;
451 } 458 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index()))); 512 node->ReplaceInput(1, Int32Constant(Context::SlotOffset(access.index())));
506 PatchOperator(node, machine()->Store(kMachAnyTagged, kFullWriteBarrier)); 513 PatchOperator(node, machine()->Store(kMachAnyTagged, kFullWriteBarrier));
507 return node; 514 return node;
508 } 515 }
509 516
510 517
511 Node* JSGenericLowering::LowerJSCallConstruct(Node* node) { 518 Node* JSGenericLowering::LowerJSCallConstruct(Node* node) {
512 int arity = OpParameter<int>(node); 519 int arity = OpParameter<int>(node);
513 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); 520 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
514 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub); 521 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
515 CallDescriptor* desc = linkage()->GetStubCallDescriptor( 522 CallDescriptor* desc =
516 d, arity, DeoptimizationSupportForNode(node)); 523 linkage()->GetStubCallDescriptor(d, arity, FlagsForNode(node));
517 Node* stub_code = CodeConstant(stub.GetCode()); 524 Node* stub_code = CodeConstant(stub.GetCode());
518 Node* construct = NodeProperties::GetValueInput(node, 0); 525 Node* construct = NodeProperties::GetValueInput(node, 0);
519 PatchInsertInput(node, 0, stub_code); 526 PatchInsertInput(node, 0, stub_code);
520 PatchInsertInput(node, 1, Int32Constant(arity - 1)); 527 PatchInsertInput(node, 1, Int32Constant(arity - 1));
521 PatchInsertInput(node, 2, construct); 528 PatchInsertInput(node, 2, construct);
522 PatchInsertInput(node, 3, jsgraph()->UndefinedConstant()); 529 PatchInsertInput(node, 3, jsgraph()->UndefinedConstant());
523 PatchOperator(node, common()->Call(desc)); 530 PatchOperator(node, common()->Call(desc));
524 return node; 531 return node;
525 } 532 }
526 533
527 534
528 Node* JSGenericLowering::LowerJSCallFunction(Node* node) { 535 Node* JSGenericLowering::LowerJSCallFunction(Node* node) {
529 CallParameters p = OpParameter<CallParameters>(node); 536 CallParameters p = OpParameter<CallParameters>(node);
530 CallFunctionStub stub(isolate(), p.arity - 2, p.flags); 537 CallFunctionStub stub(isolate(), p.arity - 2, p.flags);
531 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub); 538 CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &stub);
532 CallDescriptor* desc = linkage()->GetStubCallDescriptor( 539 CallDescriptor* desc =
533 d, p.arity - 1, DeoptimizationSupportForNode(node)); 540 linkage()->GetStubCallDescriptor(d, p.arity - 1, FlagsForNode(node));
534 Node* stub_code = CodeConstant(stub.GetCode()); 541 Node* stub_code = CodeConstant(stub.GetCode());
535 PatchInsertInput(node, 0, stub_code); 542 PatchInsertInput(node, 0, stub_code);
536 PatchOperator(node, common()->Call(desc)); 543 PatchOperator(node, common()->Call(desc));
537 return node; 544 return node;
538 } 545 }
539 546
540 547
541 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { 548 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) {
542 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); 549 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node);
543 int arity = OperatorProperties::GetValueInputCount(node->op()); 550 int arity = OperatorProperties::GetValueInputCount(node->op());
544 ReplaceWithRuntimeCall(node, function, arity); 551 ReplaceWithRuntimeCall(node, function, arity);
545 return node; 552 return node;
546 } 553 }
547 } 554
548 } 555 } // namespace compiler
549 } // namespace v8::internal::compiler 556 } // namespace internal
557 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698