Comment #2 on issue 2054 by [email protected]: Fatal error in src\hydrogen.cc, line 4543
http://code.google.com/p/v8/issues/detail?id=2054

We rewrite the AST for top level code in a way that preserves the result of the last instruction in a fake variable. This leads to an illegal AST that Crankshaft can't handle if the last instruction happens to be a throw. This was amplified by a recent change where we optimize global code earlier due to our new profiler. Fix is on the way.

. . . BLOCK
. . . . IF
. . . . . EQ_STRICT
. . . . . . VAR PROXY (mode = DYNAMIC_GLOBAL) "a"
. . . . . . VAR PROXY (mode = DYNAMIC_GLOBAL) "b"
. . . . THEN
. . . . . BLOCK
. . . . . . ASSIGN
. . . . . . . VAR PROXY local[0] (mode = TEMPORARY) ".result"
. . . . . . . THROW
. . . . . . . . CALL NEW
. . . . . . . . . VAR PROXY (mode = DYNAMIC_GLOBAL) "Error"

Just for the record. The same applies if the last instruction happens to be a return statement, which is illegal according to ECMAScript and will be rewritten into an implicit throw.

. . . BLOCK
. . . . IF
. . . . . EQ_STRICT
. . . . . . VAR PROXY (mode = DYNAMIC_GLOBAL) "a"
. . . . . . VAR PROXY (mode = DYNAMIC_GLOBAL) "b"
. . . . THEN
. . . . . BLOCK
. . . . . . ASSIGN
. . . . . . . VAR PROXY local[0] (mode = TEMPORARY) ".result"
. . . . . . . THROW
. . . . . . . . CALL RUNTIME  MakeSyntaxError
. . . . . . . . . LITERAL "illegal_return"
. . . . . . . . . LITERAL JS-array[0]

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

Reply via email to