зеркало из https://github.com/mozilla/gecko-dev.git
Bug 613692. Make sure to update what our current value is when doing type conversions inside incHelper. r=dvander
This commit is contained in:
Родитель
2c8e377686
Коммит
298705e64c
|
@ -0,0 +1,15 @@
|
|||
function f() {
|
||||
for (var i = 0; i < 2*RUNLOOP; ++i) {
|
||||
var n = undefined;
|
||||
if (n++) { }
|
||||
}
|
||||
}
|
||||
|
||||
f();
|
||||
|
||||
checkStats({
|
||||
recorderStarted: 1,
|
||||
recorderAborted: 0,
|
||||
traceCompleted: 1,
|
||||
traceTriggered: 1
|
||||
});
|
|
@ -8681,16 +8681,20 @@ TraceRecorder::inc(const Value &v, LIns*& v_ins, jsint incr, bool pre)
|
|||
* Do an increment operation without storing anything to the stack.
|
||||
*/
|
||||
JS_REQUIRES_STACK RecordingStatus
|
||||
TraceRecorder::incHelper(const Value &v, LIns* v_ins, LIns*& v_after, jsint incr)
|
||||
TraceRecorder::incHelper(const Value &v, LIns*& v_ins, LIns*& v_after, jsint incr)
|
||||
{
|
||||
// FIXME: Bug 606071 on making this work for objects.
|
||||
if (!v.isPrimitive())
|
||||
RETURN_STOP("can inc primitives only");
|
||||
|
||||
// We need to modify |v_ins| the same way relational() modifies
|
||||
// its RHS and LHS.
|
||||
if (v.isUndefined()) {
|
||||
v_after = w.immd(js_NaN);
|
||||
v_ins = w.immd(js_NaN);
|
||||
} else if (v.isNull()) {
|
||||
v_after = w.immd(incr);
|
||||
v_ins = w.immd(0.0);
|
||||
} else {
|
||||
if (v.isBoolean()) {
|
||||
v_ins = w.i2d(v_ins);
|
||||
|
|
|
@ -1294,7 +1294,7 @@ class TraceRecorder
|
|||
JS_REQUIRES_STACK RecordingStatus inc(Value& v, jsint incr, bool pre = true);
|
||||
JS_REQUIRES_STACK RecordingStatus inc(const Value &v, nanojit::LIns*& v_ins, jsint incr,
|
||||
bool pre = true);
|
||||
JS_REQUIRES_STACK RecordingStatus incHelper(const Value &v, nanojit::LIns* v_ins,
|
||||
JS_REQUIRES_STACK RecordingStatus incHelper(const Value &v, nanojit::LIns*& v_ins,
|
||||
nanojit::LIns*& v_after, jsint incr);
|
||||
JS_REQUIRES_STACK AbortableRecordingStatus incProp(jsint incr, bool pre = true);
|
||||
JS_REQUIRES_STACK RecordingStatus incElem(jsint incr, bool pre = true);
|
||||
|
|
Загрузка…
Ссылка в новой задаче