Update V8 to r5318 to fix crashing ARM bugs
Bug: 2947054
Change-Id: I9c7398edb1525477c75ace9d383efaf790d12c51
diff --git a/src/api.cc b/src/api.cc
index 7a967db..e7a9e5c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4592,10 +4592,18 @@
uint64_t HeapGraphNode::GetId() const {
IsDeadCheck("v8::HeapGraphNode::GetId");
+ ASSERT(ToInternal(this)->snapshot()->type() != i::HeapSnapshot::kAggregated);
return ToInternal(this)->id();
}
+int HeapGraphNode::GetInstancesCount() const {
+ IsDeadCheck("v8::HeapGraphNode::GetInstancesCount");
+ ASSERT(ToInternal(this)->snapshot()->type() == i::HeapSnapshot::kAggregated);
+ return static_cast<int>(ToInternal(this)->id());
+}
+
+
int HeapGraphNode::GetSelfSize() const {
IsDeadCheck("v8::HeapGraphNode::GetSelfSize");
return ToInternal(this)->self_size();
@@ -4677,6 +4685,12 @@
}
+HeapSnapshot::Type HeapSnapshot::GetType() const {
+ IsDeadCheck("v8::HeapSnapshot::GetType");
+ return static_cast<HeapSnapshot::Type>(ToInternal(this)->type());
+}
+
+
unsigned HeapSnapshot::GetUid() const {
IsDeadCheck("v8::HeapSnapshot::GetUid");
return ToInternal(this)->uid();
@@ -4724,10 +4738,22 @@
}
-const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title) {
+const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
+ HeapSnapshot::Type type) {
IsDeadCheck("v8::HeapProfiler::TakeSnapshot");
+ i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull;
+ switch (type) {
+ case HeapSnapshot::kFull:
+ internal_type = i::HeapSnapshot::kFull;
+ break;
+ case HeapSnapshot::kAggregated:
+ internal_type = i::HeapSnapshot::kAggregated;
+ break;
+ default:
+ UNREACHABLE();
+ }
return reinterpret_cast<const HeapSnapshot*>(
- i::HeapProfiler::TakeSnapshot(*Utils::OpenHandle(*title)));
+ i::HeapProfiler::TakeSnapshot(*Utils::OpenHandle(*title), internal_type));
}
#endif // ENABLE_LOGGING_AND_PROFILING