LGTM, except please call JSFunction::ReplaceCode to replace the code.


http://codereview.chromium.org/6524039/diff/2001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6524039/diff/2001/src/runtime.cc#newcode7172
src/runtime.cc:7172: if (CompileOptimized(function, ast_id,
CLEAR_EXCEPTION) &&
That would be good to do, but it's blocked on a refactoring of the
Hydrogren graph construction that would allow us to do that.

http://codereview.chromium.org/6524039/diff/2001/src/runtime.cc#newcode7218
src/runtime.cc:7218: }
On the other hand, we don't really care about optimizing compilation
time for programs that have a long running loop in a function that calls
a function with a (compile-time) syntax error.

Isn't the most reasonable thing we could do is to catch those errors
even earlier, as if we didn't lazily compile those functions?

In any case, please don't call JSFunction::set_code directly here.  Call
JSFunction::ReplaceCode.

http://codereview.chromium.org/6524039/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to