Go to file
mstarzinger@chromium.org d71678676f Refactor parser mode configuration for correctness
This patch refactors the parser and preparser interface to be more
readable and type-safe.  It has no behavior changes.

Previously, parsers and preparsers were configured via bitfield called
parser_flags in the Parser constructor, and flags in
PreParser::PreParseProgram, ParserApi::Parse, and ParserApi::PreParse.
This was error-prone in practice: six call sites passed incorrectly
typed values to this interface (a boolean FLAG value, a boolean false
and a boolean true value).  None of these errors were caught by the
compiler because it's just an "int".

The parser flags interface was also awkward because it encoded a
language mode, but the language mode was only used to turn on harmony
scoping or not -- it wasn't used to actually set the parser's language
mode.

Fundamentally these errors came in because of the desire for a
procedural parser interface, in ParserApi.  Because we need to be able
to configure the parser in various ways, the flags argument got added;
but no one understood how to use the flags properly.  Also they were
only used by constructors: callers packed bits, and the constructors
unpacked them into booleans on the parser or preparser.

The solution is to allow parser construction, configuration, and
invocation to be separated.  This patch does that.

It passes the existing tests.

BUG=

Review URL: https://codereview.chromium.org/13450007
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14151 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-05 13:01:06 +00:00
benchmarks More fixes for V8 benchmark version 7. 2012-03-15 17:13:50 +00:00
build Disable zapping of global handles in release mode. 2013-03-21 14:18:16 +00:00
include Pass an isolate to GetCurrent() 2013-04-05 02:17:56 +00:00
preparser Fix a bunch of implicit casts detected by the Win64 compiler 2012-06-19 13:45:30 +00:00
samples Added a version of the v8::HandleScope constructor with an Isolate and use that consistently. 2013-03-15 12:06:53 +00:00
src Refactor parser mode configuration for correctness 2013-04-05 13:01:06 +00:00
test Refactor parser mode configuration for correctness 2013-04-05 13:01:06 +00:00
tools First steps towards implementing ArrayBuffer &co in V8 2013-03-28 12:50:18 +00:00
.gitignore git should ignore .d8_history (d8 readline history) 2012-11-13 21:43:38 +00:00
AUTHORS Maintain API compatibility with older versions of V8. 2013-03-21 14:42:17 +00:00
ChangeLog Prepare push to trunk. Now working on version 3.17.17. 2013-04-04 11:37:01 +00:00
DEPS Pull more recent gyp. 2012-09-26 09:12:45 +00:00
LICENSE Update LICENSE file 2012-01-03 16:38:42 +00:00
LICENSE.strongtalk Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.v8 Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.valgrind Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
Makefile MIPS: Add android build support for mips in gyp. 2013-02-25 16:39:03 +00:00
Makefile.android MIPS: Add android build support for mips in gyp. 2013-02-25 16:39:03 +00:00
OWNERS Added Hannes and Dmitry to OWNERS 2013-03-21 12:09:53 +00:00
PRESUBMIT.py Add PRESUBMIT script to V8 2012-10-08 13:49:57 +00:00
SConstruct Remove support for Live Object List and inspector module. 2013-01-16 15:44:26 +00:00