Split the AST LoopStatement type into separate types for do/while,
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Oct 2009 13:14:06 +0000 (13:14 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Oct 2009 13:14:06 +0000 (13:14 +0000)
commit586f94f292e4c8e5e0e46ab6073c9b64c5482005
treec55d8732324f41a9b7b15c2d44d989552f8d9b1f
parentc67291155b67f4a44ced28f144ed14360dc3e283
Split the AST LoopStatement type into separate types for do/while,
while, and for loops.

Previously they were distinguished by a type field, which required
runtime asserts to avoid invalid nodes (since not all loop types have
the same internal structure).  Now they C++ type system is used to
require well-formed loop ASTs.

Because they do not share compilation code, we had very large
functions in the code generators that merely did a runtime dispatch to
a specific implementation based on the type.
Review URL: http://codereview.chromium.org/269049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3048 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
14 files changed:
src/arm/codegen-arm.cc
src/arm/codegen-arm.h
src/ast.cc
src/ast.h
src/codegen.cc
src/codegen.h
src/ia32/codegen-ia32.cc
src/ia32/codegen-ia32.h
src/parser.cc
src/prettyprinter.cc
src/rewriter.cc
src/usage-analyzer.cc
src/x64/codegen-x64.cc
src/x64/codegen-x64.h