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 {
}
void ZoneCreation(const Zone* zone) override {
double time = heap_->isolate()->time_millis_since_init();
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());
PrintZoneModificationSample(zone, "zonecreation");
nesting_deepth_.Increment(1);
}
void ZoneDestruction(const Zone* zone) override {
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(
"{"
"\"type\": \"zonedestruction\", "
"\"type\": \"%s\", "
"\"isolate\": \"%p\", "
"\"time\": %f, "
"\"ptr\": \"%p\", "
......@@ -2324,12 +2317,12 @@ class VerboseAccountingAllocator : public AccountingAllocator {
"\"size\": %" PRIuS
","
"\"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(),
zone->allocation_size(), nesting_deepth_.Value());
}
private:
void PrintMemoryJSON(size_t malloced, size_t pooled) {
// Note: Neither isolate, nor heap is locked, so be careful with accesses
// as the allocator is potentially used on a concurrent thread.
......@@ -2746,6 +2739,8 @@ void PrintBuiltinSizes(Isolate* isolate) {
bool Isolate::Init(StartupDeserializer* des) {
TRACE_ISOLATE(init);
time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs();
stress_deopt_count_ = FLAG_deopt_every_n_times;
force_slow_path_ = FLAG_force_slow_path;
......@@ -2909,8 +2904,6 @@ bool Isolate::Init(StartupDeserializer* des) {
OFFSET_OF(Isolate, heap_.external_memory_at_last_mark_compact_)),
Internals::kExternalMemoryAtLastMarkCompactOffset);
time_millis_at_init_ = heap_.MonotonicallyIncreasingTimeInMs();
{
HandleScope scope(this);
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