Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index 137eb9d02f3af8898714e60c7d0b491a368d0bcf..4c363b30055dd37e2243adc515bf5440faf32c92 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -5351,7 +5351,11 @@ RawField* Field::New(const String& name, |
| result.set_has_initializer(false); |
| result.set_guarded_cid(kIllegalCid); |
| result.set_is_nullable(false); |
|
srdjan
2013/08/28 16:00:55
Maybe add comment that list length guard is implem
Cutch
2013/08/29 08:27:17
Done.
|
| - result.set_guarded_list_length(Field::kUnknownFixedLength); |
| + if (is_final) { |
| + result.set_guarded_list_length(Field::kUnknownFixedLength); |
| + } else { |
| + result.set_guarded_list_length(Field::kNoFixedLength); |
| + } |
| result.set_dependent_code(Object::null_array()); |
| return result.raw(); |
| } |
| @@ -5379,6 +5383,16 @@ RawString* Field::UserVisibleName() const { |
| } |
| +intptr_t Field::guarded_list_length() const { |
| + return Smi::Value(raw_ptr()->guarded_list_length_); |
| +} |
| + |
| + |
| +void Field::set_guarded_list_length(intptr_t list_length) const { |
| + raw_ptr()->guarded_list_length_ = Smi::New(list_length); |
| +} |
| + |
| + |
| const char* Field::ToCString() const { |
| if (IsNull()) { |
| return "Field::null"; |
| @@ -5571,7 +5585,6 @@ void Field::UpdateLength(intptr_t list_length) const { |
| // List length unchanged. |
| return; |
| } |
| - |
| // Multiple list lengths assigned here, stop tracking length. |
| set_guarded_list_length(Field::kNoFixedLength); |
| DeoptimizeDependentCode(); |