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

Unified Diff: src/compiler/pipeline.cc

Issue 509343002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Drop typedness from graph 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
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index bd99944149ec4adab18c97b2f9f3f85242888131..e4c6466a1371023ce58ed26e4716578e868cf660 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -83,7 +83,8 @@ static inline bool VerifyGraphs() {
}
-void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) {
+void Pipeline::VerifyAndPrintGraph(
+ Graph* graph, const char* phase, Verifier::Typing typing) {
if (FLAG_trace_turbo) {
char buffer[256];
Vector<char> filename(buffer, sizeof(buffer));
@@ -105,7 +106,9 @@ void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) {
os << "-- " << phase << " graph printed to file " << filename.start()
<< "\n";
}
- if (VerifyGraphs()) Verifier::Run(graph);
+ if (VerifyGraphs()) {
+ Verifier::Run(graph, FLAG_turbo_types ? typing : Verifier::UNTYPED);
+ }
}
@@ -157,12 +160,8 @@ Handle<Code> Pipeline::GenerateCode() {
Graph graph(zone());
SourcePositionTable source_positions(&graph);
source_positions.AddDecorator();
- // TODO(turbofan): there is no need to type anything during initial graph
- // construction. This is currently only needed for the node cache, which the
- // typer could sweep over later.
- Typer typer(zone());
CommonOperatorBuilder common(zone());
- JSGraph jsgraph(&graph, &common, &typer);
+ JSGraph jsgraph(&graph, &common);
Node* context_node;
{
PhaseStats graph_builder_stats(info(), PhaseStats::CREATE_GRAPH,
@@ -184,7 +183,7 @@ Handle<Code> Pipeline::GenerateCode() {
graph_reducer.ReduceGraph();
}
- VerifyAndPrintGraph(&graph, "Initial untyped");
+ VerifyAndPrintGraph(&graph, "Initial untyped", Verifier::UNTYPED);
if (context_specialization_) {
SourcePositionTable::Scope pos(&source_positions,
@@ -192,7 +191,7 @@ Handle<Code> Pipeline::GenerateCode() {
// Specialize the code to the context as aggressively as possible.
JSContextSpecializer spec(info(), &jsgraph, context_node);
spec.SpecializeToContext();
- VerifyAndPrintGraph(&graph, "Context specialized");
+ VerifyAndPrintGraph(&graph, "Context specialized", Verifier::UNTYPED);
}
if (FLAG_turbo_inlining) {
@@ -200,7 +199,7 @@ Handle<Code> Pipeline::GenerateCode() {
SourcePosition::Unknown());
JSInliner inliner(info(), &jsgraph);
inliner.Inline();
- VerifyAndPrintGraph(&graph, "Inlined");
+ VerifyAndPrintGraph(&graph, "Inlined", Verifier::UNTYPED);
}
// Print a replay of the initial graph.
@@ -208,14 +207,13 @@ Handle<Code> Pipeline::GenerateCode() {
GraphReplayPrinter::PrintReplay(&graph);
}
+ Typer typer(&graph, info()->context());
if (FLAG_turbo_types) {
{
// Type the graph.
PhaseStats typer_stats(info(), PhaseStats::CREATE_GRAPH, "typer");
- typer.Run(&graph, info()->context());
+ typer.Run();
}
- // All new nodes must be typed.
- typer.DecorateGraph(&graph);
{
// Lower JSOperators where we can determine types.
PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH,

Powered by Google App Engine
This is Rietveld 408576698