@@ -71,7 +71,6 @@ using v8::TryCatch;
7171using v8::Uint32;
7272using v8::Undefined;
7373using v8::Value;
74- using v8::WrapperDescriptor;
7574using worker::Worker;
7675
7776int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64 ;
@@ -571,30 +570,11 @@ IsolateData::IsolateData(Isolate* isolate,
571570
572571 uint16_t cppgc_id = kDefaultCppGCEmbedderID ;
573572 if (cpp_heap != nullptr ) {
574- // The general convention of the wrappable layout for cppgc in the
575- // ecosystem is:
576- // [ 0 ] -> embedder id
577- // [ 1 ] -> wrappable instance
578- // If the Isolate includes a CppHeap attached by another embedder,
579- // And if they also use the field 0 for the ID, we DCHECK that
580- // the layout matches our layout, and record the embedder ID for cppgc
581- // to avoid accidentally enabling cppgc on non-cppgc-managed wrappers .
582- v8::WrapperDescriptor descriptor = cpp_heap->wrapper_descriptor ();
583- if (descriptor.wrappable_type_index == BaseObject::kEmbedderType ) {
584- cppgc_id = descriptor.embedder_id_for_garbage_collected ;
585- DCHECK_EQ (descriptor.wrappable_instance_index , BaseObject::kSlot );
586- }
587- // If the CppHeap uses the slot we use to put non-cppgc-traced BaseObject
588- // for embedder ID, V8 could accidentally enable cppgc on them. So
589- // safe guard against this.
590- DCHECK_NE (descriptor.wrappable_type_index , BaseObject::kSlot );
573+ // All CppHeap's support only one way of wrapping objects.
591574 } else {
592575 cpp_heap_ = CppHeap::Create (
593576 platform,
594- CppHeapCreateParams{
595- {},
596- WrapperDescriptor (
597- BaseObject::kEmbedderType , BaseObject::kSlot , cppgc_id)});
577+ CppHeapCreateParams{{}});
598578 isolate->AttachCppHeap (cpp_heap_.get ());
599579 }
600580 // We do not care about overflow since we just want this to be different
0 commit comments