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

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
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 Object* GetBackRef(intptr_t id); 435 Object* GetBackRef(intptr_t id);
436 436
437 // Read a full snap shot. 437 // Read a full snap shot.
438 RawApiError* ReadFullSnapshot(); 438 RawApiError* ReadFullSnapshot();
439 439
440 // Read a script snap shot. 440 // Read a script snap shot.
441 RawObject* ReadScriptSnapshot(); 441 RawObject* ReadScriptSnapshot();
442 442
443 // Read version number of snapshot and verify. 443 // Read version number of snapshot and verify.
444 RawApiError* VerifyVersion(); 444 RawApiError* VerifyVersion();
445 RawApiError* VerifyFeatures();
445 446
446 // Helper functions for creating uninitialized versions 447 // Helper functions for creating uninitialized versions
447 // of various object types. These are used when reading a 448 // of various object types. These are used when reading a
448 // full snapshot. 449 // full snapshot.
449 RawArray* NewArray(intptr_t len); 450 RawArray* NewArray(intptr_t len);
450 RawImmutableArray* NewImmutableArray(intptr_t len); 451 RawImmutableArray* NewImmutableArray(intptr_t len);
451 RawOneByteString* NewOneByteString(intptr_t len); 452 RawOneByteString* NewOneByteString(intptr_t len);
452 RawTwoByteString* NewTwoByteString(intptr_t len); 453 RawTwoByteString* NewTwoByteString(intptr_t len);
453 RawTypeArguments* NewTypeArguments(intptr_t len); 454 RawTypeArguments* NewTypeArguments(intptr_t len);
454 RawTokenStream* NewTokenStream(intptr_t len); 455 RawTokenStream* NewTokenStream(intptr_t len);
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 const char* exception_msg() const { return exception_msg_; } 1014 const char* exception_msg() const { return exception_msg_; }
1014 void set_exception_msg(const char* msg) { 1015 void set_exception_msg(const char* msg) {
1015 exception_msg_ = msg; 1016 exception_msg_ = msg;
1016 } 1017 }
1017 bool can_send_any_object() const { return can_send_any_object_; } 1018 bool can_send_any_object() const { return can_send_any_object_; }
1018 bool writing_vm_isolate() const { return writing_vm_isolate_; } 1019 bool writing_vm_isolate() const { return writing_vm_isolate_; }
1019 void ThrowException(Exceptions::ExceptionType type, const char* msg); 1020 void ThrowException(Exceptions::ExceptionType type, const char* msg);
1020 1021
1021 // Write a version string for the snapshot. 1022 // Write a version string for the snapshot.
1022 void WriteVersion(); 1023 void WriteVersion();
1024 void WriteFeatures();
siva 2016/05/16 16:48:00 The comment is incorrect as it writes more than th
rmacnak 2016/05/16 20:59:56 I started out thinking the features string wouldn'
1023 1025
1024 int32_t GetInstructionsId(RawInstructions* instructions, RawCode* code) { 1026 int32_t GetInstructionsId(RawInstructions* instructions, RawCode* code) {
1025 return instructions_writer_->GetOffsetFor(instructions, code); 1027 return instructions_writer_->GetOffsetFor(instructions, code);
1026 } 1028 }
1027 1029
1028 int32_t GetObjectId(RawObject* raw) { 1030 int32_t GetObjectId(RawObject* raw) {
1029 return instructions_writer_->GetObjectOffsetFor(raw); 1031 return instructions_writer_->GetObjectOffsetFor(raw);
1030 } 1032 }
1031 1033
1032 void WriteFunctionId(RawFunction* func, bool owner_is_class); 1034 void WriteFunctionId(RawFunction* func, bool owner_is_class);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 private: 1217 private:
1216 SnapshotWriter* writer_; 1218 SnapshotWriter* writer_;
1217 bool as_references_; 1219 bool as_references_;
1218 1220
1219 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor); 1221 DISALLOW_COPY_AND_ASSIGN(SnapshotWriterVisitor);
1220 }; 1222 };
1221 1223
1222 } // namespace dart 1224 } // namespace dart
1223 1225
1224 #endif // VM_SNAPSHOT_H_ 1226 #endif // VM_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/snapshot.cc » ('j') | runtime/vm/snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698