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

Unified Diff: runtime/vm/object.h

Issue 304703002: Split GuardField into GuardFieldType and GuardFieldLength instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 11edabf8b7e21b5069368576859d0a20f244482f..e8b979aa02b98d32d42b40ed376a3631faf165b9 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2214,12 +2214,20 @@ class Field : public Object {
static intptr_t guarded_list_length_offset() {
return OFFSET_OF(RawField, guarded_list_length_);
}
+ intptr_t guarded_list_length_in_object_offset() const;
+ void set_guarded_list_length_in_object_offset(intptr_t offset) const;
+ static intptr_t guarded_list_length_in_object_offset_offset() {
+ return OFFSET_OF(RawField, guarded_list_length_in_object_offset_);
+ }
+
bool needs_length_check() const {
const bool r = guarded_list_length() >= Field::kUnknownFixedLength;
ASSERT(!r || is_final());
return r;
}
+ const char* GuardedPropertiesAsCString() const;
+
intptr_t UnboxedFieldCid() const {
ASSERT(IsUnboxedField());
return guarded_cid();
@@ -2241,6 +2249,7 @@ class Field : public Object {
}
enum {
+ kUnknownLengthOffset = -1,
kUnknownFixedLength = -1,
kNoFixedLength = -2,
};
@@ -2259,9 +2268,9 @@ class Field : public Object {
return OFFSET_OF(RawField, is_nullable_);
}
- // Update guarded cid and guarded length for this field. May trigger
+ // Record store of the given value into this field. May trigger
// deoptimization of dependent optimized code.
- bool UpdateGuardedCidAndLength(const Object& value) const;
+ void RecordStore(const Object& value) const;
// Return the list of optimized code objects that were optimized under
// assumptions about guarded class id and nullability of this field.
@@ -2306,15 +2315,9 @@ class Field : public Object {
kUnboxingCandidateBit, 1> {
};
- // Update guarded class id and nullability of the field to reflect assignment
- // of the value with the given class id to this field. Returns true, if
+ // Update guarded cid and guarded length for this field. Returns true, if
// deoptimization of dependent code is required.
- bool UpdateCid(intptr_t cid) const;
-
- // Update guarded class length of the field to reflect assignment of the
- // value with the given length. Returns true if deoptimization of dependent
- // code is required.
- bool UpdateLength(intptr_t length) const;
+ bool UpdateGuardedCidAndLength(const Object& value) const;
void set_name(const String& value) const;
void set_is_static(bool is_static) const {
@@ -4159,7 +4162,7 @@ class Instance : public Object {
}
void SetField(const Field& field, const Object& value) const {
- field.UpdateGuardedCidAndLength(value);
+ field.RecordStore(value);
StorePointer(FieldAddr(field), value.raw());
}

Powered by Google App Engine
This is Rietveld 408576698