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

Unified Diff: runtime/vm/snapshot.h

Issue 1414083004: Output precompiled snapshot size. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: \ Created 5 years, 1 month 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 | « no previous file | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.h
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index a95e28ebfda858656a1198facbae1f70d4c7f27e..51cf5caa98e56d4630f7f0701c4ea3b37f3f296f 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -804,14 +804,17 @@ class InstructionsWriter : public ZoneAllocated {
intptr_t initial_size)
: stream_(buffer, alloc, initial_size),
next_offset_(InstructionsSnapshot::kHeaderSize),
+ binary_size_(0),
instructions_() {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
- // Size of the snapshot.
+ // Size of the snapshot (assembly code).
intptr_t BytesWritten() const { return stream_.bytes_written(); }
+ intptr_t binary_size() { return binary_size_; }
+
int32_t GetOffsetFor(RawInstructions* instructions);
void SetInstructionsCode(RawInstructions* insns, RawCode* code) {
@@ -848,10 +851,12 @@ class InstructionsWriter : public ZoneAllocated {
#else
stream_.Print(".long 0x%0.8" Px "\n", value);
#endif
+ binary_size_ += sizeof(value);
}
WriteStream stream_;
intptr_t next_offset_;
+ intptr_t binary_size_;
GrowableArray<InstructionsData> instructions_;
DISALLOW_COPY_AND_ASSIGN(InstructionsWriter);
« no previous file with comments | « no previous file | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698