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

Unified Diff: runtime/vm/stub_code.h

Issue 2583673002: When creating a JIT app snapshot, don't recreate the VM isolate snapshot. (Closed)
Patch Set: Created 4 years 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/stub_code.h
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index 35d589d76cca51ff4efc7de8fff140a66be851ca..cba3cdf811c913fad1a81ffaf4feccbdabef16da 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -17,8 +17,6 @@ class ObjectPointerVisitor;
class RawCode;
class SnapshotReader;
class SnapshotWriter;
-class Serializer;
-class Deserializer;
// List of stubs created in the VM isolate, these stubs are shared by different
// isolates running in this dart process.
@@ -125,10 +123,6 @@ class StubCode : public AllStatic {
// only once and the stub code resides in the vm_isolate heap.
static void InitOnce();
- static void Push(Serializer* serializer);
- static void WriteRef(Serializer* serializer);
- static void ReadRef(Deserializer* deserializer);
-
// Generate all stubs which are generated on a per isolate basis as they
// have embedded objects which are isolate specific.
static void Init(Isolate* isolate);
@@ -150,7 +144,7 @@ class StubCode : public AllStatic {
// Define the shared stub code accessors.
#define STUB_CODE_ACCESSOR(name) \
- static const StubEntry* name##_entry() { return name##_entry_; } \
+ static const StubEntry* name##_entry() { return entries_[k##name##Index]; } \
static intptr_t name##Size() { return name##_entry()->Size(); }
VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR);
#undef STUB_CODE_ACCESSOR
@@ -161,6 +155,12 @@ class StubCode : public AllStatic {
static const intptr_t kNoInstantiator = 0;
+ static StubEntry* EntryAt(intptr_t index) { return entries_[index]; }
+ static void EntryAtPut(intptr_t index, StubEntry* entry) {
+ entries_[index] = entry;
+ }
+ static intptr_t NumEntries() { return kNumStubEntries; }
+
private:
friend class MegamorphicCacheTable;
@@ -168,12 +168,17 @@ class StubCode : public AllStatic {
#define STUB_CODE_GENERATE(name) \
static void Generate##name##Stub(Assembler* assembler);
- VM_STUB_CODE_LIST(STUB_CODE_GENERATE);
+ VM_STUB_CODE_LIST(STUB_CODE_GENERATE)
#undef STUB_CODE_GENERATE
-#define STUB_CODE_ENTRY(name) static StubEntry* name##_entry_;
- VM_STUB_CODE_LIST(STUB_CODE_ENTRY);
+ enum {
+#define STUB_CODE_ENTRY(name) k##name##Index,
+ VM_STUB_CODE_LIST(STUB_CODE_ENTRY)
#undef STUB_CODE_ENTRY
+ kNumStubEntries
+ };
+
+ static StubEntry* entries_[kNumStubEntries];
// Generate the stub and finalize the generated code into the stub
// code executable area.
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/stub_code.cc » ('j') | runtime/vm/stub_code.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698