mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Enable CALLNAME and add test case for it so we can call global functions.
This commit is contained in:
parent
fe50e4724a
commit
7f119dc35a
@ -1973,7 +1973,23 @@ bool TraceRecorder::record_JSOP_SETELEM()
|
||||
|
||||
bool TraceRecorder::record_JSOP_CALLNAME()
|
||||
{
|
||||
return false;
|
||||
JSObject* obj = cx->fp->scopeChain;
|
||||
if (obj != globalObj)
|
||||
return false;
|
||||
|
||||
LIns* obj_ins = lir->insLoadi(lir->insLoadi(cx_ins, offsetof(JSContext, fp)),
|
||||
offsetof(JSStackFrame, scopeChain));
|
||||
JSObject* obj2;
|
||||
JSPropCacheEntry* entry;
|
||||
if (!test_property_cache(obj, obj_ins, obj2, entry))
|
||||
ABORT_TRACE("missed prop");
|
||||
|
||||
if (!PCVAL_IS_OBJECT(entry->vword))
|
||||
ABORT_TRACE("PCE not object");
|
||||
|
||||
stack(0, lir->insImmPtr(PCVAL_TO_OBJECT(entry->vword)));
|
||||
stack(1, obj_ins);
|
||||
return true;
|
||||
}
|
||||
|
||||
JSBool
|
||||
|
@ -211,9 +211,12 @@ function mod()
|
||||
}
|
||||
test("mod", mod(), "4.5,0,42,4,NaN");
|
||||
|
||||
function global_func() {
|
||||
return 1;
|
||||
}
|
||||
function call()
|
||||
{
|
||||
var q1 = 0, q2 = 0;
|
||||
var q1 = 0, q2 = 0, q3 = 0;
|
||||
function f1() {
|
||||
return 1;
|
||||
}
|
||||
@ -223,8 +226,9 @@ function call()
|
||||
for (var i = 0; i < 100; ++i) {
|
||||
q1 += f1();
|
||||
q2 += f2(f1);
|
||||
q3 += global_func();
|
||||
}
|
||||
var ret = [q1, q2];
|
||||
var ret = [q1, q2, q3];
|
||||
return ret;
|
||||
}
|
||||
test("call", call(), "100,100");
|
||||
test("call", call(), "100,100,100");
|
||||
|
Loading…
Reference in New Issue
Block a user