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

Unified Diff: src/compiler.cc

Issue 551189: Propagate receiver from initial call site to code generator. (Closed)
Patch Set: 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
« src/compiler.h ('K') | « src/compiler.h ('k') | src/debug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7482ae1a618025408c62bd4bde07b1889f98e04f..637ca0366d4b91a46a9cece99a8eeb52f448bd95 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -47,7 +47,8 @@ static Handle<Code> MakeCode(FunctionLiteral* literal,
Handle<Script> script,
Handle<Context> context,
bool is_eval,
- Handle<SharedFunctionInfo> shared) {
+ Handle<SharedFunctionInfo> shared,
+ Handle<Object> receiver) {
ASSERT(literal != NULL);
// Rewrite the AST by introducing .result assignments where needed.
@@ -108,7 +109,7 @@ static Handle<Code> MakeCode(FunctionLiteral* literal,
}
} else if (FLAG_always_fast_compiler ||
(FLAG_fast_compiler && !is_run_once)) {
- FastCodeGenSyntaxChecker checker;
+ FastCodeGenSyntaxChecker checker(receiver);
checker.Check(literal);
// Does not yet generate code.
}
@@ -198,8 +199,12 @@ static Handle<JSFunction> MakeFunction(bool is_global,
HistogramTimerScope timer(rate);
// Compile the code.
- Handle<Code> code = MakeCode(lit, script, context, is_eval,
- Handle<SharedFunctionInfo>::null());
+ Handle<Code> code = MakeCode(lit,
+ script,
+ context,
+ is_eval,
+ Handle<SharedFunctionInfo>::null(),
+ Handle<Object>::null()); // No receiver.
// Check for stack-overflow exceptions.
if (code.is_null()) {
@@ -361,6 +366,7 @@ Handle<JSFunction> Compiler::CompileEval(Handle<String> source,
bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared,
+ Handle<Object> receiver,
int loop_nesting) {
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
@@ -400,8 +406,12 @@ bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared,
HistogramTimerScope timer(&Counters::compile_lazy);
// Compile the code.
- Handle<Code> code = MakeCode(lit, script, Handle<Context>::null(), false,
- shared);
+ Handle<Code> code = MakeCode(lit,
+ script,
+ Handle<Context>::null(),
+ false,
+ shared,
+ receiver);
// Check for stack-overflow exception.
if (code.is_null()) {
@@ -496,7 +506,9 @@ Handle<JSFunction> Compiler::BuildBoilerplate(FunctionLiteral* literal,
}
} else if (FLAG_always_fast_compiler ||
(FLAG_fast_compiler && !is_run_once)) {
- FastCodeGenSyntaxChecker checker;
+ // Since we are not lazily compiling we do not have a receiver to
+ // specialize for.
+ FastCodeGenSyntaxChecker checker(Handle<Object>::null());
checker.Check(literal);
// Generate no code.
}
« src/compiler.h ('K') | « src/compiler.h ('k') | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698