Output precompiled snapshot size.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1414083004 .
This commit is contained in:
Ryan Macnak 2015-11-04 15:13:16 -08:00
parent f6b96b3d07
commit 862307ccac
2 changed files with 15 additions and 1 deletions

View file

@ -1951,6 +1951,15 @@ void FullSnapshotWriter::WriteFullSnapshot() {
if (snapshot_code_) {
instructions_writer_->WriteAssembly();
instructions_snapshot_size_ = instructions_writer_->BytesWritten();
OS::Print("VMIsolate(CodeSize): %" Pd "\n", VmIsolateSnapshotSize());
OS::Print("Isolate(CodeSize): %" Pd "\n", IsolateSnapshotSize());
OS::Print("Instructions(CodeSize): %" Pd "\n",
instructions_writer_->binary_size());
intptr_t total = VmIsolateSnapshotSize() +
IsolateSnapshotSize() +
instructions_writer_->binary_size();
OS::Print("Total(CodeSize): %" Pd "\n", total);
}
}

View file

@ -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);