mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
Output precompiled snapshot size.
R=fschneider@google.com Review URL: https://codereview.chromium.org/1414083004 .
This commit is contained in:
parent
f6b96b3d07
commit
862307ccac
|
@ -1951,6 +1951,15 @@ void FullSnapshotWriter::WriteFullSnapshot() {
|
||||||
if (snapshot_code_) {
|
if (snapshot_code_) {
|
||||||
instructions_writer_->WriteAssembly();
|
instructions_writer_->WriteAssembly();
|
||||||
instructions_snapshot_size_ = instructions_writer_->BytesWritten();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -804,14 +804,17 @@ class InstructionsWriter : public ZoneAllocated {
|
||||||
intptr_t initial_size)
|
intptr_t initial_size)
|
||||||
: stream_(buffer, alloc, initial_size),
|
: stream_(buffer, alloc, initial_size),
|
||||||
next_offset_(InstructionsSnapshot::kHeaderSize),
|
next_offset_(InstructionsSnapshot::kHeaderSize),
|
||||||
|
binary_size_(0),
|
||||||
instructions_() {
|
instructions_() {
|
||||||
ASSERT(buffer != NULL);
|
ASSERT(buffer != NULL);
|
||||||
ASSERT(alloc != NULL);
|
ASSERT(alloc != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Size of the snapshot.
|
// Size of the snapshot (assembly code).
|
||||||
intptr_t BytesWritten() const { return stream_.bytes_written(); }
|
intptr_t BytesWritten() const { return stream_.bytes_written(); }
|
||||||
|
|
||||||
|
intptr_t binary_size() { return binary_size_; }
|
||||||
|
|
||||||
int32_t GetOffsetFor(RawInstructions* instructions);
|
int32_t GetOffsetFor(RawInstructions* instructions);
|
||||||
|
|
||||||
void SetInstructionsCode(RawInstructions* insns, RawCode* code) {
|
void SetInstructionsCode(RawInstructions* insns, RawCode* code) {
|
||||||
|
@ -848,10 +851,12 @@ class InstructionsWriter : public ZoneAllocated {
|
||||||
#else
|
#else
|
||||||
stream_.Print(".long 0x%0.8" Px "\n", value);
|
stream_.Print(".long 0x%0.8" Px "\n", value);
|
||||||
#endif
|
#endif
|
||||||
|
binary_size_ += sizeof(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteStream stream_;
|
WriteStream stream_;
|
||||||
intptr_t next_offset_;
|
intptr_t next_offset_;
|
||||||
|
intptr_t binary_size_;
|
||||||
GrowableArray<InstructionsData> instructions_;
|
GrowableArray<InstructionsData> instructions_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(InstructionsWriter);
|
DISALLOW_COPY_AND_ASSIGN(InstructionsWriter);
|
||||||
|
|
Loading…
Reference in a new issue