|
@ -1885,6 +1885,12 @@ void duk_handle_ecma_call_setup(duk_hthread *thr, |
|
|
DUK_DDD(DUK_DDDPRINT("tailcall disabled because 'caller' property enabled and target is non-strict")); |
|
|
DUK_DDD(DUK_DDDPRINT("tailcall disabled because 'caller' property enabled and target is non-strict")); |
|
|
DUK_ASSERT(use_tailcall == 0); /* compiler ensures this */ |
|
|
DUK_ASSERT(use_tailcall == 0); /* compiler ensures this */ |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
act = thr->callstack + thr->callstack_top - 1; |
|
|
|
|
|
if (act->flags & DUK_ACT_FLAG_PREVENT_YIELD) { |
|
|
|
|
|
/* See: ecmascript-testcases/test-bug-tailcall-thread-yield-resume.js */ |
|
|
|
|
|
DUK_DDD(DUK_DDDPRINT("tailcall prevented by current activation having DUK_ACT_FLAG_PREVENTYIELD")); |
|
|
|
|
|
use_tailcall = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (use_tailcall) { |
|
|
if (use_tailcall) { |
|
|
duk_tval *tv1, *tv2; |
|
|
duk_tval *tv1, *tv2; |
|
@ -1905,8 +1911,7 @@ void duk_handle_ecma_call_setup(duk_hthread *thr, |
|
|
DUK_DDD(DUK_DDDPRINT("is tailcall, reusing activation at callstack top, at index %d", |
|
|
DUK_DDD(DUK_DDDPRINT("is tailcall, reusing activation at callstack top, at index %d", |
|
|
thr->callstack_top - 1)); |
|
|
thr->callstack_top - 1)); |
|
|
|
|
|
|
|
|
act = thr->callstack + thr->callstack_top - 1; |
|
|
/* 'act' already set above */ |
|
|
DUK_UNREF(act); /* unreferenced unless assertions used */ |
|
|
|
|
|
|
|
|
|
|
|
DUK_ASSERT(!DUK_HOBJECT_HAS_BOUND(func)); |
|
|
DUK_ASSERT(!DUK_HOBJECT_HAS_BOUND(func)); |
|
|
DUK_ASSERT(!DUK_HOBJECT_HAS_NATIVEFUNCTION(func)); |
|
|
DUK_ASSERT(!DUK_HOBJECT_HAS_NATIVEFUNCTION(func)); |
|
|