Use fast lambda calls in scope facade

This commit is contained in:
sergeych committed 2026-04-21 16:43:02 +03:00
1 parent 3721ee8332
commit 6c91b77a85
2 files changed
+23

No files matched your search

@@ -66,6 +66,9 @@ internal class ScopeBridge(internal val scope: Scope) : ScopeFacade {
override fun raiseIllegalState(message: String): Nothing = scope.raiseIllegalState(message)
override fun raiseNotImplemented(what: String): Nothing = scope.raiseNotImplemented(what)
override suspend fun call(callee: Obj, args: Arguments, newThisObj: Obj?): Obj {
if (newThisObj == null) {
(callee as? BytecodeArgCallable)?.callWithArgsFast(scope, args)?.let { return it }
}
val child = scope.createChildScope(scope.pos, args = args, newThisObj = newThisObj)
return (callee as? BytecodeCallable)?.callOnFast(child) ?: callee.callOn(child)
}