Reviewers: Kevin Millikin,
Message:
Hi Kevin,
here's some experimental preliminary code from my trials to add block
scoping.
This code should only add block scopes and block contexts without
considering
any let declarations. I tried to follow existing code for 'with'
and 'catch' and
make the change as small as possible.
Here's some guidance around the CL:
* ParseStatement calls a new function ParseScopedBlock instead of ParseBlock
which adds a new block scope to the scope tree. All other calls of
ParseBlock
remain the same.
* In each block scope a single variable '+block' is declared.
* Like (so far) for catch variables the variable allocation should always
context allocate the variable in the block scope.
* The block context has a serialized scope info from the block scope in the
extension slot.
I'm kinda stuck in getting this to work. The code always crashes with
# Fatal error in [...]/v8/src/objects.cc, line 154
# CHECK(holder != __null) failed
Please take a look. Maybe you find something I'm missing.
Thanks!
-- Steven
Description:
Preliminary code for block scopes and block contexts.
BUG=
TEST=
Please review this at http://codereview.chromium.org/7549008/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/ast-inl.h
M src/ast.h
M src/compiler.cc
M src/contexts.h
M src/factory.h
M src/factory.cc
M src/flag-definitions.h
M src/full-codegen.cc
M src/heap.h
M src/heap.cc
M src/hydrogen.cc
M src/objects-inl.h
M src/parser.h
M src/parser.cc
M src/runtime.h
M src/runtime.cc
M src/scopeinfo.h
M src/scopes.h
M src/scopes.cc
M src/variables.h
M test/mjsunit/fuzz-natives.js
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev