mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Backed out 2 changesets for linux x86 bustage on a CLOSED TREE (bug 966957)
Backed out changeset dfb2e4c12bc0 (bug 966957) Backed out changeset d983a44ff5b8 (bug 966957) --HG-- extra : rebase_source : 99605acf06a8c5a32b12213eb64f14e8cc679cae
This commit is contained in:
parent
a58a2ef3e5
commit
09b21959a2
@ -229,22 +229,3 @@ function testFloorDouble() {
|
||||
}
|
||||
test(setupFloor, testFloor);
|
||||
test(setupFloorDouble, testFloorDouble);
|
||||
|
||||
function setupTestToString() {
|
||||
setupFloor();
|
||||
setupFloorDouble();
|
||||
f32[8] = 4 / 3;
|
||||
f32[9] = 4;
|
||||
}
|
||||
function testToString() {
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
var f = f32[i];
|
||||
var str = f + '';
|
||||
assertFloat32(f, true);
|
||||
|
||||
assertEq(str, (f + -0) + '');
|
||||
if (f !== -0) // -0 + '' === 0
|
||||
assertEq(parseFloat(str), f);
|
||||
}
|
||||
}
|
||||
test(setupFloorDouble, testToString);
|
||||
|
@ -776,32 +776,6 @@ CodeGenerator::visitDoubleToString(LDoubleToString *lir)
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef JSString *(*FloatToStringFn)(ThreadSafeContext *, float);
|
||||
typedef JSString *(*FloatToStringParFn)(ForkJoinContext *, float);
|
||||
static const VMFunctionsModal FloatToStringInfo = VMFunctionsModal(
|
||||
FunctionInfo<FloatToStringFn>(FloatToString),
|
||||
FunctionInfo<FloatToStringParFn>(FloatToStringPar));
|
||||
|
||||
bool
|
||||
CodeGenerator::visitFloatToString(LFloatToString *lir)
|
||||
{
|
||||
FloatRegister input = ToFloatRegister(lir->input());
|
||||
Register temp = ToRegister(lir->tempInt());
|
||||
Register output = ToRegister(lir->output());
|
||||
|
||||
OutOfLineCode *ool = oolCallVM(FloatToStringInfo, lir, (ArgList(), input),
|
||||
StoreRegisterTo(output));
|
||||
if (!ool)
|
||||
return false;
|
||||
|
||||
// Try float to integer conversion and run integer to string code.
|
||||
masm.convertFloat32ToInt32(input, temp, ool->entry(), /* negativeCheck = */ true);
|
||||
emitIntToString(temp, output, ool->entry());
|
||||
|
||||
masm.bind(ool->rejoin());
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef JSString *(*PrimitiveToStringFn)(JSContext *, HandleValue);
|
||||
typedef JSString *(*PrimitiveToStringParFn)(ForkJoinContext *, HandleValue);
|
||||
static const VMFunctionsModal PrimitiveToStringInfo = VMFunctionsModal(
|
||||
|
@ -91,7 +91,6 @@ class CodeGenerator : public CodeGeneratorSpecific
|
||||
void emitIntToString(Register input, Register output, Label *ool);
|
||||
bool visitIntToString(LIntToString *lir);
|
||||
bool visitDoubleToString(LDoubleToString *lir);
|
||||
bool visitFloatToString(LFloatToString *lir);
|
||||
bool visitPrimitiveToString(LPrimitiveToString *lir);
|
||||
bool visitInteger(LInteger *lir);
|
||||
bool visitRegExp(LRegExp *lir);
|
||||
|
@ -3739,8 +3739,11 @@ IonBuilder::jsop_binary(JSOp op, MDefinition *left, MDefinition *right)
|
||||
if (op == JSOP_ADD &&
|
||||
((left->type() == MIRType_String &&
|
||||
(right->type() == MIRType_String ||
|
||||
IsNumberType(right->type()))) ||
|
||||
(IsNumberType(left->type()) &&
|
||||
right->type() == MIRType_Int32 ||
|
||||
right->type() == MIRType_Double)) ||
|
||||
(left->type() == MIRType_Int32 &&
|
||||
right->type() == MIRType_String) ||
|
||||
(left->type() == MIRType_Double &&
|
||||
right->type() == MIRType_String)))
|
||||
{
|
||||
MConcat *ins = MConcat::New(alloc(), left, right);
|
||||
|
@ -3146,25 +3146,6 @@ class LDoubleToString : public LInstructionHelper<1, 1, 1>
|
||||
}
|
||||
};
|
||||
|
||||
// Convert a float32 hosted on one definition to a string with a function call.
|
||||
class LFloatToString : public LInstructionHelper<1, 1, 1>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(FloatToString)
|
||||
|
||||
LFloatToString(const LAllocation &input, const LDefinition &temp) {
|
||||
setOperand(0, input);
|
||||
setTemp(0, temp);
|
||||
}
|
||||
|
||||
const LDefinition *tempInt() {
|
||||
return getTemp(0);
|
||||
}
|
||||
const MToString *mir() {
|
||||
return mir_->toToString();
|
||||
}
|
||||
};
|
||||
|
||||
// Convert a primitive to a string with a function call.
|
||||
class LPrimitiveToString : public LInstructionHelper<1, BOX_PIECES, 1>
|
||||
{
|
||||
|
@ -145,7 +145,6 @@
|
||||
_(BooleanToString) \
|
||||
_(IntToString) \
|
||||
_(DoubleToString) \
|
||||
_(FloatToString) \
|
||||
_(PrimitiveToString) \
|
||||
_(Start) \
|
||||
_(OsrEntry) \
|
||||
|
@ -1862,14 +1862,6 @@ LIRGenerator::visitToString(MToString *ins)
|
||||
return assignSafepoint(lir, ins);
|
||||
}
|
||||
|
||||
case MIRType_Float32: {
|
||||
LFloatToString *lir = new(alloc()) LFloatToString(useRegister(opd), temp());
|
||||
|
||||
if (!define(lir, ins))
|
||||
return false;
|
||||
return assignSafepoint(lir, ins);
|
||||
}
|
||||
|
||||
case MIRType_Int32: {
|
||||
LIntToString *lir = new(alloc()) LIntToString(useRegister(opd));
|
||||
|
||||
|
@ -3147,7 +3147,6 @@ class MToString : public MUnaryInstruction
|
||||
JS_ASSERT(!input()->mightBeType(MIRType_Object));
|
||||
return AliasSet::None();
|
||||
}
|
||||
bool canConsumeFloat32() const { return true; }
|
||||
};
|
||||
|
||||
class MBitNot
|
||||
|
@ -663,9 +663,3 @@ jit::InitRestParameterPar(ForkJoinContext *cx, uint32_t length, Value *rest,
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
JSString *
|
||||
js::jit::FloatToStringPar(ForkJoinContext *cx, float f)
|
||||
{
|
||||
return NumberToString<NoGC>(cx, double(f));
|
||||
}
|
||||
|
@ -78,8 +78,6 @@ void TraceLIR(IonLIRTraceData *current);
|
||||
|
||||
void CallToUncompiledScriptPar(JSObject *obj);
|
||||
|
||||
JSString *FloatToStringPar(ForkJoinContext *cx, float f);
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
||||
|
@ -420,6 +420,9 @@ ConvertToStringPolicy<Op>::staticAdjustInputs(TempAllocator &alloc, MInstruction
|
||||
|
||||
replace = MUnbox::New(alloc, in, MIRType_String, MUnbox::Fallible);
|
||||
} else {
|
||||
// TODO remove these two lines once 966957 has landed
|
||||
EnsureOperandNotFloat32(alloc, ins, Op);
|
||||
in = ins->getOperand(Op);
|
||||
replace = MToString::New(alloc, in);
|
||||
}
|
||||
|
||||
|
@ -970,12 +970,6 @@ StringReplace(JSContext *cx, HandleString string, HandleString pattern, HandleSt
|
||||
return rval.toString();
|
||||
}
|
||||
|
||||
JSString *
|
||||
FloatToString(ThreadSafeContext *cx, float f)
|
||||
{
|
||||
return NumberToString<CanGC>(cx, double(f));
|
||||
}
|
||||
|
||||
bool
|
||||
Recompile(JSContext *cx)
|
||||
{
|
||||
|
@ -668,8 +668,6 @@ JSString *RegExpReplace(JSContext *cx, HandleString string, HandleObject regexp,
|
||||
JSString *StringReplace(JSContext *cx, HandleString string, HandleString pattern,
|
||||
HandleString repl);
|
||||
|
||||
JSString *FloatToString(ThreadSafeContext *cx, float f);
|
||||
|
||||
#ifdef DEBUG
|
||||
void AssertValidObjectPtr(JSContext *cx, JSObject *obj);
|
||||
void AssertValidStringPtr(JSContext *cx, JSString *str);
|
||||
|
Loading…
Reference in New Issue
Block a user