Bug 832073 - s/ScaleFromShift/ScaleFromElemWidth/ (r=dvander)
authorLuke Wagner <luke@mozilla.com>
Fri, 14 Dec 2012 10:27:15 -0800
changeset 119329 2750ce831552e4887490d5ec74d150b8bb909eac
parent 119328 bfad3bfb241451c44627ffdb2b9de0610b7743fb
child 119330 ff23b2b5b7f79c13281a9114c9395d5c556fedb4
push id21615
push userlwagner@mozilla.com
push dateSat, 19 Jan 2013 01:31:32 +0000
treeherdermozilla-inbound@2674257f6117 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs832073
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 832073 - s/ScaleFromShift/ScaleFromElemWidth/ (r=dvander)
js/src/ion/CodeGenerator.cpp
js/src/ion/shared/Assembler-shared.h
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -1230,17 +1230,17 @@ CodeGenerator::emitPushArguments(LApplyA
     // Copy arguments.
     {
         Register count = extraStackSpace; // <- argcreg
         Label loop;
         masm.bind(&loop);
 
         // We remove sizeof(void*) from argvOffset because withtout it we target
         // the address after the memory area that we want to copy.
-        BaseIndex disp(StackPointer, argcreg, ScaleFromShift(sizeof(Value)), argvOffset - sizeof(void*));
+        BaseIndex disp(StackPointer, argcreg, ScaleFromElemWidth(sizeof(Value)), argvOffset - sizeof(void*));
 
         // Do not use Push here because other this account to 1 in the framePushed
         // instead of 0.  These push are only counted by argcreg.
         masm.loadPtr(disp, copyreg);
         masm.push(copyreg);
 
         // Handle 32 bits architectures.
         if (sizeof(Value) == 2 * sizeof(void*)) {
@@ -1248,17 +1248,17 @@ CodeGenerator::emitPushArguments(LApplyA
             masm.push(copyreg);
         }
 
         masm.decBranchPtr(Assembler::NonZero, count, Imm32(1), &loop);
     }
 
     // Compute the stack usage.
     masm.movePtr(argcreg, extraStackSpace);
-    masm.lshiftPtr(Imm32::ShiftOf(ScaleFromShift(sizeof(Value))), extraStackSpace);
+    masm.lshiftPtr(Imm32::ShiftOf(ScaleFromElemWidth(sizeof(Value))), extraStackSpace);
 
     // Join with all arguments copied and the extra stack usage computed.
     masm.bind(&end);
 
     // Push |this|.
     masm.addPtr(Imm32(sizeof(Value)), extraStackSpace);
     masm.pushValue(ToValue(apply, LApplyArgsGeneric::ThisIndex));
 }
@@ -3522,17 +3522,17 @@ CodeGenerator::visitGetArgument(LGetArgu
     size_t argvOffset = frameSize() + IonJSFrameLayout::offsetOfActualArgs();
 
     if (index->isConstant()) {
         int32_t i = index->toConstant()->toInt32();
         Address argPtr(StackPointer, sizeof(Value) * i + argvOffset);
         masm.loadValue(argPtr, result);
     } else {
         Register i = ToRegister(index);
-        BaseIndex argPtr(StackPointer, i, ScaleFromShift(sizeof(Value)), argvOffset);
+        BaseIndex argPtr(StackPointer, i, ScaleFromElemWidth(sizeof(Value)), argvOffset);
         masm.loadValue(argPtr, result);
     }
     return true;
 }
 
 bool
 CodeGenerator::generate()
 {
@@ -4406,24 +4406,24 @@ CodeGenerator::visitLoadElementHole(LLoa
 bool
 CodeGenerator::visitLoadTypedArrayElement(LLoadTypedArrayElement *lir)
 {
     Register elements = ToRegister(lir->elements());
     Register temp = lir->temp()->isBogusTemp() ? InvalidReg : ToRegister(lir->temp());
     AnyRegister out = ToAnyRegister(lir->output());
 
     int arrayType = lir->mir()->arrayType();
-    int shift = TypedArray::slotWidth(arrayType);
+    int width = TypedArray::slotWidth(arrayType);
 
     Label fail;
     if (lir->index()->isConstant()) {
-        Address source(elements, ToInt32(lir->index()) * shift);
+        Address source(elements, ToInt32(lir->index()) * width);
         masm.loadFromTypedArray(arrayType, source, out, temp, &fail);
     } else {
-        BaseIndex source(elements, ToRegister(lir->index()), ScaleFromShift(shift));
+        BaseIndex source(elements, ToRegister(lir->index()), ScaleFromElemWidth(width));
         masm.loadFromTypedArray(arrayType, source, out, temp, &fail);
     }
 
     if (fail.used() && !bailoutFrom(&fail, lir->snapshot()))
         return false;
 
     return true;
 }
@@ -4463,24 +4463,24 @@ CodeGenerator::visitLoadTypedArrayElemen
 
     // OOL path if index >= length.
     masm.branchKey(Assembler::BelowOrEqual, scratch, key, ool->entry());
 
     // Load the elements vector.
     masm.loadPtr(Address(object, TypedArray::dataOffset()), scratch);
 
     int arrayType = lir->mir()->arrayType();
-    int shift = TypedArray::slotWidth(arrayType);
+    int width = TypedArray::slotWidth(arrayType);
 
     Label fail;
     if (key.isConstant()) {
-        Address source(scratch, key.constant() * shift);
+        Address source(scratch, key.constant() * width);
         masm.loadFromTypedArray(arrayType, source, out, lir->mir()->allowDouble(), &fail);
     } else {
-        BaseIndex source(scratch, key.reg(), ScaleFromShift(shift));
+        BaseIndex source(scratch, key.reg(), ScaleFromElemWidth(width));
         masm.loadFromTypedArray(arrayType, source, out, lir->mir()->allowDouble(), &fail);
     }
 
     if (fail.used() && !bailoutFrom(&fail, lir->snapshot()))
         return false;
 
     masm.bind(ool->rejoin());
     return true;
@@ -4530,23 +4530,23 @@ StoreToTypedArray(MacroAssembler &masm, 
 
 bool
 CodeGenerator::visitStoreTypedArrayElement(LStoreTypedArrayElement *lir)
 {
     Register elements = ToRegister(lir->elements());
     const LAllocation *value = lir->value();
 
     int arrayType = lir->mir()->arrayType();
-    int shift = TypedArray::slotWidth(arrayType);
+    int width = TypedArray::slotWidth(arrayType);
 
     if (lir->index()->isConstant()) {
-        Address dest(elements, ToInt32(lir->index()) * shift);
+        Address dest(elements, ToInt32(lir->index()) * width);
         StoreToTypedArray(masm, arrayType, value, dest);
     } else {
-        BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromShift(shift));
+        BaseIndex dest(elements, ToRegister(lir->index()), ScaleFromElemWidth(width));
         StoreToTypedArray(masm, arrayType, value, dest);
     }
 
     return true;
 }
 
 bool
 CodeGenerator::visitClampIToUint8(LClampIToUint8 *lir)
--- a/js/src/ion/shared/Assembler-shared.h
+++ b/js/src/ion/shared/Assembler-shared.h
@@ -26,17 +26,17 @@ namespace ion {
 enum Scale {
     TimesOne,
     TimesTwo,
     TimesFour,
     TimesEight
 };
 
 static inline Scale
-ScaleFromShift(int shift)
+ScaleFromElemWidth(int shift)
 {
     switch (shift) {
       case 1:
         return TimesOne;
       case 2:
         return TimesTwo;
       case 4:
         return TimesFour;