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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10407074: Add flag to measure impact of type check elimination. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 7822)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -20,9 +20,11 @@
namespace dart {
+DEFINE_FLAG(bool, eliminate_type_checks, true,
+ "Eliminate type checks when allowed by static type analysis");
+DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph.");
DECLARE_FLAG(bool, enable_type_checks);
-DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function)
@@ -311,6 +313,9 @@
ASSERT(FLAG_enable_type_checks);
ASSERT(!dst_type.IsNull());
ASSERT(dst_type.IsFinalized());
+ if (!FLAG_eliminate_type_checks) {
+ return false;
+ }
// Any expression is assignable to the Dynamic type and to the Object type.
// Skip the test.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698