Commit 1fe82070 authored by alph's avatar alph Committed by Commit bot

[heap profiler] Use internal type links for bound this and target function.

These are internal fields of the JSBoundFunction class.

Review-Url: https://codereview.chromium.org/2193993002
Cr-Commit-Position: refs/heads/master@{#38222}
parent 282cdf28
......@@ -1089,9 +1089,11 @@ void V8HeapExplorer::ExtractJSObjectReferences(
TagObject(js_fun->bound_arguments(), "(bound arguments)");
SetInternalReference(js_fun, entry, "bindings", js_fun->bound_arguments(),
JSBoundFunction::kBoundArgumentsOffset);
SetNativeBindReference(js_obj, entry, "bound_this", js_fun->bound_this());
SetNativeBindReference(js_obj, entry, "bound_function",
js_fun->bound_target_function());
SetInternalReference(js_obj, entry, "bound_this", js_fun->bound_this(),
JSBoundFunction::kBoundThisOffset);
SetInternalReference(js_obj, entry, "bound_function",
js_fun->bound_target_function(),
JSBoundFunction::kBoundTargetFunctionOffset);
FixedArray* bindings = js_fun->bound_arguments();
for (int i = 0; i < bindings->length(); i++) {
const char* reference_name = names_->GetFormatted("bound_argument_%d", i);
......
......@@ -256,13 +256,13 @@ TEST(BoundFunctionInSnapshot) {
CHECK_EQ(v8::HeapGraphNode::kArray, bindings->GetType());
CHECK_EQ(1, bindings->GetChildrenCount());
const v8::HeapGraphNode* bound_this = GetProperty(
f, v8::HeapGraphEdge::kShortcut, "bound_this");
const v8::HeapGraphNode* bound_this =
GetProperty(f, v8::HeapGraphEdge::kInternal, "bound_this");
CHECK(bound_this);
CHECK_EQ(v8::HeapGraphNode::kObject, bound_this->GetType());
const v8::HeapGraphNode* bound_function = GetProperty(
f, v8::HeapGraphEdge::kShortcut, "bound_function");
const v8::HeapGraphNode* bound_function =
GetProperty(f, v8::HeapGraphEdge::kInternal, "bound_function");
CHECK(bound_function);
CHECK_EQ(v8::HeapGraphNode::kClosure, bound_function->GetType());
......
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