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

Unified Diff: runtime/vm/raw_object.h

Issue 1930263002: Don't include dependent code arrays in snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index ff32dcd23d28fd94cc38017fdd9245b019f17712..9f1f4fcf61859aa226949f87fecb0ccb4e7c0dc9 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -709,9 +709,22 @@ class RawClass : public RawObject {
RawArray* invocation_dispatcher_cache_; // Cache for dispatcher functions.
RawCode* allocation_stub_; // Stub code for allocation of instances.
RawGrowableObjectArray* direct_subclasses_; // Array of Class.
- RawArray* cha_codes_; // CHA optimized codes.
+ RawArray* dependent_code_; // CHA optimized codes.
RawObject** to() {
- return reinterpret_cast<RawObject**>(&ptr()->cha_codes_);
+ return reinterpret_cast<RawObject**>(&ptr()->dependent_code_);
+ }
+ RawObject** to_snapshot(Snapshot::Kind kind) {
+ switch (kind) {
+ case Snapshot::kCore:
+ case Snapshot::kScript:
+ case Snapshot::kAppWithJIT:
+ case Snapshot::kAppNoJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->direct_subclasses_);
+ case Snapshot::kMessage:
+ break;
+ }
+ UNREACHABLE();
+ return NULL;
}
cpp_vtable handle_vtable_;
@@ -922,17 +935,17 @@ class RawField : public RawObject {
// restore the value back to the original initial value.
RawInstance* saved_value_; // Saved initial value - static fields.
} initializer_;
- RawArray* dependent_code_;
RawSmi* guarded_list_length_;
+ RawArray* dependent_code_;
RawObject** to() {
- return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
+ 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:
+ return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
case Snapshot::kAppNoJIT:
return reinterpret_cast<RawObject**>(&ptr()->initializer_);
case Snapshot::kMessage:
@@ -1630,8 +1643,8 @@ class RawLibraryPrefix : public RawInstance {
switch (kind) {
case Snapshot::kCore:
case Snapshot::kScript:
- return to();
case Snapshot::kAppWithJIT:
+ return reinterpret_cast<RawObject**>(&ptr()->imports_);
case Snapshot::kAppNoJIT:
return reinterpret_cast<RawObject**>(&ptr()->importer_);
case Snapshot::kMessage:

Powered by Google App Engine
This is Rietveld 408576698