Index: runtime/vm/ast.cc |
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc |
index d1cd87779af320925fe9863d43ecfbf023ceef59..2e9cce9ea795fa70e2e3764647e4ac70feaa297c 100644 |
--- a/runtime/vm/ast.cc |
+++ b/runtime/vm/ast.cc |
@@ -37,6 +37,17 @@ FOR_EACH_NODE(DEFINE_NAME_FUNCTION) |
#undef DEFINE_NAME_FUNCTION |
+const Field* AstNode::MayCloneField(const Field& value) { |
+ if (Compiler::IsBackgroundCompilation() || |
+ FLAG_force_clone_compiler_objects) { |
+ return value.CloneFromOriginal(); |
siva
2016/02/25 23:38:32
Why not create the zone handle here instead of hav
srdjan
2016/02/26 00:40:42
OK, always returning RawField* instead of Field* i
|
+ } else { |
+ ASSERT(value.IsZoneHandle()); |
+ return &value; |
+ } |
+} |
+ |
+ |
siva
2016/02/25 23:38:32
Add
const Field* AstNode::OriginalAsHandle(const
srdjan
2016/02/26 00:40:42
It feels wrong to put that shared functionality in
|
// A visitor class to collect all the nodes (including children) into an |
// array. |
class AstNodeCollector : public AstNodeVisitor { |
@@ -582,7 +593,8 @@ AstNode* LoadStaticFieldNode::MakeAssignmentNode(AstNode* rhs) { |
AbstractType::ZoneHandle(field().type()), |
String::ZoneHandle(field().name())); |
} |
- return new StoreStaticFieldNode(token_pos(), field(), rhs); |
+ return new StoreStaticFieldNode( |
+ token_pos(), *field().OriginalAsHandle(), rhs); |
siva
2016/02/25 23:38:32
token_pos(), *OriginalAsHandle(field(), rhs);
srdjan
2016/02/26 00:40:42
Resolved using Field::ZoneHandle
|
} |