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

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

Issue 512933002: Use PassiveObject were possible. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.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/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 backward_references_((kind == Snapshot::kFull) ? 184 backward_references_((kind == Snapshot::kFull) ?
185 kNumInitialReferencesInFullSnapshot : 185 kNumInitialReferencesInFullSnapshot :
186 kNumInitialReferences) { 186 kNumInitialReferences) {
187 } 187 }
188 188
189 189
190 RawObject* SnapshotReader::ReadObject() { 190 RawObject* SnapshotReader::ReadObject() {
191 // Setup for long jump in case there is an exception while reading. 191 // Setup for long jump in case there is an exception while reading.
192 LongJumpScope jump; 192 LongJumpScope jump;
193 if (setjmp(*jump.Set()) == 0) { 193 if (setjmp(*jump.Set()) == 0) {
194 Object& obj = Object::Handle(ReadObjectImpl()); 194 PassiveObject& obj = PassiveObject::Handle(isolate(), ReadObjectImpl());
195 for (intptr_t i = 0; i < backward_references_.length(); i++) { 195 for (intptr_t i = 0; i < backward_references_.length(); i++) {
196 if (!backward_references_[i].is_deserialized()) { 196 if (!backward_references_[i].is_deserialized()) {
197 ReadObjectImpl(); 197 ReadObjectImpl();
198 backward_references_[i].set_state(kIsDeserialized); 198 backward_references_[i].set_state(kIsDeserialized);
199 } 199 }
200 } 200 }
201 return obj.raw(); 201 return obj.raw();
202 } else { 202 } else {
203 // An error occurred while reading, return the error object. 203 // An error occurred while reading, return the error object.
204 const Error& err = Error::Handle(isolate()->object_store()->sticky_error()); 204 const Error& err = Error::Handle(isolate()->object_store()->sticky_error());
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 NoGCScope no_gc; 1729 NoGCScope no_gc;
1730 WriteObject(obj.raw()); 1730 WriteObject(obj.raw());
1731 UnmarkAll(); 1731 UnmarkAll();
1732 } else { 1732 } else {
1733 ThrowException(exception_type(), exception_msg()); 1733 ThrowException(exception_type(), exception_msg());
1734 } 1734 }
1735 } 1735 }
1736 1736
1737 1737
1738 } // namespace dart 1738 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698