Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index b9e13c166172595b298ae227348f5a40a35dca20..674c88cc7bbe28b1f81148d71c8c2308c207a9de 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -243,6 +243,12 @@ bool CompilationInfo::ShouldSelfOptimize() { |
} |
+void CompilationInfo::ProcessFeedbackSlots() { |
Benedikt Meurer
2014/02/04 08:53:50
Why is this in CompilationInfo? And why do we need
mvstanton
2014/02/04 13:03:27
I managed to reduce this to a single chokepoint, S
|
+ // Scope analysis must have been done. |
Benedikt Meurer
2014/02/04 08:53:50
Can we ASSERT that?
mvstanton
2014/02/04 13:03:27
It's enough to do the work in InitializeScope() no
|
+ function()->ProcessFeedbackSlots(isolate_); |
+} |
+ |
+ |
class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { |
public: |
explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) |
@@ -613,6 +619,7 @@ static bool CompileUnoptimizedCode(CompilationInfo* info) { |
if (!Rewriter::Rewrite(info)) return false; |
if (!Scope::Analyze(info)) return false; |
ASSERT(info->scope() != NULL); |
+ info->ProcessFeedbackSlots(); |
if (!FullCodeGenerator::MakeCode(info)) { |
Isolate* isolate = info->isolate(); |
@@ -978,11 +985,15 @@ Handle<SharedFunctionInfo> Compiler::CompileScript(Handle<String> source, |
Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, |
- Handle<Script> script) { |
+ Handle<Script> script, |
+ bool process_feedback) { |
// Precondition: code has been parsed and scopes have been analyzed. |
CompilationInfoWithZone info(script); |
info.SetFunction(literal); |
info.SetScope(literal->scope()); |
+ if (process_feedback) { |
+ info.ProcessFeedbackSlots(); |
+ } |
info.SetLanguageMode(literal->scope()->language_mode()); |
Isolate* isolate = info.isolate(); |
@@ -1083,6 +1094,7 @@ static bool CompileOptimizedPrologue(CompilationInfo* info) { |
if (!Rewriter::Rewrite(info)) return false; |
if (!Scope::Analyze(info)) return false; |
+ info->ProcessFeedbackSlots(); |
ASSERT(info->scope() != NULL); |
return true; |
} |