Commit c31cf146 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[Liftoff] Inline {DropStackSlot} method

The method does not do much, and all callers actually overwrite or
delete the stack slot right after calling this method anyways, so there
is no need to make the slot a stack slot first.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I4fd54d2ed5f86a3e011ddc2748833dc81052ef5b
Reviewed-on: https://chromium-review.googlesource.com/1111848Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53975}
parent 8723374b
......@@ -295,16 +295,6 @@ class LiftoffAssembler : public TurboAssembler {
return SpillOneRegister(candidates, pinned);
}
void DropStackSlot(VarState* slot) {
// The only loc we care about is register. Other types don't occupy
// anything.
if (!slot->is_reg()) return;
// Free the register, then set the loc to "stack".
// No need to write back, the value should be dropped.
cache_state_.dec_used(slot->reg());
slot->MakeStack();
}
void MergeFullStackWith(CacheState&);
void MergeStackWith(CacheState&, uint32_t arity);
......
......@@ -1014,7 +1014,9 @@ class LiftoffCompiler {
}
void Drop(Decoder* decoder, const Value& value) {
__ DropStackSlot(&__ cache_state()->stack_state.back());
auto& slot = __ cache_state()->stack_state.back();
// If the dropped slot contains a register, decrement it's use count.
if (slot.is_reg()) __ cache_state()->dec_used(slot.reg());
__ cache_state()->stack_state.pop_back();
}
......@@ -1089,12 +1091,12 @@ class LiftoffCompiler {
auto& target_slot = state.stack_state[local_index];
switch (source_slot.loc()) {
case kRegister:
__ DropStackSlot(&target_slot);
if (target_slot.is_reg()) state.dec_used(target_slot.reg());
target_slot = source_slot;
if (is_tee) state.inc_used(target_slot.reg());
break;
case KIntConst:
__ DropStackSlot(&target_slot);
if (target_slot.is_reg()) state.dec_used(target_slot.reg());
target_slot = source_slot;
break;
case kStack:
......
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