[Webkit-unassigned] [Bug 18518] Implement eval in SquirrelFish

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 16 14:42:24 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=18518





------- Comment #6 from ggaren at apple.com  2008-04-16 14:42 PDT -------
(From update of attachment 20588)
I haven't figured out the exact cause of the crash, but here are some
preliminary comments on the patch:

+{
+    m_locals.resize(1);
+    addVar(m_propertyNames->thisIdentifier);
+}

There's no need to explicitly resize m_locals unless you want to place locals
at arbitrary indices in m_locals, like addParameter does. Since you're just
using addVar, which appends to m_locals, you can leave the resize call out.

+JSValue* Machine::execute(EvalNode* evalNode, ExecState* exec,
RegisterFileStack* registerFileStack, ScopeChainNode* scopeChain, JSValue**
exception)
+{
+    RegisterFile* registerFile = registerFileStack->pushRegisterFile();
+

pushRegisterFile is a heavy-weight operation meant to enable declaration of new
global symbols during re-entrant evaluation of global code. Eval doesn't
declare any symbols, and it isn't guaranteed to execute in global scope,
either, so it shouldn't use pushRegisterFile. It should just move "r", like a
function call does, to create a new register frame.

Be sure to shrink the register file to its old size before returning.
Otherwise, repeated calls to eval will cause the register file to grow without
bound. (Maciej just fixed a similar bug for function calls.)

There sure is a lot of duplicated code between op_call and op_eval. I hope we
can figure out how to eliminate that duplication, or at least move the
duplicated code into a shared ALWAYS_INLINE or template function.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list