Commit 5bbccc3e authored by bradnelson's avatar bradnelson Committed by Commit bot

Using RegisterConfiguration in test-multiple-return.

Not all register codes are safe for use on all architectures.
Using RegisterConfiguration when picking a calling convention
in test-multiple-return.

BUG=None
TEST=test-multiple-return
R=titzer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1401453002

Cr-Commit-Position: refs/heads/master@{#31188}
parent a01ab93f
......@@ -29,17 +29,22 @@ CallDescriptor* GetCallDescriptor(Zone* zone, int return_count,
int param_count) {
MachineSignature::Builder msig(zone, return_count, param_count);
LocationSignature::Builder locations(zone, return_count, param_count);
const RegisterConfiguration* config = RegisterConfiguration::ArchDefault();
// Add return location(s).
DCHECK(return_count <= config->num_allocatable_general_registers());
for (int i = 0; i < return_count; i++) {
msig.AddReturn(compiler::kMachInt32);
locations.AddReturn(LinkageLocation::ForRegister(i));
locations.AddReturn(
LinkageLocation::ForRegister(config->allocatable_general_codes()[i]));
}
// Add register and/or stack parameter(s).
DCHECK(param_count <= config->num_allocatable_general_registers());
for (int i = 0; i < param_count; i++) {
msig.AddParam(compiler::kMachInt32);
locations.AddParam(LinkageLocation::ForRegister(i));
locations.AddParam(
LinkageLocation::ForRegister(config->allocatable_general_codes()[i]));
}
const RegList kCalleeSaveRegisters = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment