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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 2988493002: Reapply "Improve hashCode for closure objects" with fixes. (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/native_entry.h" 5 #include "vm/native_entry.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 bool as_reference) { 577 bool as_reference) {
578 ASSERT(reader != NULL); 578 ASSERT(reader != NULL);
579 ASSERT(kind == Snapshot::kScript); 579 ASSERT(kind == Snapshot::kScript);
580 580
581 // Allocate closure data object. 581 // Allocate closure data object.
582 ClosureData& data = 582 ClosureData& data =
583 ClosureData::ZoneHandle(reader->zone(), ClosureData::New()); 583 ClosureData::ZoneHandle(reader->zone(), ClosureData::New());
584 reader->AddBackRef(object_id, &data, kIsDeserialized); 584 reader->AddBackRef(object_id, &data, kIsDeserialized);
585 585
586 // Set all the object fields. 586 // Set all the object fields.
587 // Cached hash is null-initialized by ClosureData::New()
588 READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to_snapshot(), 587 READ_OBJECT_FIELDS(data, data.raw()->from(), data.raw()->to_snapshot(),
589 kAsInlinedObject); 588 kAsInlinedObject);
590 589
591 return data.raw(); 590 return data.raw();
592 } 591 }
593 592
594 void RawClosureData::WriteTo(SnapshotWriter* writer, 593 void RawClosureData::WriteTo(SnapshotWriter* writer,
595 intptr_t object_id, 594 intptr_t object_id,
596 Snapshot::Kind kind, 595 Snapshot::Kind kind,
597 bool as_reference) { 596 bool as_reference) {
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2920 // We do not allow objects with native fields in an isolate message. 2919 // We do not allow objects with native fields in an isolate message.
2921 writer->SetWriteException(Exceptions::kArgument, 2920 writer->SetWriteException(Exceptions::kArgument,
2922 "Illegal argument in isolate message" 2921 "Illegal argument in isolate message"
2923 " : (object is a UserTag)"); 2922 " : (object is a UserTag)");
2924 } else { 2923 } else {
2925 UNREACHABLE(); 2924 UNREACHABLE();
2926 } 2925 }
2927 } 2926 }
2928 2927
2929 } // namespace dart 2928 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698