@@ -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 ;
@@ -555,30 +554,11 @@ IsolateData::IsolateData(Isolate* isolate,
555554
556555 uint16_t cppgc_id = kDefaultCppGCEmbedderID ;
557556 if (cpp_heap != nullptr ) {
558- // The general convention of the wrappable layout for cppgc in the
559- // ecosystem is:
560- // [ 0 ] -> embedder id
561- // [ 1 ] -> wrappable instance
562- // If the Isolate includes a CppHeap attached by another embedder,
563- // And if they also use the field 0 for the ID, we DCHECK that
564- // the layout matches our layout, and record the embedder ID for cppgc
565- // to avoid accidentally enabling cppgc on non-cppgc-managed wrappers .
566- v8::WrapperDescriptor descriptor = cpp_heap->wrapper_descriptor ();
567- if (descriptor.wrappable_type_index == BaseObject::kEmbedderType ) {
568- cppgc_id = descriptor.embedder_id_for_garbage_collected ;
569- DCHECK_EQ (descriptor.wrappable_instance_index , BaseObject::kSlot );
570- }
571- // If the CppHeap uses the slot we use to put non-cppgc-traced BaseObject
572- // for embedder ID, V8 could accidentally enable cppgc on them. So
573- // safe guard against this.
574- DCHECK_NE (descriptor.wrappable_type_index , BaseObject::kSlot );
557+ // All CppHeap's support only one way of wrapping objects.
575558 } else {
576559 cpp_heap_ = CppHeap::Create (
577560 platform,
578- CppHeapCreateParams{
579- {},
580- WrapperDescriptor (
581- BaseObject::kEmbedderType , BaseObject::kSlot , cppgc_id)});
561+ CppHeapCreateParams{{}});
582562 isolate->AttachCppHeap (cpp_heap_.get ());
583563 }
584564 // We do not care about overflow since we just want this to be different
0 commit comments