From bef3ae07db71713439e4723d6633862f1e3f89c5 Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Mon, 4 Oct 2010 11:35:46 +0000 Subject: [PATCH] Begin a more aggressive refactoring of the Compiler interface. The plan is to use the CompilationInfo class to communicate inputs and outputs to compilation pipeline phases, which each return a boolean success/failure flag. The intent is to make it easier to compose small pieces of the pipeline without having to grow a custom function each time, each taking a half dozen arguments. This change modifies the very front end (the parser). Review URL: http://codereview.chromium.org/3586006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/codegen-arm.cc | 4 +- src/compiler.cc | 155 +++++++++++++++++++++++++--------------------- src/compiler.h | 158 +++++++++++++++++++---------------------------- src/handles.cc | 7 ++- src/ia32/codegen-ia32.cc | 4 +- src/liveedit.cc | 32 ++++------ src/parser.cc | 67 ++++++++++---------- src/parser.h | 16 ++--- src/x64/codegen-x64.cc | 4 +- 9 files changed, 210 insertions(+), 237 deletions(-) diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index d273e75..5156302 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -175,7 +175,7 @@ void CodeGenerator::Generate(CompilationInfo* info) { // Adjust for function-level loop nesting. ASSERT_EQ(0, loop_nesting_); - loop_nesting_ = info->loop_nesting(); + loop_nesting_ = info->is_in_loop() ? 1 : 0; { CodeGenState state(this); @@ -339,7 +339,7 @@ void CodeGenerator::Generate(CompilationInfo* info) { } // Adjust for function-level loop nesting. - ASSERT(loop_nesting_ == info->loop_nesting()); + ASSERT(loop_nesting_ == info->is_in_loop()? 1 : 0); loop_nesting_ = 0; // Code generation state must be reset. diff --git a/src/compiler.cc b/src/compiler.cc index bfb2e21..127f6d5 100755 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -45,6 +45,40 @@ namespace v8 { namespace internal { + +CompilationInfo::CompilationInfo(Handle