summaryrefslogtreecommitdiff
path: root/deps/v8/src/profiler
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2018-05-31 11:11:57 +0200
committerMyles Borins <mylesborins@google.com>2018-06-01 09:58:27 +0200
commit352a525eb984b8fa2d6f0f6fd68395e6a080bba4 (patch)
treea105ae93f8fd8f533cce19a429f1b6e95d6e11ca /deps/v8/src/profiler
parentfaf449ca0490f5371dc6cbbc94a87eb697b00fcc (diff)
downloadandroid-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.tar.gz
android-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.tar.bz2
android-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.zip
deps: update V8 to 6.7.288.43
PR-URL: https://github.com/nodejs/node/pull/19989 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/profiler')
-rw-r--r--deps/v8/src/profiler/allocation-tracker.cc2
-rw-r--r--deps/v8/src/profiler/heap-profiler.cc10
-rw-r--r--deps/v8/src/profiler/heap-profiler.h7
-rw-r--r--deps/v8/src/profiler/heap-snapshot-generator.cc214
-rw-r--r--deps/v8/src/profiler/heap-snapshot-generator.h10
-rw-r--r--deps/v8/src/profiler/profile-generator.cc2
-rw-r--r--deps/v8/src/profiler/profiler-listener.cc28
-rw-r--r--deps/v8/src/profiler/profiler-listener.h6
-rw-r--r--deps/v8/src/profiler/sampling-heap-profiler.cc2
9 files changed, 162 insertions, 119 deletions
diff --git a/deps/v8/src/profiler/allocation-tracker.cc b/deps/v8/src/profiler/allocation-tracker.cc
index b2b9392319..3dad4ae208 100644
--- a/deps/v8/src/profiler/allocation-tracker.cc
+++ b/deps/v8/src/profiler/allocation-tracker.cc
@@ -261,7 +261,7 @@ unsigned AllocationTracker::AddFunctionInfo(SharedFunctionInfo* shared,
// Converting start offset into line and column may cause heap
// allocations so we postpone them until snapshot serialization.
unresolved_locations_.push_back(
- new UnresolvedLocation(script, shared->start_position(), info));
+ new UnresolvedLocation(script, shared->StartPosition(), info));
}
entry->value = reinterpret_cast<void*>(function_info_list_.size());
function_info_list_.push_back(info);
diff --git a/deps/v8/src/profiler/heap-profiler.cc b/deps/v8/src/profiler/heap-profiler.cc
index 9dbe3ff5bd..7e0bcec97a 100644
--- a/deps/v8/src/profiler/heap-profiler.cc
+++ b/deps/v8/src/profiler/heap-profiler.cc
@@ -132,10 +132,10 @@ v8::AllocationProfile* HeapProfiler::GetAllocationProfile() {
void HeapProfiler::StartHeapObjectsTracking(bool track_allocations) {
ids_->UpdateHeapObjectsMap();
is_tracking_object_moves_ = true;
- DCHECK(!is_tracking_allocations());
+ DCHECK(!allocation_tracker_);
if (track_allocations) {
allocation_tracker_.reset(new AllocationTracker(ids_.get(), names_.get()));
- heap()->DisableInlineAllocation();
+ heap()->AddHeapObjectAllocationTracker(this);
heap()->isolate()->debug()->feature_tracker()->Track(
DebugFeatureTracker::kAllocationTracking);
}
@@ -148,9 +148,9 @@ SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream,
void HeapProfiler::StopHeapObjectsTracking() {
ids_->StopHeapObjectsTracking();
- if (is_tracking_allocations()) {
+ if (allocation_tracker_) {
allocation_tracker_.reset();
- heap()->EnableInlineAllocation();
+ heap()->RemoveHeapObjectAllocationTracker(this);
}
}
@@ -206,7 +206,7 @@ Handle<HeapObject> HeapProfiler::FindHeapObjectById(SnapshotObjectId id) {
void HeapProfiler::ClearHeapObjectMap() {
ids_.reset(new HeapObjectsMap(heap()));
- if (!is_tracking_allocations()) is_tracking_object_moves_ = false;
+ if (!allocation_tracker_) is_tracking_object_moves_ = false;
}
diff --git a/deps/v8/src/profiler/heap-profiler.h b/deps/v8/src/profiler/heap-profiler.h
index d37a882805..507dd579bf 100644
--- a/deps/v8/src/profiler/heap-profiler.h
+++ b/deps/v8/src/profiler/heap-profiler.h
@@ -24,7 +24,7 @@ class HeapSnapshot;
class SamplingHeapProfiler;
class StringsStorage;
-class HeapProfiler {
+class HeapProfiler : public HeapObjectAllocationTracker {
public:
explicit HeapProfiler(Heap* heap);
~HeapProfiler();
@@ -57,9 +57,9 @@ class HeapProfiler {
void ObjectMoveEvent(Address from, Address to, int size);
- void AllocationEvent(Address addr, int size);
+ void AllocationEvent(Address addr, int size) override;
- void UpdateObjectSizeEvent(Address addr, int size);
+ void UpdateObjectSizeEvent(Address addr, int size) override;
void DefineWrapperClass(
uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback);
@@ -79,7 +79,6 @@ class HeapProfiler {
}
bool is_tracking_object_moves() const { return is_tracking_object_moves_; }
- bool is_tracking_allocations() const { return !!allocation_tracker_; }
Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id);
void ClearHeapObjectMap();
diff --git a/deps/v8/src/profiler/heap-snapshot-generator.cc b/deps/v8/src/profiler/heap-snapshot-generator.cc
index b1e033c5f5..fb61246867 100644
--- a/deps/v8/src/profiler/heap-snapshot-generator.cc
+++ b/deps/v8/src/profiler/heap-snapshot-generator.cc
@@ -161,6 +161,8 @@ const char* HeapEntry::TypeAsString() {
case kConsString: return "/concatenated string/";
case kSlicedString: return "/sliced string/";
case kSymbol: return "/symbol/";
+ case kBigInt:
+ return "/bigint/";
default: return "???";
}
}
@@ -602,7 +604,7 @@ HeapEntry* V8HeapExplorer::AddEntry(HeapObject* object) {
if (object->IsJSFunction()) {
JSFunction* func = JSFunction::cast(object);
SharedFunctionInfo* shared = func->shared();
- const char* name = names_->GetName(shared->name());
+ const char* name = names_->GetName(shared->Name());
return AddEntry(object, HeapEntry::kClosure, name);
} else if (object->IsJSBoundFunction()) {
return AddEntry(object, HeapEntry::kClosure, "native_bind");
@@ -639,10 +641,12 @@ HeapEntry* V8HeapExplorer::AddEntry(HeapObject* object) {
return AddEntry(object, HeapEntry::kHidden, "private symbol");
else
return AddEntry(object, HeapEntry::kSymbol, "symbol");
+ } else if (object->IsBigInt()) {
+ return AddEntry(object, HeapEntry::kBigInt, "bigint");
} else if (object->IsCode()) {
return AddEntry(object, HeapEntry::kCode, "");
} else if (object->IsSharedFunctionInfo()) {
- String* name = SharedFunctionInfo::cast(object)->name();
+ String* name = SharedFunctionInfo::cast(object)->Name();
return AddEntry(object,
HeapEntry::kCode,
names_->GetName(name));
@@ -790,20 +794,33 @@ class IndexedReferencesExtractor : public ObjectVisitor {
parent_obj_(parent_obj),
parent_start_(HeapObject::RawField(parent_obj_, 0)),
parent_end_(HeapObject::RawField(parent_obj_, parent_obj_->Size())),
- parent_(parent),
- next_index_(0) {}
+ parent_(parent) {}
void VisitPointers(HeapObject* host, Object** start, Object** end) override {
- for (Object** p = start; p < end; p++) {
- int index = static_cast<int>(p - HeapObject::RawField(parent_obj_, 0));
- ++next_index_;
+ VisitPointers(host, reinterpret_cast<MaybeObject**>(start),
+ reinterpret_cast<MaybeObject**>(end));
+ }
+ void VisitPointers(HeapObject* host, MaybeObject** start,
+ MaybeObject** end) override {
+ int next_index = 0;
+ for (MaybeObject** p = start; p < end; p++) {
+ int index = static_cast<int>(reinterpret_cast<Object**>(p) -
+ HeapObject::RawField(parent_obj_, 0));
+ ++next_index;
// |p| could be outside of the object, e.g., while visiting RelocInfo of
// code objects.
- if (p >= parent_start_ && p < parent_end_ && generator_->marks_[index]) {
- generator_->marks_[index] = false;
+ if (reinterpret_cast<Object**>(p) >= parent_start_ &&
+ reinterpret_cast<Object**>(p) < parent_end_ &&
+ generator_->visited_fields_[index]) {
+ generator_->visited_fields_[index] = false;
continue;
}
- generator_->SetHiddenReference(parent_obj_, parent_, next_index_, *p,
- index * kPointerSize);
+ HeapObject* heap_object;
+ // Weak references have been handled explicitly.
+ DCHECK(!(*p)->ToWeakHeapObject(&heap_object));
+ if ((*p)->ToStrongHeapObject(&heap_object)) {
+ generator_->SetHiddenReference(parent_obj_, parent_, next_index,
+ heap_object, index * kPointerSize);
+ }
}
}
@@ -813,7 +830,6 @@ class IndexedReferencesExtractor : public ObjectVisitor {
Object** parent_start_;
Object** parent_end_;
int parent_;
- int next_index_;
};
@@ -863,6 +879,10 @@ bool V8HeapExplorer::ExtractReferencesPass1(int entry, HeapObject* obj) {
ExtractPropertyCellReferences(entry, PropertyCell::cast(obj));
} else if (obj->IsAllocationSite()) {
ExtractAllocationSiteReferences(entry, AllocationSite::cast(obj));
+ } else if (obj->IsFeedbackVector()) {
+ ExtractFeedbackVectorReferences(entry, FeedbackVector::cast(obj));
+ } else if (obj->IsWeakFixedArray()) {
+ ExtractWeakFixedArrayReferences(entry, WeakFixedArray::cast(obj));
}
return true;
}
@@ -1015,8 +1035,8 @@ void V8HeapExplorer::ExtractJSWeakCollectionReferences(int entry,
}
void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
- if (context == context->declaration_context()) {
- ScopeInfo* scope_info = context->closure()->shared()->scope_info();
+ if (!context->IsNativeContext() && context->is_declaration_context()) {
+ ScopeInfo* scope_info = context->scope_info();
// Add context allocated locals.
int context_locals = scope_info->ContextLocalCount();
for (int i = 0; i < context_locals; ++i) {
@@ -1026,7 +1046,7 @@ void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
Context::OffsetOfElementAt(idx));
}
if (scope_info->HasFunctionName()) {
- String* name = scope_info->FunctionName();
+ String* name = String::cast(scope_info->FunctionName());
int idx = scope_info->FunctionContextSlotIndex(name);
if (idx >= 0) {
SetContextReference(context, entry, name, context->get(idx),
@@ -1065,30 +1085,40 @@ void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) {
- Object* raw_transitions_or_prototype_info = map->raw_transitions();
- if (raw_transitions_or_prototype_info->IsTransitionArray()) {
- TransitionArray* transitions =
- TransitionArray::cast(raw_transitions_or_prototype_info);
- if (map->CanTransition() && transitions->HasPrototypeTransitions()) {
- TagObject(transitions->GetPrototypeTransitions(),
- "(prototype transitions)");
+ MaybeObject* maybe_raw_transitions_or_prototype_info = map->raw_transitions();
+ HeapObject* raw_transitions_or_prototype_info;
+ if (maybe_raw_transitions_or_prototype_info->ToWeakHeapObject(
+ &raw_transitions_or_prototype_info)) {
+ DCHECK(raw_transitions_or_prototype_info->IsMap());
+ SetWeakReference(map, entry, "transition",
+ raw_transitions_or_prototype_info,
+ Map::kTransitionsOrPrototypeInfoOffset);
+ } else if (maybe_raw_transitions_or_prototype_info->ToStrongHeapObject(
+ &raw_transitions_or_prototype_info)) {
+ DCHECK(!raw_transitions_or_prototype_info->IsWeakCell());
+
+ if (raw_transitions_or_prototype_info->IsTransitionArray()) {
+ TransitionArray* transitions =
+ TransitionArray::cast(raw_transitions_or_prototype_info);
+ if (map->CanTransition() && transitions->HasPrototypeTransitions()) {
+ TagObject(transitions->GetPrototypeTransitions(),
+ "(prototype transitions)");
+ }
+ TagObject(transitions, "(transition array)");
+ SetInternalReference(map, entry, "transitions", transitions,
+ Map::kTransitionsOrPrototypeInfoOffset);
+ } else if (raw_transitions_or_prototype_info->IsTuple3() ||
+ raw_transitions_or_prototype_info->IsFixedArray()) {
+ TagObject(raw_transitions_or_prototype_info, "(transition)");
+ SetInternalReference(map, entry, "transition",
+ raw_transitions_or_prototype_info,
+ Map::kTransitionsOrPrototypeInfoOffset);
+ } else if (map->is_prototype_map()) {
+ TagObject(raw_transitions_or_prototype_info, "prototype_info");
+ SetInternalReference(map, entry, "prototype_info",
+ raw_transitions_or_prototype_info,
+ Map::kTransitionsOrPrototypeInfoOffset);
}
-
- TagObject(transitions, "(transition array)");
- SetInternalReference(map, entry, "transitions", transitions,
- Map::kTransitionsOrPrototypeInfoOffset);
- } else if (raw_transitions_or_prototype_info->IsWeakCell() ||
- raw_transitions_or_prototype_info->IsTuple3() ||
- raw_transitions_or_prototype_info->IsFixedArray()) {
- TagObject(raw_transitions_or_prototype_info, "(transition)");
- SetInternalReference(map, entry, "transition",
- raw_transitions_or_prototype_info,
- Map::kTransitionsOrPrototypeInfoOffset);
- } else if (map->is_prototype_map()) {
- TagObject(raw_transitions_or_prototype_info, "prototype_info");
- SetInternalReference(map, entry, "prototype_info",
- raw_transitions_or_prototype_info,
- Map::kTransitionsOrPrototypeInfoOffset);
}
DescriptorArray* descriptors = map->instance_descriptors();
TagObject(descriptors, "(map descriptors)");
@@ -1131,31 +1161,22 @@ void V8HeapExplorer::ExtractSharedFunctionInfoReferences(
const char* name = nullptr;
if (shared_name != heap_->empty_string()) {
name = names_->GetName(shared_name);
- TagObject(shared->code(), names_->GetFormatted("(code for %s)", name));
+ TagObject(shared->GetCode(), names_->GetFormatted("(code for %s)", name));
} else {
- TagObject(shared->code(), names_->GetFormatted("(%s code)",
- Code::Kind2String(shared->code()->kind())));
+ TagObject(shared->GetCode(),
+ names_->GetFormatted(
+ "(%s code)", Code::Kind2String(shared->GetCode()->kind())));
}
- SetInternalReference(obj, entry, "raw_name", shared->raw_name(),
- SharedFunctionInfo::kNameOffset);
- SetInternalReference(obj, entry,
- "code", shared->code(),
- SharedFunctionInfo::kCodeOffset);
- TagObject(shared->scope_info(), "(function scope info)");
- SetInternalReference(obj, entry,
- "scope_info", shared->scope_info(),
- SharedFunctionInfo::kScopeInfoOffset);
+ if (shared->name_or_scope_info()->IsScopeInfo()) {
+ TagObject(shared->name_or_scope_info(), "(function scope info)");
+ }
+ SetInternalReference(obj, entry, "name_or_scope_info",
+ shared->name_or_scope_info(),
+ SharedFunctionInfo::kNameOrScopeInfoOffset);
SetInternalReference(obj, entry,
"script", shared->script(),
SharedFunctionInfo::kScriptOffset);
- const char* construct_stub_name = name ?
- names_->GetFormatted("(construct stub code for %s)", name) :
- "(construct stub code)";
- TagObject(shared->construct_stub(), construct_stub_name);
- SetInternalReference(obj, entry,
- "construct_stub", shared->construct_stub(),
- SharedFunctionInfo::kConstructStubOffset);
SetInternalReference(obj, entry,
"function_data", shared->function_data(),
SharedFunctionInfo::kFunctionDataOffset);
@@ -1165,12 +1186,12 @@ void V8HeapExplorer::ExtractSharedFunctionInfoReferences(
SetInternalReference(obj, entry, "function_identifier",
shared->function_identifier(),
SharedFunctionInfo::kFunctionIdentifierOffset);
- SetInternalReference(obj, entry, "feedback_metadata",
- shared->feedback_metadata(),
- SharedFunctionInfo::kFeedbackMetadataOffset);
+ SetInternalReference(
+ obj, entry, "raw_outer_scope_info_or_feedback_metadata",
+ shared->raw_outer_scope_info_or_feedback_metadata(),
+ SharedFunctionInfo::kOuterScopeInfoOrFeedbackMetadataOffset);
}
-
void V8HeapExplorer::ExtractScriptReferences(int entry, Script* script) {
HeapObject* obj = script;
SetInternalReference(obj, entry,
@@ -1343,8 +1364,10 @@ void V8HeapExplorer::ExtractFixedArrayReferences(int entry, FixedArray* array) {
int key_entry_index = key_entry->index();
HeapEntry* value_entry = GetEntry(value);
if (key_entry && value_entry) {
+ const char* edge_name =
+ names_->GetFormatted("key %s in WeakMap", key_entry->name());
filler_->SetNamedAutoIndexReference(HeapGraphEdge::kInternal,
- key_entry_index, "WeakMap",
+ key_entry_index, edge_name,
value_entry);
}
}
@@ -1362,6 +1385,28 @@ void V8HeapExplorer::ExtractFixedArrayReferences(int entry, FixedArray* array) {
}
}
+void V8HeapExplorer::ExtractFeedbackVectorReferences(
+ int entry, FeedbackVector* feedback_vector) {
+ MaybeObject* code = feedback_vector->optimized_code_weak_or_smi();
+ HeapObject* code_heap_object;
+ if (code->ToWeakHeapObject(&code_heap_object)) {
+ SetWeakReference(feedback_vector, entry, "optimized code", code_heap_object,
+ FeedbackVector::kOptimizedCodeOffset);
+ }
+}
+
+void V8HeapExplorer::ExtractWeakFixedArrayReferences(int entry,
+ WeakFixedArray* array) {
+ for (int i = 0; i < array->length(); ++i) {
+ MaybeObject* object = array->Get(i);
+ HeapObject* heap_object;
+ if (object->ToWeakHeapObject(&heap_object)) {
+ SetWeakReference(array, entry, i, heap_object,
+ WeakFixedArray::kHeaderSize + i * kPointerSize);
+ }
+ }
+}
+
void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) {
Isolate* isolate = js_obj->GetIsolate();
if (js_obj->HasFastProperties()) {
@@ -1565,11 +1610,11 @@ bool V8HeapExplorer::IterateAndExtractSinglePass() {
if (interrupted) continue;
size_t max_pointer = obj->Size() / kPointerSize;
- if (max_pointer > marks_.size()) {
+ if (max_pointer > visited_fields_.size()) {
// Clear the current bits.
- std::vector<bool>().swap(marks_);
+ std::vector<bool>().swap(visited_fields_);
// Reallocate to right size.
- marks_.resize(max_pointer, false);
+ visited_fields_.resize(max_pointer, false);
}
HeapEntry* heap_entry = GetEntry(obj);
@@ -1582,6 +1627,10 @@ bool V8HeapExplorer::IterateAndExtractSinglePass() {
IndexedReferencesExtractor refs_extractor(this, obj, entry);
obj->Iterate(&refs_extractor);
}
+ // Ensure visited_fields_ doesn't leak to the next object.
+ for (size_t i = 0; i < max_pointer; ++i) {
+ DCHECK(!visited_fields_[i]);
+ }
if (!progress_->ProgressReport(false)) interrupted = true;
}
@@ -1593,6 +1642,7 @@ bool V8HeapExplorer::IsEssentialObject(Object* object) {
return object->IsHeapObject() && !object->IsOddball() &&
object != heap_->empty_byte_array() &&
object != heap_->empty_fixed_array() &&
+ object != heap_->empty_weak_fixed_array() &&
object != heap_->empty_descriptor_array() &&
object != heap_->fixed_array_map() && object != heap_->cell_map() &&
object != heap_->global_property_cell_map() &&
@@ -1626,15 +1676,14 @@ void V8HeapExplorer::SetContextReference(HeapObject* parent_obj,
if (child_entry == nullptr) return;
filler_->SetNamedReference(HeapGraphEdge::kContextVariable, parent_entry,
names_->GetName(reference_name), child_entry);
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
-
-void V8HeapExplorer::MarkVisitedField(HeapObject* obj, int offset) {
+void V8HeapExplorer::MarkVisitedField(int offset) {
if (offset < 0) return;
int index = offset / kPointerSize;
- DCHECK(!marks_[index]);
- marks_[index] = true;
+ DCHECK(!visited_fields_[index]);
+ visited_fields_[index] = true;
}
@@ -1676,7 +1725,7 @@ void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj,
reference_name,
child_entry);
}
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
@@ -1694,7 +1743,7 @@ void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj,
names_->GetName(index),
child_entry);
}
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj,
@@ -1724,7 +1773,7 @@ void V8HeapExplorer::SetWeakReference(HeapObject* parent_obj,
reference_name,
child_entry);
}
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
@@ -1742,7 +1791,7 @@ void V8HeapExplorer::SetWeakReference(HeapObject* parent_obj,
names_->GetFormatted("%d", index),
child_entry);
}
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
@@ -1783,7 +1832,7 @@ void V8HeapExplorer::SetPropertyReference(HeapObject* parent_obj,
: names_->GetName(reference_name);
filler_->SetNamedReference(type, parent_entry, name, child_entry);
- MarkVisitedField(parent_obj, field_offset);
+ MarkVisitedField(field_offset);
}
void V8HeapExplorer::SetRootGcRootsReference() {
@@ -2460,9 +2509,15 @@ bool HeapSnapshotGenerator::ProgressReport(bool force) {
void HeapSnapshotGenerator::SetProgressTotal(int iterations_count) {
if (control_ == nullptr) return;
HeapIterator iterator(heap_, HeapIterator::kFilterUnreachable);
- progress_total_ = iterations_count * (
- v8_heap_explorer_.EstimateObjectsCount(&iterator) +
- dom_explorer_.EstimateObjectsCount());
+ // The +1 ensures that intermediate ProgressReport calls will never signal
+ // that the work is finished (i.e. progress_counter_ == progress_total_).
+ // Only the forced ProgressReport() at the end of GenerateSnapshot()
+ // should signal that the work is finished because signalling finished twice
+ // breaks the DevTools frontend.
+ progress_total_ =
+ iterations_count * (v8_heap_explorer_.EstimateObjectsCount(&iterator) +
+ dom_explorer_.EstimateObjectsCount()) +
+ 1;
progress_counter_ = 0;
}
@@ -2780,7 +2835,8 @@ void HeapSnapshotJSONSerializer::SerializeSnapshot() {
JSON_S("synthetic") ","
JSON_S("concatenated string") ","
JSON_S("sliced string") ","
- JSON_S("symbol")) ","
+ JSON_S("symbol") ","
+ JSON_S("bigint")) ","
JSON_S("string") ","
JSON_S("number") ","
JSON_S("number") ","
diff --git a/deps/v8/src/profiler/heap-snapshot-generator.h b/deps/v8/src/profiler/heap-snapshot-generator.h
index 5c7d88e0ca..8e492807e9 100644
--- a/deps/v8/src/profiler/heap-snapshot-generator.h
+++ b/deps/v8/src/profiler/heap-snapshot-generator.h
@@ -99,7 +99,8 @@ class HeapEntry BASE_EMBEDDED {
kSynthetic = v8::HeapGraphNode::kSynthetic,
kConsString = v8::HeapGraphNode::kConsString,
kSlicedString = v8::HeapGraphNode::kSlicedString,
- kSymbol = v8::HeapGraphNode::kSymbol
+ kSymbol = v8::HeapGraphNode::kSymbol,
+ kBigInt = v8::HeapGraphNode::kBigInt
};
static const int kNoEntry;
@@ -355,7 +356,7 @@ class V8HeapExplorer : public HeapEntriesAllocator {
typedef bool (V8HeapExplorer::*ExtractReferencesMethod)(int entry,
HeapObject* object);
- void MarkVisitedField(HeapObject* obj, int offset);
+ void MarkVisitedField(int offset);
HeapEntry* AddEntry(HeapObject* object);
HeapEntry* AddEntry(HeapObject* object,
@@ -392,6 +393,9 @@ class V8HeapExplorer : public HeapEntriesAllocator {
void ExtractJSArrayBufferReferences(int entry, JSArrayBuffer* buffer);
void ExtractJSPromiseReferences(int entry, JSPromise* promise);
void ExtractFixedArrayReferences(int entry, FixedArray* array);
+ void ExtractFeedbackVectorReferences(int entry,
+ FeedbackVector* feedback_vector);
+ void ExtractWeakFixedArrayReferences(int entry, WeakFixedArray* array);
void ExtractPropertyReferences(JSObject* js_obj, int entry);
void ExtractAccessorPairProperty(JSObject* js_obj, int entry, Name* key,
Object* callback_obj, int field_offset = -1);
@@ -469,7 +473,7 @@ class V8HeapExplorer : public HeapEntriesAllocator {
std::unordered_map<const FixedArray*, FixedArraySubInstanceType> array_types_;
v8::HeapProfiler::ObjectNameResolver* global_object_name_resolver_;
- std::vector<bool> marks_;
+ std::vector<bool> visited_fields_;
friend class IndexedReferencesExtractor;
friend class RootsReferencesExtractor;
diff --git a/deps/v8/src/profiler/profile-generator.cc b/deps/v8/src/profiler/profile-generator.cc
index 9786741b94..db95718936 100644
--- a/deps/v8/src/profiler/profile-generator.cc
+++ b/deps/v8/src/profiler/profile-generator.cc
@@ -152,7 +152,7 @@ void CodeEntry::FillFunctionInfo(SharedFunctionInfo* shared) {
if (!shared->script()->IsScript()) return;
Script* script = Script::cast(shared->script());
set_script_id(script->id());
- set_position(shared->start_position());
+ set_position(shared->StartPosition());
set_bailout_reason(GetBailoutReason(shared->disable_optimization_reason()));
}
diff --git a/deps/v8/src/profiler/profiler-listener.cc b/deps/v8/src/profiler/profiler-listener.cc
index cec71d70e0..16ec9d883a 100644
--- a/deps/v8/src/profiler/profiler-listener.cc
+++ b/deps/v8/src/profiler/profiler-listener.cc
@@ -37,7 +37,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
rec->entry = NewCodeEntry(
tag, GetFunctionName(name), CodeEntry::kEmptyNamePrefix,
CodeEntry::kEmptyResourceName, CpuProfileNode::kNoLineNumberInfo,
- CpuProfileNode::kNoColumnNumberInfo, nullptr, code->instruction_start());
+ CpuProfileNode::kNoColumnNumberInfo, nullptr, code->InstructionStart());
RecordInliningInfo(rec->entry, code);
rec->size = code->ExecutableSize();
DispatchCodeEvent(evt_rec);
@@ -51,7 +51,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
rec->entry = NewCodeEntry(
tag, GetFunctionName(name), CodeEntry::kEmptyNamePrefix,
CodeEntry::kEmptyResourceName, CpuProfileNode::kNoLineNumberInfo,
- CpuProfileNode::kNoColumnNumberInfo, nullptr, code->instruction_start());
+ CpuProfileNode::kNoColumnNumberInfo, nullptr, code->InstructionStart());
RecordInliningInfo(rec->entry, code);
rec->size = code->ExecutableSize();
DispatchCodeEvent(evt_rec);
@@ -68,7 +68,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
tag, GetFunctionName(shared->DebugName()), CodeEntry::kEmptyNamePrefix,
GetName(InferScriptName(script_name, shared)),
CpuProfileNode::kNoLineNumberInfo, CpuProfileNode::kNoColumnNumberInfo,
- nullptr, code->instruction_start());
+ nullptr, code->InstructionStart());
RecordInliningInfo(rec->entry, code);
rec->entry->FillFunctionInfo(shared);
rec->size = code->ExecutableSize();
@@ -104,7 +104,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
rec->entry = NewCodeEntry(
tag, GetFunctionName(shared->DebugName()), CodeEntry::kEmptyNamePrefix,
GetName(InferScriptName(script_name, shared)), line, column,
- std::move(line_table), abstract_code->instruction_start());
+ std::move(line_table), abstract_code->InstructionStart());
RecordInliningInfo(rec->entry, abstract_code);
RecordDeoptInlinedFrames(rec->entry, abstract_code);
rec->entry->FillFunctionInfo(shared);
@@ -113,7 +113,7 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
}
void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
- wasm::WasmCode* code,
+ const wasm::WasmCode* code,
wasm::WasmName name) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
@@ -179,25 +179,11 @@ void ProfilerListener::RegExpCodeCreateEvent(AbstractCode* code,
"RegExp: ", CodeEntry::kEmptyResourceName,
CpuProfileNode::kNoLineNumberInfo,
CpuProfileNode::kNoColumnNumberInfo, nullptr,
- code->instruction_start());
+ code->raw_instruction_start());
rec->size = code->ExecutableSize();
DispatchCodeEvent(evt_rec);
}
-void ProfilerListener::InstructionStreamCreateEvent(
- CodeEventListener::LogEventsAndTags tag, const InstructionStream* stream,
- const char* description) {
- CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
- CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
- rec->start = stream->bytes();
- rec->entry = NewCodeEntry(
- tag, description, CodeEntry::kEmptyNamePrefix,
- CodeEntry::kEmptyResourceName, CpuProfileNode::kNoLineNumberInfo,
- CpuProfileNode::kNoColumnNumberInfo, nullptr, stream->bytes());
- rec->size = static_cast<unsigned>(stream->byte_length());
- DispatchCodeEvent(evt_rec);
-}
-
void ProfilerListener::SetterCallbackEvent(Name* name, Address entry_point) {
CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
@@ -259,7 +245,7 @@ void ProfilerListener::RecordInliningInfo(CodeEntry* entry,
CodeEntry::kEmptyNamePrefix, resource_name,
CpuProfileNode::kNoLineNumberInfo,
CpuProfileNode::kNoColumnNumberInfo, nullptr,
- code->instruction_start());
+ code->InstructionStart());
inline_entry->FillFunctionInfo(shared_info);
inline_stack.emplace_back(inline_entry);
}
diff --git a/deps/v8/src/profiler/profiler-listener.h b/deps/v8/src/profiler/profiler-listener.h
index ca2c213a93..791b66f3ed 100644
--- a/deps/v8/src/profiler/profiler-listener.h
+++ b/deps/v8/src/profiler/profiler-listener.h
@@ -38,7 +38,8 @@ class ProfilerListener : public CodeEventListener {
AbstractCode* code, SharedFunctionInfo* shared,
Name* script_name, int line, int column) override;
void CodeCreateEvent(CodeEventListener::LogEventsAndTags tag,
- wasm::WasmCode* code, wasm::WasmName name) override;
+ const wasm::WasmCode* code,
+ wasm::WasmName name) override;
void CodeMovingGCEvent() override {}
void CodeMoveEvent(AbstractCode* from, Address to) override;
@@ -48,9 +49,6 @@ class ProfilerListener : public CodeEventListener {
int fp_to_sp_delta) override;
void GetterCallbackEvent(Name* name, Address entry_point) override;
void RegExpCodeCreateEvent(AbstractCode* code, String* source) override;
- void InstructionStreamCreateEvent(CodeEventListener::LogEventsAndTags tag,
- const InstructionStream* stream,
- const char* description) override;
void SetterCallbackEvent(Name* name, Address entry_point) override;
void SharedFunctionInfoMoveEvent(Address from, Address to) override {}
diff --git a/deps/v8/src/profiler/sampling-heap-profiler.cc b/deps/v8/src/profiler/sampling-heap-profiler.cc
index 31c885fef0..6912f3eba1 100644
--- a/deps/v8/src/profiler/sampling-heap-profiler.cc
+++ b/deps/v8/src/profiler/sampling-heap-profiler.cc
@@ -209,7 +209,7 @@ SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
Script* script = Script::cast(shared->script());
script_id = script->id();
}
- node = node->FindOrAddChildNode(name, script_id, shared->start_position());
+ node = node->FindOrAddChildNode(name, script_id, shared->StartPosition());
}
if (found_arguments_marker_frames) {