Commit aea6250b authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Create isolate timestamp at the start of Isolate::Init

This way it can already be used during deserialization.

Bug: v8:7133
Change-Id: I6d6ddb6c6e5326384d014d653b163f3d917089e9
Reviewed-on: https://chromium-review.googlesource.com/793393Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49679}
parent e1028d71
...@@ -2296,27 +2296,20 @@ class VerboseAccountingAllocator : public AccountingAllocator { ...@@ -2296,27 +2296,20 @@ class VerboseAccountingAllocator : public AccountingAllocator {
} }
void ZoneCreation(const Zone* zone) override { void ZoneCreation(const Zone* zone) override {
double time = heap_->isolate()->time_millis_since_init(); PrintZoneModificationSample(zone, "zonecreation");
PrintF(
"{"
"\"type\": \"zonecreation\", "
"\"isolate\": \"%p\", "
"\"time\": %f, "
"\"ptr\": \"%p\", "
"\"name\": \"%s\","
"\"nesting\": %" PRIuS "}\n",
reinterpret_cast<void*>(heap_->isolate()), time,
reinterpret_cast<const void*>(zone), zone->name(),
nesting_deepth_.Value());
nesting_deepth_.Increment(1); nesting_deepth_.Increment(1);
} }
void ZoneDestruction(const Zone* zone) override { void ZoneDestruction(const Zone* zone) override {
nesting_deepth_.Decrement(1); nesting_deepth_.Decrement(1);
double time = heap_->isolate()->time_millis_since_init(); PrintZoneModificationSample(zone, "zonedestruction");
}
private:
void PrintZoneModificationSample(const Zone* zone, const char* type) {
PrintF( PrintF(
"{" "{"
"\"type\": \"zonedestruction\", " "\"type\": \"%s\", "
"\"isolate\": \"%p\", " "\"isolate\": \"%p\", "
"\"time\": %f, " "\"time\": %f, "
"\"ptr\": \"%p\", " "\"ptr\": \"%p\", "
...@@ -2324,12 +2317,12 @@ class VerboseAccountingAllocator : public AccountingAllocator { ...@@ -2324,12 +2317,12 @@ class VerboseAccountingAllocator : public AccountingAllocator {
"\"size\": %" PRIuS "\"size\": %" PRIuS
"," ","
"\"nesting\": %" PRIuS "}\n", "\"nesting\": %" PRIuS "}\n",
reinterpret_cast<void*>(heap_->isolate()), time, type, reinterpret_cast<void*>(heap_->isolate()),
heap_->isolate()->time_millis_since_init(),
reinterpret_cast<const void*>(zone), zone->name(), reinterpret_cast<const void*>(zone), zone->name(),
zone->allocation_size(), nesting_deepth_.Value()); zone->allocation_size(), nesting_deepth_.Value());
} }
private:
void PrintMemoryJSON(size_t malloced, size_t pooled) { void PrintMemoryJSON(size_t malloced, size_t pooled) {
// Note: Neither isolate, nor heap is locked, so be careful with accesses // Note: Neither isolate, nor heap is locked, so be careful with accesses
// as the allocator is potentially used on a concurrent thread. // as the allocator is potentially used on a concurrent thread.
...@@ -2746,6 +2739,8 @@ void PrintBuiltinSizes(Isolate* isolate) { ...@@ -2746,6 +2739,8 @@ void PrintBuiltinSizes(Isolate* isolate) {
bool Isolate::Init(StartupDeserializer* des) { bool Isolate::Init(StartupDeserializer* des) {
TRACE_ISOLATE(init); TRACE_ISOLATE(init);
time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs();
stress_deopt_count_ = FLAG_deopt_every_n_times; stress_deopt_count_ = FLAG_deopt_every_n_times;
force_slow_path_ = FLAG_force_slow_path; force_slow_path_ = FLAG_force_slow_path;
...@@ -2909,8 +2904,6 @@ bool Isolate::Init(StartupDeserializer* des) { ...@@ -2909,8 +2904,6 @@ bool Isolate::Init(StartupDeserializer* des) {
OFFSET_OF(Isolate, heap_.external_memory_at_last_mark_compact_)), OFFSET_OF(Isolate, heap_.external_memory_at_last_mark_compact_)),
Internals::kExternalMemoryAtLastMarkCompactOffset); Internals::kExternalMemoryAtLastMarkCompactOffset);
time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs();
{ {
HandleScope scope(this); HandleScope scope(this);
ast_string_constants_ = new AstStringConstants(this, heap()->HashSeed()); ast_string_constants_ = new AstStringConstants(this, heap()->HashSeed());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment