Chromium Code Reviews| Index: src/compiler/linkage-impl.h |
| diff --git a/src/compiler/linkage-impl.h b/src/compiler/linkage-impl.h |
| index 5b638034c8cbeaf7e141eda55d0d71150ba3bdcf..02f4d3994a080cddcb0bb8d4d96255e827be4efe 100644 |
| --- a/src/compiler/linkage-impl.h |
| +++ b/src/compiler/linkage-impl.h |
| @@ -6,6 +6,7 @@ |
| #define V8_COMPILER_LINKAGE_IMPL_H_ |
| #include "src/code-stubs.h" |
| +#include "src/compiler/interpreter-assembler.h" |
| #include "src/compiler/osr.h" |
| namespace v8 { |
| @@ -233,18 +234,32 @@ class LinkageHelper { |
| "c-call"); |
| } |
| - static CallDescriptor* GetInterpreterDispatchDescriptor( |
| - Zone* zone, const MachineSignature* msig) { |
| - DCHECK_EQ(0, msig->parameter_count()); |
| - LocationSignature::Builder locations(zone, msig->return_count(), |
| - msig->parameter_count()); |
| - AddReturnLocations(&locations); |
| + static CallDescriptor* GetInterpreterDispatchDescriptor(Zone* zone, |
| + bool will_return) { |
| + int return_count = will_return ? 1 : 0; |
| + MachineSignature::Builder types(zone, return_count, 2); |
| + LocationSignature::Builder locations(zone, return_count, 2); |
| + |
| + // Add registers for fixed parameters passed via interpreter dispatch. |
| + DCHECK_EQ(0, InterpreterAssembler::kBytecodePointerParameter); |
|
Michael Starzinger
2015/07/17 13:20:59
Would it make sense to move these constant (i.e. k
rmcilroy
2015/07/21 11:13:21
Works for me. Done.
|
| + types.AddParam(kMachPtr); |
| + locations.AddParam(regloc(LinkageTraits::InterpreterBytecodePointerReg())); |
| + |
| + DCHECK_EQ(1, InterpreterAssembler::kDispatchTablePointerParameter); |
| + types.AddParam(kMachPtr); |
| + locations.AddParam(regloc(LinkageTraits::InterpreterDispatchTableReg())); |
| + |
| + if (will_return) { |
|
Michael Starzinger
2015/07/17 13:20:58
The boolean "will_return" flag here makes me nervo
rmcilroy
2015/07/21 11:13:21
Based on a suggestion from @danno I reworked this
Michael Starzinger
2015/07/21 13:51:45
Acknowledged. Yep, much better, I like.
|
| + types.AddReturn(kMachAnyTagged); |
| + AddReturnLocations(&locations); |
| + } |
| + |
| LinkageLocation target_loc = LinkageLocation::AnyRegister(); |
| return new (zone) CallDescriptor( // -- |
| CallDescriptor::kInterpreterDispatch, // kind |
| kMachNone, // target MachineType |
| target_loc, // target location |
| - msig, // machine_sig |
| + types.Build(), // machine_sig |
| locations.Build(), // location_sig |
| 0, // js_parameter_count |
| Operator::kNoProperties, // properties |