From 0751d10c4f57edf8cb48c9518333a384dd195a30 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 15 Oct 2009 16:02:59 -0700 Subject: [PATCH] Bug 522413 - remove uses of static avmcore::config, r=gal. --- js/src/jstracer.cpp | 13 +++++++------ js/src/nanojit/LIR.cpp | 10 +++++----- js/src/nanojit/LIR.h | 2 +- js/src/nanojit/Nativei386.h | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 5eef4f86287..7514a89bfa6 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -9484,7 +9484,7 @@ TraceRecorder::getThis(LIns*& this_ins) */ this_ins = lir->ins_choose(lir->ins_peq0(stobj_get_parent(this_ins)), INS_CONSTOBJ(wrappedGlobal), - this_ins); + this_ins, avmplus::AvmCore::use_cmov()); return RECORD_CONTINUE; } @@ -9509,7 +9509,8 @@ TraceRecorder::getStringLength(LIns* str_ins) lir->ins2(LIR_piand, len_ins, INS_CONSTWORD(JSString::DEPENDENT_LENGTH_MASK)), - masked_len_ins)); + masked_len_ins, avmplus::AvmCore::use_cmov()), + avmplus::AvmCore::use_cmov()); return p2i(real_len); } @@ -10633,7 +10634,7 @@ TraceRecorder::callNative(uintN argc, JSOp mode) lir->ins_choose(lir->ins2((native == js_math_min) ? LIR_lt : LIR_gt, a, b), - a, b))); + a, b, avmplus::AvmCore::use_cmov()))); pendingSpecializedNative = IGNORE_NATIVE_CALL_COMPLETE_CALLBACK; return RECORD_CONTINUE; } @@ -10714,7 +10715,7 @@ TraceRecorder::callNative(uintN argc, JSOp mode) this_ins = lir->ins_choose(lir->ins_peq0(stobj_get_parent(this_ins)), INS_CONSTOBJ(globalObj), - this_ins); + this_ins, avmplus::AvmCore::use_cmov()); } } this_ins = box_jsval(vp[1], this_ins); @@ -12273,8 +12274,8 @@ TraceRecorder::record_NativeCallComplete() v_ins = lir->insLoad(LIR_ldp, native_rval_ins, 0); if (*pc == JSOP_NEW) { LIns* x = lir->ins_peq0(lir->ins2(LIR_piand, v_ins, INS_CONSTWORD(JSVAL_TAGMASK))); - x = lir->ins_choose(x, v_ins, INS_CONSTWORD(0)); - v_ins = lir->ins_choose(lir->ins_peq0(x), newobj_ins, x); + x = lir->ins_choose(x, v_ins, INS_CONSTWORD(0), avmplus::AvmCore::use_cmov()); + v_ins = lir->ins_choose(lir->ins_peq0(x), newobj_ins, x, avmplus::AvmCore::use_cmov()); } set(&v, v_ins); diff --git a/js/src/nanojit/LIR.cpp b/js/src/nanojit/LIR.cpp index 64b35efe5f0..d7f39971b0b 100644 --- a/js/src/nanojit/LIR.cpp +++ b/js/src/nanojit/LIR.cpp @@ -891,7 +891,7 @@ namespace nanojit #endif } - LIns* LirWriter::ins_choose(LIns* cond, LIns* iftrue, LIns* iffalse) + LIns* LirWriter::ins_choose(LIns* cond, LIns* iftrue, LIns* iffalse, bool use_cmov) { // if not a conditional, make it implicitly an ==0 test (then flop results) if (!cond->isCmp()) @@ -902,7 +902,7 @@ namespace nanojit iffalse = tmp; } - if (avmplus::AvmCore::use_cmov()) + if (use_cmov) return ins3((iftrue->isQuad() || iffalse->isQuad()) ? LIR_qcmov : LIR_cmov, cond, iftrue, iffalse); LInsp ncond = ins1(LIR_neg, cond); // cond ? -1 : 0 @@ -925,10 +925,10 @@ namespace nanojit ArgSize sizes[MAXARGS]; int32_t argc = ci->get_sizes(sizes); - if (AvmCore::config.soft_float) { - if (op == LIR_fcall) +#ifdef NJ_SOFTFLOAT + if (!ARM_VFP && (op == LIR_fcall || op == LIR_qcall)) op = LIR_callh; - } +#endif NanoAssert(argc <= (int)MAXARGS); diff --git a/js/src/nanojit/LIR.h b/js/src/nanojit/LIR.h index 05be2589227..dbf8b423beb 100644 --- a/js/src/nanojit/LIR.h +++ b/js/src/nanojit/LIR.h @@ -1081,7 +1081,7 @@ namespace nanojit // Inserts a conditional to execute and branches to execute if // the condition is true and false respectively. - LIns* ins_choose(LIns* cond, LIns* iftrue, LIns* iffalse); + LIns* ins_choose(LIns* cond, LIns* iftrue, LIns* iffalse, bool use_cmov); // Inserts an integer comparison to 0 LIns* ins_eq0(LIns* oprnd1); // Inserts a pointer comparison to 0 diff --git a/js/src/nanojit/Nativei386.h b/js/src/nanojit/Nativei386.h index 1da9839b17b..274a1ba4f1b 100644 --- a/js/src/nanojit/Nativei386.h +++ b/js/src/nanojit/Nativei386.h @@ -152,7 +152,7 @@ namespace nanojit static const RegisterMask AllowableFlagRegs = 1<