Skip to content

Commit 599866f

Browse files
gahaasV8 LUCI CQ
authored andcommitted
[cleanup] Remove two unused fields from the isolate
Isolate::embedder_wrapper_type_index and Isolate::embedder_wrapper_object_index do get initialized but never read within V8. Bug: 345640553 Change-Id: Iaf1c2b59880a3ffac477c4f6aeae78ef6fd9cbe6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6771910 Reviewed-by: Michael Lippautz <[email protected]> Commit-Queue: Andreas Haas <[email protected]> Cr-Commit-Position: refs/heads/main@{#101541}
1 parent 669db17 commit 599866f

6 files changed

Lines changed: 2 additions & 43 deletions

File tree

include/v8-fast-api-calls.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,27 +93,11 @@
9393
* }
9494
* };
9595
*
96-
* // TODO(mslekova): Clean-up these constants
97-
* // The constants kV8EmbedderWrapperTypeIndex and
98-
* // kV8EmbedderWrapperObjectIndex describe the offsets for the type info
99-
* // struct and the native object, when expressed as internal field indices
100-
* // within a JSObject. The existance of this helper function assumes that
101-
* // all embedder objects have their JSObject-side type info at the same
102-
* // offset, but this is not a limitation of the API itself. For a detailed
103-
* // use case, see the third example.
104-
* static constexpr int kV8EmbedderWrapperTypeIndex = 0;
105-
* static constexpr int kV8EmbedderWrapperObjectIndex = 1;
106-
*
10796
* // The following setup function can be templatized based on
10897
* // the {embedder_object} argument.
10998
* void SetupCustomEmbedderObject(v8::Isolate* isolate,
11099
* v8::Local<v8::Context> context,
111100
* CustomEmbedderType* embedder_object) {
112-
* isolate->set_embedder_wrapper_type_index(
113-
* kV8EmbedderWrapperTypeIndex);
114-
* isolate->set_embedder_wrapper_object_index(
115-
* kV8EmbedderWrapperObjectIndex);
116-
*
117101
* v8::CFunction c_func =
118102
* MakeV8CFunction(CustomEmbedderType::FastMethod);
119103
*

include/v8-isolate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ class V8_EXPORT Isolate {
361361
* for wrapped API objects and are used by the fast C API
362362
* (for details see v8-fast-api-calls.h).
363363
*/
364+
V8_DEPRECATE_SOON("This field is unused.")
364365
int embedder_wrapper_type_index = -1;
366+
V8_DEPRECATE_SOON("This field is unused.")
365367
int embedder_wrapper_object_index = -1;
366368

367369
/**

src/api/api.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10100,11 +10100,6 @@ void Isolate::Initialize(Isolate* v8_isolate,
1010010100
}
1010110101
}
1010210102

10103-
i_isolate->set_embedder_wrapper_type_index(
10104-
params.embedder_wrapper_type_index);
10105-
i_isolate->set_embedder_wrapper_object_index(
10106-
params.embedder_wrapper_object_index);
10107-
1010810103
if (!i::V8::GetCurrentPlatform()
1010910104
->GetForegroundTaskRunner(v8_isolate)
1011010105
->NonNestableTasksEnabled()) {

src/execution/isolate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,6 @@ using DebugObjectCache = std::vector<Handle<HeapObject>>;
522522
V(bool, disable_bytecode_flushing, false) \
523523
V(int, last_console_context_id, 0) \
524524
V(v8_inspector::V8Inspector*, inspector, nullptr) \
525-
V(int, embedder_wrapper_type_index, -1) \
526-
V(int, embedder_wrapper_object_index, -1) \
527525
V(compiler::NodeObserver*, node_observer, nullptr) \
528526
V(bool, javascript_execution_assert, true) \
529527
V(bool, javascript_execution_throws, true) \

test/cctest/test-api.cc

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28983,8 +28983,6 @@ void FastApiCallWithAllocationAndGC(AllocationChecker::GCLocation gc_location) {
2898328983
v8::Isolate* isolate = CcTest::isolate();
2898428984

2898528985
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
28986-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
28987-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2898828986

2898928987
v8::HandleScope scope(isolate);
2899028988

@@ -29030,8 +29028,6 @@ TEST(FastApiCallWithThrowInReentrantCode) {
2903029028
v8::Isolate* isolate = CcTest::isolate();
2903129029

2903229030
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29033-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29034-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2903529031

2903629032
v8::HandleScope scope(isolate);
2903729033

@@ -29140,8 +29136,6 @@ void FastApiCallRecursion(bool inner_most_throws) {
2914029136
v8::Isolate* isolate = CcTest::isolate();
2914129137

2914229138
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29143-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29144-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2914529139

2914629140
v8::HandleScope scope(isolate);
2914729141

@@ -29234,9 +29228,6 @@ TEST(FastApiStackSlot) {
2923429228
i::FlagList::EnforceFlagImplications();
2923529229

2923629230
v8::Isolate* isolate = CcTest::isolate();
29237-
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29238-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29239-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2924029231

2924129232
v8::HandleScope scope(isolate);
2924229233
LocalContext env;
@@ -29290,9 +29281,6 @@ TEST(FastApiCalls) {
2929029281

2929129282
CcTest::InitializeVM();
2929229283
v8::Isolate* isolate = CcTest::isolate();
29293-
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29294-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29295-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2929629284

2929729285
v8::HandleScope scope(isolate);
2929829286
LocalContext env;
@@ -29868,9 +29856,6 @@ TEST(FastApiCallsString) {
2986829856

2986929857
CcTest::InitializeVM();
2987029858
v8::Isolate* isolate = CcTest::isolate();
29871-
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29872-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29873-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2987429859

2987529860
v8::HandleScope scope(isolate);
2987629861
LocalContext env;
@@ -29992,9 +29977,6 @@ TEST(FastApiCallsFromWasm) {
2999229977

2999329978
CcTest::InitializeVM();
2999429979
v8::Isolate* isolate = CcTest::isolate();
29995-
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
29996-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
29997-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
2999829980

2999929981
v8::HandleScope scope(isolate);
3000029982
LocalContext env;

test/cctest/test-cpu-profiler.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,8 +4631,6 @@ TEST(FastApiCPUProfiler) {
46314631
LocalContext env;
46324632
v8::Isolate* isolate = env.isolate();
46334633
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
4634-
i_isolate->set_embedder_wrapper_type_index(kV8WrapperTypeIndex);
4635-
i_isolate->set_embedder_wrapper_object_index(kV8WrapperObjectIndex);
46364634

46374635
i::HandleScope scope(i_isolate);
46384636

0 commit comments

Comments
 (0)