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

heap: Inspect embedder fields on global and global proxy object

Those object types can carry embedder fields as they are generated from
embedder-provided function templates.

Bug: v8:9672
Change-Id: Iaea794ba8bea2ffec3559131eecfe1941479759a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1781048Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63511}
parent 93063ade
...@@ -4811,6 +4811,8 @@ bool JSObject::IsApiWrapper() { ...@@ -4811,6 +4811,8 @@ bool JSObject::IsApiWrapper() {
return instance_type == JS_API_OBJECT_TYPE || return instance_type == JS_API_OBJECT_TYPE ||
instance_type == JS_ARRAY_BUFFER_TYPE || instance_type == JS_ARRAY_BUFFER_TYPE ||
instance_type == JS_DATA_VIEW_TYPE || instance_type == JS_DATA_VIEW_TYPE ||
instance_type == JS_GLOBAL_OBJECT_TYPE ||
instance_type == JS_GLOBAL_PROXY_TYPE ||
instance_type == JS_SPECIAL_API_OBJECT_TYPE || instance_type == JS_SPECIAL_API_OBJECT_TYPE ||
instance_type == JS_TYPED_ARRAY_TYPE; instance_type == JS_TYPED_ARRAY_TYPE;
} }
......
...@@ -281,8 +281,6 @@ VisitorId Map::GetVisitorId(Map map) { ...@@ -281,8 +281,6 @@ VisitorId Map::GetVisitorId(Map map) {
case JS_DATE_TYPE: case JS_DATE_TYPE:
case JS_ARRAY_ITERATOR_TYPE: case JS_ARRAY_ITERATOR_TYPE:
case JS_ARRAY_TYPE: case JS_ARRAY_TYPE:
case JS_GLOBAL_PROXY_TYPE:
case JS_GLOBAL_OBJECT_TYPE:
case JS_MESSAGE_OBJECT_TYPE: case JS_MESSAGE_OBJECT_TYPE:
case JS_SET_TYPE: case JS_SET_TYPE:
case JS_MAP_TYPE: case JS_MAP_TYPE:
...@@ -321,6 +319,8 @@ VisitorId Map::GetVisitorId(Map map) { ...@@ -321,6 +319,8 @@ VisitorId Map::GetVisitorId(Map map) {
return has_raw_data_fields ? kVisitJSObject : kVisitJSObjectFast; return has_raw_data_fields ? kVisitJSObject : kVisitJSObjectFast;
} }
case JS_API_OBJECT_TYPE: case JS_API_OBJECT_TYPE:
case JS_GLOBAL_PROXY_TYPE:
case JS_GLOBAL_OBJECT_TYPE:
case JS_SPECIAL_API_OBJECT_TYPE: case JS_SPECIAL_API_OBJECT_TYPE:
return kVisitJSApiObject; return kVisitJSApiObject;
......
...@@ -646,6 +646,9 @@ TEST(TracePrologueCallingIntoV8WriteBarrier) { ...@@ -646,6 +646,9 @@ TEST(TracePrologueCallingIntoV8WriteBarrier) {
std::move(global)); std::move(global));
heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer); heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
SimulateIncrementalMarking(CcTest::i_isolate()->heap()); SimulateIncrementalMarking(CcTest::i_isolate()->heap());
// Finish GC to avoid removing the tracer while GC is running which may end up
// in an infinite loop because of unprocessed objects.
heap::InvokeMarkSweep();
} }
TEST(TracedGlobalWithDestructor) { TEST(TracedGlobalWithDestructor) {
......
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