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

Unified Diff: runtime/vm/ast.cc

Issue 300763002: Don't require eliminating certain type checks in unoptimized compilation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 36662)
+++ runtime/vm/ast.cc (working copy)
@@ -12,6 +12,8 @@
namespace dart {
+DECLARE_FLAG(bool, enable_type_checks);
+
#define DEFINE_VISIT_FUNCTION(BaseName) \
void BaseName##Node::Visit(AstNodeVisitor* visitor) { \
visitor->Visit##BaseName##Node(this); \
@@ -505,6 +507,13 @@
if (field().is_final()) {
return NULL;
}
+ if (FLAG_enable_type_checks) {
+ rhs = new AssignableNode(
+ field().token_pos(),
+ rhs,
+ AbstractType::ZoneHandle(field().type()),
+ String::ZoneHandle(field().name()));
+ }
return new StoreStaticFieldNode(token_pos(), field(), rhs);
}
@@ -557,6 +566,13 @@
ASSERT(!getter.IsNull() &&
(getter.kind() == RawFunction::kImplicitStaticFinalGetter));
#endif
+ if (FLAG_enable_type_checks) {
+ rhs = new AssignableNode(
+ field.token_pos(),
+ rhs,
+ AbstractType::ZoneHandle(field.type()),
+ String::ZoneHandle(field.name()));
+ }
return new StoreStaticFieldNode(token_pos(), field, rhs);
}
// Didn't find a static setter or a static field.
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698