From: kmillikin@chromium.org Date: Wed, 4 Nov 2009 17:59:24 +0000 (+0000) Subject: Obey the flag --lazy in the toplevel code generator. X-Git-Tag: upstream/4.7.83~23008 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ce4eab1b2091778c8ddda95c87634ebc95c6c91;p=platform%2Fupstream%2Fv8.git Obey the flag --lazy in the toplevel code generator. There were two separate implementations of the function 'BuildBoilerplate' that is used to compile function declarations and function literals. The implementations did not do exactly the same thing. In particular, one ignored the flag --lazy. Combine the two implementations. Review URL: http://codereview.chromium.org/360011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index 566da4fa6..dc4592f79 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -29,6 +29,7 @@ #include "bootstrapper.h" #include "codegen-inl.h" +#include "compiler.h" #include "debug.h" #include "parser.h" #include "register-allocator-inl.h" @@ -575,8 +576,6 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) { // load to make sure we do not get reference errors. Slot global(variable, Slot::CONTEXT, Context::GLOBAL_INDEX); Literal key(variable->name()); - // TODO(1241834): Fetch the position from the variable instead of using - // no position. Property property(&global, &key, RelocInfo::kNoPosition); Reference ref(this, &property); ref.GetValueAndSpill(); @@ -2260,7 +2259,8 @@ void CodeGenerator::VisitFunctionLiteral(FunctionLiteral* node) { Comment cmnt(masm_, "[ FunctionLiteral"); // Build the function boilerplate and instantiate it. - Handle boilerplate = BuildBoilerplate(node); + Handle boilerplate = + Compiler::BuildBoilerplate(node, script_, this); // Check for stack-overflow exception. if (HasStackOverflow()) { ASSERT(frame_->height() == original_height); diff --git a/src/arm/codegen-arm.h b/src/arm/codegen-arm.h index 1871e3025..a0bc84f62 100644 --- a/src/arm/codegen-arm.h +++ b/src/arm/codegen-arm.h @@ -165,8 +165,8 @@ class CodeGenerator: public AstVisitor { // Accessors MacroAssembler* masm() { return masm_; } - VirtualFrame* frame() const { return frame_; } + Handle