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

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

Issue 1975423002: Check snapshots for feature compatibility. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/dart_api_impl.cc ('k') | runtime/vm/snapshot.cc » ('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 #ifndef VM_SNAPSHOT_H_ 5 #ifndef VM_SNAPSHOT_H_
6 #define VM_SNAPSHOT_H_ 6 #define VM_SNAPSHOT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/bitfield.h" 10 #include "vm/bitfield.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // Get an object from the backward references list. 429 // Get an object from the backward references list.
430 Object* GetBackRef(intptr_t id); 430 Object* GetBackRef(intptr_t id);
431 431
432 // Read a full snap shot. 432 // Read a full snap shot.
433 RawApiError* ReadFullSnapshot(); 433 RawApiError* ReadFullSnapshot();
434 434
435 // Read a script snap shot. 435 // Read a script snap shot.
436 RawObject* ReadScriptSnapshot(); 436 RawObject* ReadScriptSnapshot();
437 437
438 // Read version number of snapshot and verify. 438 // Read version number of snapshot and verify.
439 RawApiError* VerifyVersion(); 439 RawApiError* VerifyVersionAndFeatures();
440 440
441 // Helper functions for creating uninitialized versions 441 // Helper functions for creating uninitialized versions
442 // of various object types. These are used when reading a 442 // of various object types. These are used when reading a
443 // full snapshot. 443 // full snapshot.
444 RawArray* NewArray(intptr_t len); 444 RawArray* NewArray(intptr_t len);
445 RawImmutableArray* NewImmutableArray(intptr_t len); 445 RawImmutableArray* NewImmutableArray(intptr_t len);
446 RawOneByteString* NewOneByteString(intptr_t len); 446 RawOneByteString* NewOneByteString(intptr_t len);
447 RawTwoByteString* NewTwoByteString(intptr_t len); 447 RawTwoByteString* NewTwoByteString(intptr_t len);
448 RawTypeArguments* NewTypeArguments(intptr_t len); 448 RawTypeArguments* NewTypeArguments(intptr_t len);
449 RawTokenStream* NewTokenStream(intptr_t len); 449 RawTokenStream* NewTokenStream(intptr_t len);
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 } 1007 }
1008 const char* exception_msg() const { return exception_msg_; } 1008 const char* exception_msg() const { return exception_msg_; }
1009 void set_exception_msg(const char* msg) { 1009 void set_exception_msg(const char* msg) {
1010 exception_msg_ = msg; 1010 exception_msg_ = msg;
1011 } 1011 }
1012 bool can_send_any_object() const { return can_send_any_object_; } 1012 bool can_send_any_object() const { return can_send_any_object_; }
1013 bool writing_vm_isolate() const { return writing_vm_isolate_; } 1013 bool writing_vm_isolate() const { return writing_vm_isolate_; }
1014 void ThrowException(Exceptions::ExceptionType type, const char* msg); 1014 void ThrowException(Exceptions::ExceptionType type, const char* msg);
1015 1015
1016 // Write a version string for the snapshot. 1016 // Write a version string for the snapshot.
1017 void WriteVersion(); 1017 void WriteVersionAndFeatures();
1018 1018
1019 int32_t GetInstructionsId(RawInstructions* instructions, RawCode* code) { 1019 int32_t GetInstructionsId(RawInstructions* instructions, RawCode* code) {
1020 return instructions_writer_->GetOffsetFor(instructions, code); 1020 return instructions_writer_->GetOffsetFor(instructions, code);
1021 } 1021 }
1022 1022
1023 int32_t GetObjectId(RawObject* raw) { 1023 int32_t GetObjectId(RawObject* raw) {
1024 return instructions_writer_->GetObjectOffsetFor(raw); 1024 return instructions_writer_->GetObjectOffsetFor(raw);
1025 } 1025 }
1026 1026
1027 void WriteFunctionId(RawFunction* func, bool owner_is_class); 1027 void WriteFunctionId(RawFunction* func, bool owner_is_class);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 private: 1210 private:
1211 SnapshotWriter* writer_; 1211 SnapshotWriter* writer_;
1212 bool as_references_; 1212 bool as_references_;
1213 1213
1214 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 1214 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
1215 }; 1215 };
1216 1216
1217 } // namespace dart 1217 } // namespace dart
1218 1218
1219 #endif // VM_SNAPSHOT_H_ 1219 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698