From b4e7472028d8b46a95fc2b38c0065e857adcea6e Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Thu, 10 Dec 2009 13:12:13 +0000 Subject: [PATCH] Disible the toplevel compiler for code containing for loops. Review URL: http://codereview.chromium.org/492003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3447 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 16 +--------------- src/fast-codegen.cc | 43 +------------------------------------------ 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 03fc2d6..6fc8a8f 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -738,21 +738,7 @@ void CodeGenSelector::VisitWhileStatement(WhileStatement* stmt) { void CodeGenSelector::VisitForStatement(ForStatement* stmt) { - // We do not handle loops with breaks or continue statements in their - // body. We will bailout when we hit those statements in the body. - if (stmt->init() != NULL) { - Visit(stmt->init()); - CHECK_BAILOUT; - } - if (stmt->cond() != NULL) { - ProcessExpression(stmt->cond(), Expression::kTest); - CHECK_BAILOUT; - } - Visit(stmt->body()); - if (stmt->next() != NULL) { - CHECK_BAILOUT; - Visit(stmt->next()); - } + BAILOUT("ForStatement"); } diff --git a/src/fast-codegen.cc b/src/fast-codegen.cc index 1bdc367..b835faf 100644 --- a/src/fast-codegen.cc +++ b/src/fast-codegen.cc @@ -375,48 +375,7 @@ void FastCodeGenerator::VisitWhileStatement(WhileStatement* stmt) { void FastCodeGenerator::VisitForStatement(ForStatement* stmt) { - Comment cmnt(masm_, "[ ForStatement"); - Label test, body, exit, stack_limit_hit, stack_check_success; - if (stmt->init() != NULL) Visit(stmt->init()); - - increment_loop_depth(); - // Emit the test at the bottom of the loop (even if empty). - __ jmp(&test); - __ bind(&body); - Visit(stmt->body()); - - // Check stack before looping. - __ StackLimitCheck(&stack_limit_hit); - __ bind(&stack_check_success); - - if (stmt->next() != NULL) Visit(stmt->next()); - - __ bind(&test); - - if (stmt->cond() == NULL) { - // For an empty test jump to the top of the loop. - __ jmp(&body); - } else { - // We are not in an expression context because we have been compiling - // statements. Set up a test expression context for the condition. - ASSERT_EQ(NULL, true_label_); - ASSERT_EQ(NULL, false_label_); - - true_label_ = &body; - false_label_ = &exit; - ASSERT(stmt->cond()->context() == Expression::kTest); - Visit(stmt->cond()); - true_label_ = NULL; - false_label_ = NULL; - } - - __ bind(&stack_limit_hit); - StackCheckStub stack_stub; - __ CallStub(&stack_stub); - __ jmp(&stack_check_success); - - __ bind(&exit); - decrement_loop_depth(); + UNREACHABLE(); } -- 2.7.4