| Index: runtime/vm/object.h
|
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h
|
| index 2c543b5041fde5f2a6c86bd2b653f1b80dc0f50b..20c508bee71380a29fc043910f66a69a2612638e 100644
|
| --- a/runtime/vm/object.h
|
| +++ b/runtime/vm/object.h
|
| @@ -1987,11 +1987,33 @@ class Field : public Object {
|
| static intptr_t guarded_cid_offset() {
|
| return OFFSET_OF(RawField, guarded_cid_);
|
| }
|
| + // Return the list length that any list stored in this field is guaranteed
|
| + // to have. If length is kUnknownFixedLength the length has not
|
| + // been determined. If length is kNoFixedLength this field has multiple
|
| + // list lengths associated with it and cannot be predicted.
|
| + intptr_t guarded_list_length() const {
|
| + return raw_ptr()->guarded_list_length_;
|
| + }
|
| + void set_guarded_list_length(intptr_t list_length) const {
|
| + raw_ptr()->guarded_list_length_ = list_length;
|
| + }
|
| + static intptr_t guarded_list_length_offset() {
|
| + return OFFSET_OF(RawField, guarded_list_length_);
|
| + }
|
| + bool needs_length_check() const {
|
| + const bool r = guarded_list_length() >= Field::kUnknownFixedLength;
|
| + ASSERT(!r || is_final());
|
| + return r;
|
| + }
|
|
|
| static bool IsExternalizableCid(intptr_t cid) {
|
| return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid);
|
| }
|
|
|
| + enum {
|
| + kUnknownFixedLength = -1,
|
| + kNoFixedLength = -2,
|
| + };
|
| // Returns false if any value read from this field is guaranteed to be
|
| // not null.
|
| // Internally we is_nullable_ field contains either kNullCid (nullable) or
|
| @@ -2008,8 +2030,12 @@ class Field : public Object {
|
| }
|
|
|
| // Update guarded class id and nullability of the field to reflect assignment
|
| - // of the value with the given class id to this field.
|
| + // of the value with the given class id to this field. May trigger
|
| + // deoptimization of dependent code.
|
| void UpdateCid(intptr_t cid) const;
|
| + // Update guarded class length of the field to reflect assignment of the
|
| + // value with the given length. May trigger deoptimization of dependent code.
|
| + void UpdateLength(intptr_t length) const;
|
|
|
| // Return the list of optimized code objects that were optimized under
|
| // assumptions about guarded class id and nullability of this field.
|
|
|