Remove unused allocateWritableOperand function (no bug, r=dvander)
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 11 Jan 2012 23:30:22 +0100
changeset 105554 be0364b7faa47f4140c8ed3388674a5f41187851
parent 105553 a12010ca115a11b5b6701cbc16dcf7910637941e
child 105555 d04701f99b8171760acd958e9ee01f1b5a21c664
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdvander
milestone12.0a1
Remove unused allocateWritableOperand function (no bug, r=dvander)
js/src/ion/GreedyAllocator.cpp
js/src/ion/GreedyAllocator.h
--- a/js/src/ion/GreedyAllocator.cpp
+++ b/js/src/ion/GreedyAllocator.cpp
@@ -379,46 +379,16 @@ GreedyAllocator::allocateRegisterOperand
     if (!vr->hasRegister() && !allocateReg(vr))
         return false;
     disallowed.addUnchecked(vr->reg());
 
     *a = LAllocation(vr->reg());
     return true;
 }
 
-bool
-GreedyAllocator::allocateWritableOperand(LAllocation *a, VirtualRegister *vr)
-{
-    AnyRegister reg;
-    if (!vr->hasRegister()) {
-        // If the vr has no register assigned, then we can assign a register and
-        // steal it knowing that it will be that register's last use.
-        if (!allocateReg(vr))
-            return false;
-        reg = vr->reg();
-    } else {
-        if (allocatableRegs().empty(vr->isDouble())) {
-            // If there are registers free, get one.
-            if (!allocate(vr->type(), DISALLOW, &reg))
-                return false;
-            align(vr->reg(), reg);
-        } else {
-            // Otherwise, clobber the register, and restore it on the way out.
-            reg = vr->reg();
-
-            allocateStack(vr);
-            if (!restore(vr->backingStack(), reg))
-                return false;
-        }
-    }
-
-    *a = LAllocation(reg);
-    return true;
-}
-
 static inline bool
 DeservesRegister(LDefinition::Type type)
 {
 #ifdef JS_NUNBOX32
     return type != LDefinition::TYPE;
 #else
     return true;
 #endif
--- a/js/src/ion/GreedyAllocator.h
+++ b/js/src/ion/GreedyAllocator.h
@@ -289,17 +289,16 @@ class GreedyAllocator
     bool allocate(LDefinition::Type type, Policy policy, AnyRegister *out);
     bool allocateReg(VirtualRegister *vreg);
 
     // Allocate a physical register for a virtual register, possibly evicting
     // in the process.
     bool allocateRegisterOperand(LAllocation *a, VirtualRegister *vr);
     bool allocateAnyOperand(LAllocation *a, VirtualRegister *vr, bool preferReg = false);
     bool allocateFixedOperand(LAllocation *a, VirtualRegister *vr);
-    bool allocateWritableOperand(LAllocation *a, VirtualRegister *vr);
 
     bool prescanDefinition(LDefinition *def);
     bool prescanDefinitions(LInstruction *ins);
     bool prescanUses(LInstruction *ins);
     bool spillForCall(LInstruction *ins);
     void informSnapshot(LInstruction *ins);
     bool informSafepoint(LSafepoint *safepoint);
     bool allocateDefinitions(LInstruction *ins);