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

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

Issue 1873143003: - Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linear list a… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review Created 4 years, 8 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
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | 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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 // we need to initialize any remaining padding area with the Null object. 535 // we need to initialize any remaining padding area with the Null object.
536 while (offset < instance_size) { 536 while (offset < instance_size) {
537 result->SetFieldAtOffset(offset, Object::null_object()); 537 result->SetFieldAtOffset(offset, Object::null_object());
538 offset += kWordSize; 538 offset += kWordSize;
539 } 539 }
540 } 540 }
541 if (RawObject::IsCanonical(tags)) { 541 if (RawObject::IsCanonical(tags)) {
542 if (kind_ == Snapshot::kFull) { 542 if (kind_ == Snapshot::kFull) {
543 result->SetCanonical(); 543 result->SetCanonical();
544 } else { 544 } else {
545 *result = result->CheckAndCanonicalize(NULL); 545 *result = result->CheckAndCanonicalize(thread(), NULL);
546 ASSERT(!result->IsNull()); 546 ASSERT(!result->IsNull());
547 } 547 }
548 } 548 }
549 } 549 }
550 return result->raw(); 550 return result->raw();
551 } 551 }
552 552
553 553
554 void SnapshotReader::AddBackRef(intptr_t id, 554 void SnapshotReader::AddBackRef(intptr_t id,
555 Object* obj, 555 Object* obj,
(...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 if (setjmp(*jump.Set()) == 0) { 2666 if (setjmp(*jump.Set()) == 0) {
2667 NoSafepointScope no_safepoint; 2667 NoSafepointScope no_safepoint;
2668 WriteObject(obj.raw()); 2668 WriteObject(obj.raw());
2669 } else { 2669 } else {
2670 ThrowException(exception_type(), exception_msg()); 2670 ThrowException(exception_type(), exception_msg());
2671 } 2671 }
2672 } 2672 }
2673 2673
2674 2674
2675 } // namespace dart 2675 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698