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

Unified Diff: runtime/vm/code_generator.cc

Issue 50243004: Fix bug with guarded fields and deserialization. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/object.h » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 29540)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1681,31 +1681,6 @@
}
-static intptr_t GetListLength(const Object& value) {
- const intptr_t cid = value.GetClassId();
- ASSERT(RawObject::IsBuiltinListClassId(cid));
- // Extract list length.
- if (value.IsTypedData()) {
- const TypedData& list = TypedData::Cast(value);
- return list.Length();
- } else if (value.IsArray()) {
- const Array& list = Array::Cast(value);
- return list.Length();
- } else if (value.IsGrowableObjectArray()) {
- // List length is variable.
- return Field::kNoFixedLength;
- } else if (value.IsExternalTypedData()) {
- // TODO(johnmccutchan): Enable for external typed data.
- return Field::kNoFixedLength;
- } else if (RawObject::IsTypedDataViewClassId(cid)) {
- // TODO(johnmccutchan): Enable for typed data views.
- return Field::kNoFixedLength;
- }
- UNIMPLEMENTED();
- return Field::kNoFixedLength;
-}
-
-
// Update global type feedback recorded for a field recording the assignment
// of the given value.
// Arg0: Field object;
@@ -1713,14 +1688,7 @@
DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
const Object& value = Object::Handle(arguments.ArgAt(1));
- const intptr_t cid = value.GetClassId();
- field.UpdateCid(cid);
- intptr_t list_length = Field::kNoFixedLength;
- if ((field.guarded_cid() != kDynamicCid) &&
- field.is_final() && RawObject::IsBuiltinListClassId(cid)) {
- list_length = GetListLength(value);
- }
- field.UpdateLength(list_length);
+ field.UpdateGuardedCidAndLength(value);
}
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698