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

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: e 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
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
}
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/ast_printer.cc » ('j') | runtime/vm/ast_printer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698