Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Issue 6524039: Make exception be ignored when trying to optimize. (Closed)

Created:
9 years, 10 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Handle exceptions thrown while parsing lazy functions for inlining. We currently leave the exception as pending without returning a Failure::Exception() value. This is either caught immediately if running with --debug-code, or caught later by an assert in debug mode. This change makes the pending exception be cleared before returning from the failed optimization attempt. BUG=v8::1145 TEST=test/mjsunit/regress/regress-1145.js Committed: http://code.google.com/p/v8/source/detail?r=6832

Patch Set 1 #

Patch Set 2 : Unmark function for lazy recompilation if it fails. #

Total comments: 5

Patch Set 3 : Changing set_code to ReplaceCode. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -5 lines) Patch
M src/handles.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/handles.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M src/runtime.cc View 1 2 3 chunks +6 lines, -2 lines 0 comments Download
A test/mjsunit/regress/regress-1145.js View 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
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) && The exception is thrown ...
9 years, 10 months ago (2011-02-16 19:06:08 UTC) #1
Kevin Millikin (Chromium)
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: ...
9 years, 10 months ago (2011-02-17 11:02:34 UTC) #2
Lasse Reichstein
9 years, 10 months ago (2011-02-17 11:44:59 UTC) #3
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#newcode7218
src/runtime.cc:7218: }
It *would* be better to catch those syntax errors earlier, and it might not be a
breaking change since both Webkit Nightlies and Firefox 4.0 betas are already
doing it.

With the current preparsing there are syntax errors that we cannot catch at
preparse-time (e.g., "continue x" where x isn't the label of a loop, because we
record neither labels nor loops during preparsing). We can't catch those until
the function is parsed properly the first time, and if it's lazy, that might be
when it's attempted inlined.

Another option is to make uncompiled functions not optimizable. Currently when
we check if we can optimize a function, if it's uncompiled we optimistically
assume that it is.

Changed to using ReplaceCode.

Powered by Google App Engine
This is Rietveld 408576698