if (i < register_parameter_count) {
// The first parameters go in registers.
Register reg = descriptor.GetEnvironmentParameterRegister(i);
+ Representation rep =
+ descriptor.GetEnvironmentParameterRepresentation(i);
locations.AddParam(regloc(reg));
+ types.AddParam(reptyp(rep));
} else {
// The rest of the parameters go on the stack.
int stack_slot = i - register_parameter_count - stack_parameter_count;
locations.AddParam(stackloc(stack_slot));
+ types.AddParam(kMachAnyTagged);
}
- types.AddParam(kMachAnyTagged);
}
// Add context.
locations.AddParam(regloc(LinkageTraits::ContextReg()));
DCHECK_LT(i, 0);
return LinkageLocation(i);
}
+
+ static MachineType reptyp(Representation representation) {
+ switch (representation.kind()) {
+ case Representation::kInteger8:
+ return kMachInt8;
+ case Representation::kUInteger8:
+ return kMachUint8;
+ case Representation::kInteger16:
+ return kMachInt16;
+ case Representation::kUInteger16:
+ return kMachUint16;
+ case Representation::kInteger32:
+ return kMachInt32;
+ case Representation::kSmi:
+ case Representation::kTagged:
+ case Representation::kHeapObject:
+ return kMachAnyTagged;
+ case Representation::kDouble:
+ return kMachFloat64;
+ case Representation::kExternal:
+ return kMachPtr;
+ case Representation::kNone:
+ case Representation::kNumRepresentations:
+ break;
+ }
+ UNREACHABLE();
+ return kMachNone;
+ }
};
}
}
-
} // namespace compiler
} // namespace internal
} // namespace v8