Bug 909401 - Fix MacroAssembler::tagValue on x86/ARM to not assert if the input register is the same as the output type register. r=nbp

This commit is contained in:
Jan de Mooij 2013-08-29 17:39:22 +02:00
parent d27b75e764
commit 34ce868e22
3 changed files with 30 additions and 4 deletions

View File

@ -0,0 +1,26 @@
var TZ_PST = -8;
var TZ_DIFF = GetTimezoneOffset();
var PST_DIFF = TZ_DIFF - TZ_PST;
function GetTimezoneOffset() {}
function adjustResultArray(ResultArray) {
var t = ResultArray[TIME] - PST_DIFF;
ResultArray[UTC_YEAR] = YearFromTime(t);
}
function TimeInYear( y ) {}
function YearFromTime( t ) {
var sign = ( t < 0 ) ? -1 : 1;
var year = ( sign < 0 ) ? 1969 : 1970;
for ( var timeToTimeZero = t; ; ) {
timeToTimeZero -= sign * TimeInYear(year)
break;
}
return ( year );
}
gczeal(4);
evaluate("\
var TIME = 0;\
var UTC_YEAR = 1;\
adjustResultArray([]);\
adjustResultArray([946684800000-1]);\
adjustResultArray([]);\
", { noScriptRval : true });

View File

@ -2860,10 +2860,10 @@ MacroAssemblerARMCompat::loadValue(Address src, ValueOperand val)
void
MacroAssemblerARMCompat::tagValue(JSValueType type, Register payload, ValueOperand dest)
{
JS_ASSERT(payload != dest.typeReg());
ma_mov(ImmType(type), dest.typeReg());
JS_ASSERT(dest.typeReg() != dest.payloadReg());
if (payload != dest.payloadReg())
ma_mov(payload, dest.payloadReg());
ma_mov(ImmType(type), dest.typeReg());
}
void

View File

@ -175,10 +175,10 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
loadValue(Operand(src), val);
}
void tagValue(JSValueType type, Register payload, ValueOperand dest) {
JS_ASSERT(payload != dest.typeReg());
movl(ImmType(type), dest.typeReg());
JS_ASSERT(dest.typeReg() != dest.payloadReg());
if (payload != dest.payloadReg())
movl(payload, dest.payloadReg());
movl(ImmType(type), dest.typeReg());
}
void pushValue(ValueOperand val) {
push(val.typeReg());