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

Unified Diff: runtime/vm/ast.cc

Issue 1722733002: In background compilation make a copy of Field in order to freeze its state (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: s Created 4 years, 10 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 | « runtime/vm/ast.h ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index 0390198e14b2038fac7988a136853b63ba2f50d8..bb1b624a6c3fe12d7872b824b3bbc001b343eeb7 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 &Field::ZoneHandle(value.CloneFromOriginal());
+ } else {
+ ASSERT(value.IsZoneHandle());
+ return &value;
+ }
+}
+
+
// 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::ZoneHandle(field().Original()), rhs);
}
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698