@@ -70,7 +70,6 @@ using v8::TryCatch;
7070using v8::Uint32;
7171using v8::Undefined;
7272using v8::Value;
73- using v8::WrapperDescriptor;
7473using worker::Worker;
7574
7675int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64 ;
@@ -542,30 +541,11 @@ IsolateData::IsolateData(Isolate* isolate,
542541
543542 uint16_t cppgc_id = kDefaultCppGCEmebdderID ;
544543 if (cpp_heap != nullptr ) {
545- // The general convention of the wrappable layout for cppgc in the
546- // ecosystem is:
547- // [ 0 ] -> embedder id
548- // [ 1 ] -> wrappable instance
549- // If the Isolate includes a CppHeap attached by another embedder,
550- // And if they also use the field 0 for the ID, we DCHECK that
551- // the layout matches our layout, and record the embedder ID for cppgc
552- // to avoid accidentally enabling cppgc on non-cppgc-managed wrappers .
553- v8::WrapperDescriptor descriptor = cpp_heap->wrapper_descriptor ();
554- if (descriptor.wrappable_type_index == BaseObject::kEmbedderType ) {
555- cppgc_id = descriptor.embedder_id_for_garbage_collected ;
556- DCHECK_EQ (descriptor.wrappable_instance_index , BaseObject::kSlot );
557- }
558- // If the CppHeap uses the slot we use to put non-cppgc-traced BaseObject
559- // for embedder ID, V8 could accidentally enable cppgc on them. So
560- // safe guard against this.
561- DCHECK_NE (descriptor.wrappable_type_index , BaseObject::kSlot );
544+ // All CppHeap's support only one way of wrapping objects.
562545 } else {
563546 cpp_heap_ = CppHeap::Create (
564547 platform,
565- CppHeapCreateParams{
566- {},
567- WrapperDescriptor (
568- BaseObject::kEmbedderType , BaseObject::kSlot , cppgc_id)});
548+ CppHeapCreateParams{{}});
569549 isolate->AttachCppHeap (cpp_heap_.get ());
570550 }
571551 // We do not care about overflow since we just want this to be different
0 commit comments