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

Unified Diff: runtime/vm/ast.h

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/assembler_x64.cc ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index c770d0e7b26b32aa83349a566e8ec9fbed0bf0a0..4ca237268e5a1280eeeda36c8851a30323da699e 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -150,6 +150,10 @@ class AstNode : public ZoneAllocated {
// the former).
virtual const Instance* EvalConstExpr() const { return NULL; }
+ // Return ZoneHandle of a cloned 'value' when in background compilation or
+ // when testing. Otherwise return 'value' itself.
+ static const Field* MayCloneField(const Field& value);
+
protected:
friend class ParsedFunction;
@@ -1241,7 +1245,8 @@ class LoadInstanceFieldNode : public AstNode {
LoadInstanceFieldNode(TokenPosition token_pos,
AstNode* instance,
const Field& field)
- : AstNode(token_pos), instance_(instance), field_(field) {
+ : AstNode(token_pos), instance_(instance),
+ field_(*MayCloneField(field)) {
ASSERT(instance_ != NULL);
ASSERT(field_.IsZoneHandle());
}
@@ -1271,7 +1276,7 @@ class StoreInstanceFieldNode : public AstNode {
AstNode* value)
: AstNode(token_pos),
instance_(instance),
- field_(field),
+ field_(*MayCloneField(field)),
value_(value) {
ASSERT(instance_ != NULL);
ASSERT(field_.IsZoneHandle());
@@ -1301,7 +1306,9 @@ class StoreInstanceFieldNode : public AstNode {
class LoadStaticFieldNode : public AstNode {
public:
LoadStaticFieldNode(TokenPosition token_pos, const Field& field)
- : AstNode(token_pos), field_(field), is_deferred_reference_(false) {
+ : AstNode(token_pos),
+ field_(*MayCloneField(field)),
+ is_deferred_reference_(false) {
ASSERT(field_.IsZoneHandle());
}
@@ -1339,7 +1346,9 @@ class StoreStaticFieldNode : public AstNode {
StoreStaticFieldNode(TokenPosition token_pos,
const Field& field,
AstNode* value)
- : AstNode(token_pos), field_(field), value_(value) {
+ : AstNode(token_pos),
+ field_(*MayCloneField(field)),
+ value_(value) {
ASSERT(field_.IsZoneHandle());
ASSERT(value_ != NULL);
}
@@ -1561,7 +1570,8 @@ class InstanceSetterNode : public AstNode {
class InitStaticFieldNode : public AstNode {
public:
InitStaticFieldNode(TokenPosition token_pos, const Field& field)
- : AstNode(token_pos), field_(field) {
+ : AstNode(token_pos),
+ field_(*MayCloneField(field)) {
ASSERT(field_.IsZoneHandle());
}
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698