Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 31d53e44ee327680c41de747d84fadfc4f65e150..c9c5c24d743637edcd98dca73aad35929e1662d2 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -6,6 +6,7 @@ |
#include "src/base/platform/elapsed-timer.h" |
#include "src/compiler/ast-graph-builder.h" |
+#include "src/compiler/basic-block-profiler.h" |
#include "src/compiler/change-lowering.h" |
#include "src/compiler/code-generator.h" |
#include "src/compiler/graph-replay.h" |
@@ -302,6 +303,8 @@ Handle<Code> Pipeline::GenerateCode() { |
VerifyAndPrintGraph(&graph, "Lowered generic"); |
} |
+ source_positions.RemoveDecorator(); |
+ |
{ |
// Compute a schedule. |
Schedule* schedule = ComputeSchedule(&graph); |
@@ -368,6 +371,12 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, Graph* graph, |
DCHECK_NOT_NULL(schedule); |
CHECK(SupportedBackend()); |
+ BasicBlockProfiler::Data* profiler_data = NULL; |
+ if (FLAG_turbo_profiling) { |
+ profiler_data = info_->isolate()->GetBasicBlockProfiler()->Profile( |
+ info_, graph, schedule); |
+ } |
+ |
InstructionSequence sequence(linkage, graph, schedule); |
// Select and schedule instructions covering the scheduled graph. |
@@ -404,7 +413,11 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, Graph* graph, |
// Generate native sequence. |
CodeGenerator generator(&sequence); |
- return generator.GenerateCode(); |
+ Handle<Code> code = generator.GenerateCode(); |
+ if (profiler_data != NULL) { |
+ profiler_data->SetCode(code); |
+ } |
+ return code; |
} |