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

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

Issue 14348005: Fix for issue 9617, throw a snapshot write error when encountering stacktrace objects instead of an… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/snapshot.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/bigint_operations.h" 5 #include "vm/bigint_operations.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/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 // Write out the class and tags information. 2507 // Write out the class and tags information.
2508 writer->WriteIndexedObject(kStacktraceCid); 2508 writer->WriteIndexedObject(kStacktraceCid);
2509 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2509 writer->WriteIntptrValue(writer->GetObjectTags(this));
2510 2510
2511 // There are no non object pointer fields. 2511 // There are no non object pointer fields.
2512 2512
2513 // Write out all the object pointer fields. 2513 // Write out all the object pointer fields.
2514 SnapshotWriterVisitor visitor(writer); 2514 SnapshotWriterVisitor visitor(writer);
2515 visitor.VisitPointers(from(), to()); 2515 visitor.VisitPointers(from(), to());
2516 } else { 2516 } else {
2517 UNREACHABLE(); // Stacktraces are not supported for other snapshot forms. 2517 // Stacktraces are not allowed in other snapshot forms.
2518 writer->SetWriteException(Exceptions::kArgument,
2519 "Illegal argument in isolate message"
2520 " : (object is a stacktrace)");
2518 } 2521 }
2519 } 2522 }
2520 2523
2521 2524
2522 RawJSRegExp* JSRegExp::ReadFrom(SnapshotReader* reader, 2525 RawJSRegExp* JSRegExp::ReadFrom(SnapshotReader* reader,
2523 intptr_t object_id, 2526 intptr_t object_id,
2524 intptr_t tags, 2527 intptr_t tags,
2525 Snapshot::Kind kind) { 2528 Snapshot::Kind kind) {
2526 ASSERT(reader != NULL); 2529 ASSERT(reader != NULL);
2527 ASSERT(kind == Snapshot::kMessage); 2530 ASSERT(kind == Snapshot::kMessage);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 // Write out the class and tags information. 2612 // Write out the class and tags information.
2610 writer->WriteIndexedObject(kWeakPropertyCid); 2613 writer->WriteIndexedObject(kWeakPropertyCid);
2611 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2614 writer->WriteIntptrValue(writer->GetObjectTags(this));
2612 2615
2613 // Write out all the other fields. 2616 // Write out all the other fields.
2614 writer->Write<RawObject*>(ptr()->key_); 2617 writer->Write<RawObject*>(ptr()->key_);
2615 writer->Write<RawObject*>(ptr()->value_); 2618 writer->Write<RawObject*>(ptr()->value_);
2616 } 2619 }
2617 2620
2618 } // namespace dart 2621 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698