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

Unified Diff: runtime/vm/intermediate_language.h

Issue 1745453002: More fixes for background compilation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index f228aaa996637eefc031bfb6a7453dc27bfdce44..f424c9931d43c4a0e928b2c6fd1818978dd69ad2 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -714,6 +714,16 @@ class Instruction : public ZoneAllocated {
virtual const char* DebugName() const = 0;
+#if defined(DEBUG)
+ // Checks that the field stored in an instruction has proper form:
+ // - must be a zone-handle
+ // - In background compilation, must be cloned.
+ // Aborts if field is not OK.
+ void CheckField(const Field& field) const;
+#else
+ void CheckField(const Field& field) const {}
+#endif // DEBUG
+
// Printing support.
const char* ToCString() const;
#ifndef PRODUCT
@@ -3550,6 +3560,7 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
is_object_reference_initialization_(false) {
SetInputAt(kInstancePos, instance);
SetInputAt(kValuePos, value);
+ CheckField(field);
}
StoreInstanceFieldInstr(intptr_t offset_in_bytes,
@@ -3651,6 +3662,7 @@ class GuardFieldInstr : public TemplateInstruction<1, NoThrow, Pure> {
: TemplateInstruction(deopt_id),
field_(field) {
SetInputAt(0, value);
+ CheckField(field);
}
Value* value() const { return inputs_[0]; }
@@ -3677,7 +3689,9 @@ class GuardFieldClassInstr : public GuardFieldInstr {
GuardFieldClassInstr(Value* value,
const Field& field,
intptr_t deopt_id)
- : GuardFieldInstr(value, field, deopt_id) { }
+ : GuardFieldInstr(value, field, deopt_id) {
+ CheckField(field);
+ }
DECLARE_INSTRUCTION(GuardFieldClass)
@@ -3695,7 +3709,9 @@ class GuardFieldLengthInstr : public GuardFieldInstr {
GuardFieldLengthInstr(Value* value,
const Field& field,
intptr_t deopt_id)
- : GuardFieldInstr(value, field, deopt_id) { }
+ : GuardFieldInstr(value, field, deopt_id) {
+ CheckField(field);
+ }
DECLARE_INSTRUCTION(GuardFieldLength)
@@ -3750,6 +3766,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
token_pos_(token_pos) {
ASSERT(field.IsZoneHandle());
SetInputAt(kValuePos, value);
+ CheckField(field);
}
enum {
@@ -4641,6 +4658,7 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
: TemplateInstruction(Thread::Current()->GetNextDeoptId()),
field_(field) {
SetInputAt(0, input);
+ CheckField(field);
}
virtual TokenPosition token_pos() const {
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698