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

Unified Diff: runtime/vm/raw_object.h

Issue 1918313003: Split Snapshot::kFull into kCore, kAppWithJIT, and kAppNoJIT. Remove snapshot_code flag. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 2e67ee2d9b68434c4989cbe032c0b6eaa413bd18..33853ea6137353ac388a8fc643867c3932f9f322 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -921,14 +921,25 @@ class RawField : public RawObject {
// restore the value back to the original initial value.
RawInstance* saved_value_; // Saved initial value - static fields.
} initializer_;
- RawObject** to_precompiled_snapshot() {
- return reinterpret_cast<RawObject**>(&ptr()->initializer_);
- }
RawArray* dependent_code_;
RawSmi* guarded_list_length_;
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
}
+ RawObject** to_snapshot(Snapshot::Kind kind) {
+ switch (kind) {
+ case Snapshot::kCore:
+ case Snapshot::kScript:
+ return to();
+ case Snapshot::kAppWithJIT:
+ case Snapshot::kAppNoJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->initializer_);
+ case Snapshot::kMessage:
+ break;
+ }
+ UNREACHABLE();
+ return NULL;
+ }
TokenPosition token_pos_;
classid_t guarded_cid_;
@@ -992,15 +1003,23 @@ class RawScript : public RawObject {
RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->url_); }
RawString* url_;
- RawObject** to_precompiled_snapshot() {
- return reinterpret_cast<RawObject**>(&ptr()->url_);
- }
RawTokenStream* tokens_;
- RawObject** to_snapshot() {
- return reinterpret_cast<RawObject**>(&ptr()->tokens_);
- }
RawString* source_;
RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); }
+ RawObject** to_snapshot(Snapshot::Kind kind) {
+ switch (kind) {
+ case Snapshot::kAppNoJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->url_);
+ case Snapshot::kCore:
+ case Snapshot::kAppWithJIT:
+ case Snapshot::kScript:
+ return reinterpret_cast<RawObject**>(&ptr()->tokens_);
+ case Snapshot::kMessage:
+ break;
+ }
+ UNREACHABLE();
+ return NULL;
+ }
int32_t line_offset_;
int32_t col_offset_;
@@ -1471,13 +1490,24 @@ class RawICData : public RawObject {
RawArray* ic_data_; // Contains class-ids, target and count.
RawString* target_name_; // Name of target function.
RawArray* args_descriptor_; // Arguments descriptor.
- RawObject** to_precompiled_snapshot() {
- return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_);
- }
RawObject* owner_; // Parent/calling function or original IC of cloned IC.
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->owner_);
}
+ RawObject** to_snapshot(Snapshot::Kind kind) {
+ switch (kind) {
+ case Snapshot::kAppNoJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_);
+ case Snapshot::kCore:
+ case Snapshot::kScript:
+ case Snapshot::kAppWithJIT:
+ return to();
+ case Snapshot::kMessage:
+ break;
+ }
+ UNREACHABLE();
+ return NULL;
+ }
int32_t deopt_id_; // Deoptimization id corresponding to this IC.
uint32_t state_bits_; // Number of arguments tested in IC, deopt reasons,
// range feedback.
@@ -1589,15 +1619,26 @@ class RawLibraryPrefix : public RawInstance {
RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
RawString* name_; // Library prefix name.
RawLibrary* importer_; // Library which declares this prefix.
- RawObject** to_precompiled_snapshot() {
- return reinterpret_cast<RawObject**>(&ptr()->importer_);
- }
RawArray* imports_; // Libraries imported with this prefix.
RawArray* dependent_code_; // Code that refers to deferred, unloaded
// library prefix.
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->dependent_code_);
}
+ RawObject** to_snapshot(Snapshot::Kind kind) {
+ switch (kind) {
+ case Snapshot::kCore:
+ case Snapshot::kScript:
+ return to();
+ case Snapshot::kAppWithJIT:
+ case Snapshot::kAppNoJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->importer_);
+ case Snapshot::kMessage:
+ break;
+ }
+ UNREACHABLE();
+ return NULL;
+ }
uint16_t num_imports_; // Number of library entries in libraries_.
bool is_deferred_load_;
bool is_loaded_;
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698