Commit cd43f56e authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[x64][turbofan] Pass the slot index for the peek instruction by operand

At the moment the slot index is encoded in the opcode. This, however,
sets an upper limit the slot index which is lower than what we want to
have (i.e. < 512). With this change we pass the slot index as an
immediate operand, which does not impose limits on the value it
contains.

R=titzer@chromium.org

Change-Id: Iab676186f41b8174bcc6c5a6053e6b0d5640ed3c
Reviewed-on: https://chromium-review.googlesource.com/866721
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50586}
parent c710e658
......@@ -2012,7 +2012,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64Peek: {
int reverse_slot = MiscField::decode(instr->opcode());
int reverse_slot = i.InputInt32(0);
int offset =
FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
if (instr->OutputAt(0)->IsFPRegister()) {
......
......@@ -1486,7 +1486,8 @@ void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
MarkAsFloat64(output.node);
}
InstructionOperand result = g.DefineAsRegister(output.node);
Emit(kX64Peek | MiscField::encode(reverse_slot), result);
InstructionOperand slot = g.UseImmediate(reverse_slot);
Emit(kX64Peek, 1, &result, 1, &slot);
}
}
......
......@@ -172,7 +172,10 @@
['arch == s390 or arch == s390x or arch == ppc or arch == ppc64', {
'test-multiple-return/*': [SKIP],
}],
# TODO(ahaas): Port multiple return values to ARM, MIPS, S390 and PPC
['arch == arm or arch == ia32 or arch == mips or arch == mips64 or arch == mipsel or arch == mips64el or arch == s390 or arch == s390x or arch == ppc or arch == ppc64', {
'test-multiple-return/ReturnLastValue*': [SKIP],
}],
##############################################################################
['asan == True', {
# Skip tests not suitable for ASAN.
......
......@@ -271,12 +271,11 @@ TEST_MULTI(Float64, MachineType::Float64())
#undef TEST_MULTI
void ReturnLastValue(MachineType type) {
for (int unused_stack_slots = 0; unused_stack_slots <= 2;
++unused_stack_slots) {
int slot_counts[] = {1, 2, 3, 600};
for (auto slot_count : slot_counts) {
v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME);
// Let {unused_stack_slots + 1} returns be on the stack.
const int return_count = num_registers(type) + unused_stack_slots + 1;
const int return_count = num_registers(type) + slot_count;
CallDescriptor* desc =
CreateMonoCallDescriptor(&zone, return_count, 0, type);
......
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