Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Unified Diff: src/fast-codegen.cc

Issue 566008: Incorporate the arguments to the code generator constructors and their (Closed)
Patch Set: Incorporate the arguments to the code generator constructors and their... Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/fast-codegen.h ('k') | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fast-codegen.cc
===================================================================
--- src/fast-codegen.cc (revision 3788)
+++ src/fast-codegen.cc (working copy)
@@ -51,8 +51,7 @@
} while (false)
-void FastCodeGenSyntaxChecker::Check(FunctionLiteral* fun,
- CompilationInfo* info) {
+void FastCodeGenSyntaxChecker::Check(CompilationInfo* info) {
info_ = info;
// We do not specialize if we do not have a receiver or if it is not a
@@ -64,7 +63,7 @@
// We do not support stack or heap slots (both of which require
// allocation).
- Scope* scope = fun->scope();
+ Scope* scope = info->scope();
if (scope->num_stack_slots() > 0) {
BAILOUT("Function has stack-allocated locals");
}
@@ -76,8 +75,10 @@
CHECK_BAILOUT;
// We do not support empty function bodies.
- if (fun->body()->is_empty()) BAILOUT("Function has an empty body");
- VisitStatements(fun->body());
+ if (info->function()->body()->is_empty()) {
+ BAILOUT("Function has an empty body");
+ }
+ VisitStatements(info->function()->body());
}
@@ -332,24 +333,20 @@
#define __ ACCESS_MASM(masm())
-Handle<Code> FastCodeGenerator::MakeCode(FunctionLiteral* fun,
- Handle<Script> script,
- bool is_eval,
- CompilationInfo* info) {
+Handle<Code> FastCodeGenerator::MakeCode(CompilationInfo* info) {
// Label the AST before calling MakeCodePrologue, so AST node numbers are
// printed with the AST.
AstLabeler labeler;
- labeler.Label(fun);
- info->set_has_this_properties(labeler.has_this_properties());
+ labeler.Label(info);
- CodeGenerator::MakeCodePrologue(fun);
+ CodeGenerator::MakeCodePrologue(info);
const int kInitialBufferSize = 4 * KB;
MacroAssembler masm(NULL, kInitialBufferSize);
// Generate the fast-path code.
- FastCodeGenerator fast_cgen(&masm, script, is_eval);
- fast_cgen.Generate(fun, info);
+ FastCodeGenerator fast_cgen(&masm);
+ fast_cgen.Generate(info);
if (fast_cgen.HasStackOverflow()) {
ASSERT(!Top::has_pending_exception());
return Handle<Code>::null();
@@ -357,16 +354,16 @@
// Generate the full code for the function in bailout mode, using the same
// macro assembler.
- CodeGenerator cgen(&masm, script, is_eval);
+ CodeGenerator cgen(&masm);
CodeGeneratorScope scope(&cgen);
- cgen.Generate(fun, CodeGenerator::SECONDARY, info);
+ cgen.Generate(info, CodeGenerator::SECONDARY);
if (cgen.HasStackOverflow()) {
ASSERT(!Top::has_pending_exception());
return Handle<Code>::null();
}
Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, NOT_IN_LOOP);
- return CodeGenerator::MakeCodeEpilogue(fun, &masm, flags, script);
+ return CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
}
« no previous file with comments | « src/fast-codegen.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698