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

Unified Diff: src/compiler/pipeline.cc

Issue 593563005: [turbofan] basic block profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/compiler/basic-block-instrumentor.cc ('k') | src/compiler/schedule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 87a5370293e29b9904b5746c3921b6b792fafcd7..333382aaf3a36b75be87b5b40b1d25680c9cc978 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-instrumentor.h"
#include "src/compiler/change-lowering.h"
#include "src/compiler/code-generator.h"
#include "src/compiler/graph-replay.h"
@@ -315,6 +316,8 @@ Handle<Code> Pipeline::GenerateCode() {
VerifyAndPrintGraph(&graph, "Lowered generic");
}
+ source_positions.RemoveDecorator();
+
Handle<Code> code = Handle<Code>::null();
{
// Compute a schedule.
@@ -381,6 +384,11 @@ 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 = BasicBlockInstrumentor::Instrument(info_, graph, schedule);
+ }
+
InstructionSequence sequence(linkage, graph, schedule);
// Select and schedule instructions covering the scheduled graph.
@@ -417,7 +425,15 @@ 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) {
+#if ENABLE_DISASSEMBLER
+ OStringStream os;
+ code->Disassemble(NULL, os);
+ profiler_data->SetCode(&os);
+#endif
+ }
+ return code;
}
« no previous file with comments | « src/compiler/basic-block-instrumentor.cc ('k') | src/compiler/schedule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698