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

Side by Side Diff: src/compiler/linkage.cc

Issue 1412443003: [turbofan] Introduce lazy bailout, masked as a call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Enable test Created 5 years, 2 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 | « src/compiler/linkage.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler.h" 6 #include "src/compiler.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/frame.h" 8 #include "src/compiler/frame.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 switch (k) { 56 switch (k) {
57 case CallDescriptor::kCallCodeObject: 57 case CallDescriptor::kCallCodeObject:
58 os << "Code"; 58 os << "Code";
59 break; 59 break;
60 case CallDescriptor::kCallJSFunction: 60 case CallDescriptor::kCallJSFunction:
61 os << "JS"; 61 os << "JS";
62 break; 62 break;
63 case CallDescriptor::kCallAddress: 63 case CallDescriptor::kCallAddress:
64 os << "Addr"; 64 os << "Addr";
65 break; 65 break;
66 case CallDescriptor::kLazyBailout:
67 os << "LazyBail";
68 break;
66 } 69 }
67 return os; 70 return os;
68 } 71 }
69 72
70 73
71 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { 74 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) {
72 // TODO(svenpanne) Output properties etc. and be less cryptic. 75 // TODO(svenpanne) Output properties etc. and be less cryptic.
73 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() 76 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount()
74 << "s" << d.StackParameterCount() << "i" << d.InputCount() << "f" 77 << "s" << d.StackParameterCount() << "i" << d.InputCount() << "f"
75 << d.FrameStateCount() << "t" << d.SupportsTailCalls(); 78 << d.FrameStateCount() << "t" << d.SupportsTailCalls();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 locations.Build(), // location_sig 347 locations.Build(), // location_sig
345 js_parameter_count, // stack_parameter_count 348 js_parameter_count, // stack_parameter_count
346 properties, // properties 349 properties, // properties
347 kNoCalleeSaved, // callee-saved 350 kNoCalleeSaved, // callee-saved
348 kNoCalleeSaved, // callee-saved fp 351 kNoCalleeSaved, // callee-saved fp
349 flags, // flags 352 flags, // flags
350 function->name); // debug name 353 function->name); // debug name
351 } 354 }
352 355
353 356
357 CallDescriptor* Linkage::GetLazyBailoutDescriptor(Zone* zone) {
358 const size_t return_count = 0;
359 const size_t parameter_count = 0;
360
361 LocationSignature::Builder locations(zone, return_count, parameter_count);
362 MachineSignature::Builder types(zone, return_count, parameter_count);
363
364 // The target is ignored, but we need to give some values here.
365 MachineType target_type = kMachAnyTagged;
366 LinkageLocation target_loc = regloc(kJSFunctionRegister);
367 return new (zone) CallDescriptor( // --
368 CallDescriptor::kLazyBailout, // kind
369 target_type, // target MachineType
370 target_loc, // target location
371 types.Build(), // machine_sig
372 locations.Build(), // location_sig
373 0, // stack_parameter_count
374 Operator::kNoThrow, // properties
375 kNoCalleeSaved, // callee-saved
376 kNoCalleeSaved, // callee-saved fp
377 CallDescriptor::kNeedsFrameState, // flags
378 "lazy-bailout");
379 }
380
381
354 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, 382 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
355 int js_parameter_count, 383 int js_parameter_count,
356 CallDescriptor::Flags flags) { 384 CallDescriptor::Flags flags) {
357 const size_t return_count = 1; 385 const size_t return_count = 1;
358 const size_t context_count = 1; 386 const size_t context_count = 1;
359 const size_t parameter_count = js_parameter_count + context_count; 387 const size_t parameter_count = js_parameter_count + context_count;
360 388
361 LocationSignature::Builder locations(zone, return_count, parameter_count); 389 LocationSignature::Builder locations(zone, return_count, parameter_count);
362 MachineSignature::Builder types(zone, return_count, parameter_count); 390 MachineSignature::Builder types(zone, return_count, parameter_count);
363 391
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 return LinkageLocation::ForCalleeFrameSlot(spill_index); 555 return LinkageLocation::ForCalleeFrameSlot(spill_index);
528 } else { 556 } else {
529 // Parameter. Use the assigned location from the incoming call descriptor. 557 // Parameter. Use the assigned location from the incoming call descriptor.
530 int parameter_index = 1 + index; // skip index 0, which is the target. 558 int parameter_index = 1 + index; // skip index 0, which is the target.
531 return incoming_->GetInputLocation(parameter_index); 559 return incoming_->GetInputLocation(parameter_index);
532 } 560 }
533 } 561 }
534 } // namespace compiler 562 } // namespace compiler
535 } // namespace internal 563 } // namespace internal
536 } // namespace v8 564 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698