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

Unified Diff: src/compiler/linkage.cc

Issue 1568493002: [Interpreter] Add support for calling runtime functions which return a pair. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's review comments. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/linkage.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 0337af9edaa5fd8483a2694a26afb60dcadd62f8..174dd67577fe09a12c021f8add5d2ea613ad6df8 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -430,21 +430,28 @@ CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) {
CallDescriptor* Linkage::GetStubCallDescriptor(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count, CallDescriptor::Flags flags,
- Operator::Properties properties, MachineType return_type) {
+ Operator::Properties properties, MachineType return_type,
+ size_t return_count) {
const int register_parameter_count = descriptor.GetRegisterParameterCount();
const int js_parameter_count =
register_parameter_count + stack_parameter_count;
const int context_count = 1;
- const size_t return_count = 1;
const size_t parameter_count =
static_cast<size_t>(js_parameter_count + context_count);
LocationSignature::Builder locations(zone, return_count, parameter_count);
MachineSignature::Builder types(zone, return_count, parameter_count);
- // Add return location.
- locations.AddReturn(regloc(kReturnRegister0));
- types.AddReturn(return_type);
+ // Add returns.
+ if (locations.return_count_ > 0) {
+ locations.AddReturn(regloc(kReturnRegister0));
+ }
+ if (locations.return_count_ > 1) {
+ locations.AddReturn(regloc(kReturnRegister1));
+ }
+ for (size_t i = 0; i < return_count; i++) {
+ types.AddReturn(return_type);
+ }
// Add parameters in registers and on the stack.
for (int i = 0; i < js_parameter_count; i++) {
« no previous file with comments | « src/compiler/linkage.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698