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

Unified Diff: runtime/vm/snapshot.h

Issue 1336763002: Last snapshot bits to get working precompiled hello_world on x64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 3 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/snapshot.h
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index f612073aa625f5b310bc441067282e8e61547096..25aff579a9bd46195c690b84c7252f380f4bb339 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -32,6 +32,7 @@ class Library;
class Object;
class PassiveObject;
class ObjectStore;
+class MegamorphicCache;
class PageSpace;
class RawApiError;
class RawArray;
@@ -339,6 +340,8 @@ class SnapshotReader : public BaseReader {
ExternalTypedData* DataHandle() { return &data_; }
TypedData* TypedDataHandle() { return &typed_data_; }
Code* CodeHandle() { return &code_; }
+ Function* FunctionHandle() { return &function_; }
+ MegamorphicCache* MegamorphicCacheHandle() { return &megamorphic_cache_; }
Snapshot::Kind kind() const { return kind_; }
bool snapshot_code() const { return snapshot_code_; }
@@ -521,6 +524,8 @@ class SnapshotReader : public BaseReader {
ExternalTypedData& data_; // Temporary stream data handle.
TypedData& typed_data_; // Temporary typed data handle.
Code& code_; // Temporary code handle.
+ Function& function_; // Temporary function handle.
+ MegamorphicCache& megamorphic_cache_; // Temporary megamorphic cache handle.
UnhandledException& error_; // Error handle.
intptr_t max_vm_isolate_object_id_;
ZoneGrowableArray<BackRefNode>* backward_references_;
@@ -780,7 +785,7 @@ class InstructionsWriter : public ZoneAllocated {
ReAlloc alloc,
intptr_t initial_size)
: stream_(buffer, alloc, initial_size),
- next_offset_(0),
+ next_offset_(HeaderSize()),
instructions_() {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
@@ -803,6 +808,11 @@ class InstructionsWriter : public ZoneAllocated {
void WriteAssembly();
+ intptr_t HeaderSize() {
+ ASSERT(OS::kMaxPreferredCodeAlignment > sizeof(uint64_t));
+ return OS::kMaxPreferredCodeAlignment;
+ }
+
private:
struct InstructionsData {
explicit InstructionsData(RawInstructions* insns)

Powered by Google App Engine
This is Rietveld 408576698