Bug 768793 - Remove DOMJSClass::mGetWrapperCacheVTableOffset; r=khuey
authorMs2ger <ms2ger@gmail.com>
Thu, 06 Sep 2012 09:14:49 +0200
changeset 106446 076ac298af72434932c0ea12d00fe6089a364bdb
parent 106445 6c7cf0ab0aaafc147909f5b46511fa41657fcead
child 106447 1fa13cd82732ff814246c99624f16fed19e7494d
push id58
push usershu@rfrn.org
push dateFri, 07 Sep 2012 18:20:16 +0000
reviewerskhuey
bugs768793
milestone18.0a1
Bug 768793 - Remove DOMJSClass::mGetWrapperCacheVTableOffset; r=khuey
dom/bindings/Codegen.py
dom/bindings/DOMJSClass.h
dom/workers/Worker.cpp
dom/workers/WorkerScope.cpp
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -124,18 +124,17 @@ DOMJSClass Class = {
     %s, /* finalize */
     NULL,                  /* checkAccess */
     NULL,                  /* call */
     NULL,                  /* hasInstance */
     NULL,                  /* construct */
     %s, /* trace */
     JSCLASS_NO_INTERNAL_MEMBERS
   },
-  %s,
-  -1
+  %s
 };
 """ % (self.descriptor.interface.identifier.name,
        ADDPROPERTY_HOOK_NAME if self.descriptor.concrete and not self.descriptor.workers and self.descriptor.wrapperCache else 'JS_PropertyStub',
        FINALIZE_HOOK_NAME, traceHook,
        CGIndenter(CGGeneric(DOMClass(self.descriptor))).define())
 
 class CGPrototypeJSClass(CGThing):
     def __init__(self, descriptor):
--- a/dom/bindings/DOMJSClass.h
+++ b/dom/bindings/DOMJSClass.h
@@ -68,22 +68,16 @@ struct DOMJSClass
 {
   // It would be nice to just inherit from JSClass, but that precludes pure
   // compile-time initialization of the form |DOMJSClass = {...};|, since C++
   // only allows brace initialization for aggregate/POD types.
   JSClass mBase;
 
   DOMClass mClass;
 
-  // We cache the VTable index of GetWrapperCache for objects that support it.
-  //
-  // -1 indicates that GetWrapperCache is not implemented on the underlying object.
-  // XXXkhuey this is unused and needs to die.
-  const int16_t mGetWrapperCacheVTableOffset;
-
   static DOMJSClass* FromJSClass(JSClass* base) {
     MOZ_ASSERT(base->flags & JSCLASS_IS_DOMJSCLASS);
     return reinterpret_cast<DOMJSClass*>(base);
   }
   static const DOMJSClass* FromJSClass(const JSClass* base) {
     MOZ_ASSERT(base->flags & JSCLASS_IS_DOMJSCLASS);
     return reinterpret_cast<const DOMJSClass*>(base);
   }
--- a/dom/workers/Worker.cpp
+++ b/dom/workers/Worker.cpp
@@ -308,18 +308,17 @@ DOMJSClass Worker::sClass = {
     JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
     NULL, NULL, NULL, NULL, Trace
   },
   {
     { prototypes::id::EventTarget_workers, prototypes::id::_ID_Count,
       prototypes::id::_ID_Count },
     false,
     &sNativePropertyHooks
-  },
-  -1
+  }
 };
 
 JSPropertySpec Worker::sProperties[] = {
   { sEventStrings[STRING_onerror], STRING_onerror, PROPERTY_FLAGS,
     JSOP_WRAPPER(GetEventListener), JSOP_WRAPPER(SetEventListener) },
   { sEventStrings[STRING_onmessage], STRING_onmessage, PROPERTY_FLAGS,
     JSOP_WRAPPER(GetEventListener), JSOP_WRAPPER(SetEventListener) },
   { 0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER }
@@ -434,18 +433,17 @@ DOMJSClass ChromeWorker::sClass = {
     JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
     NULL, NULL, NULL, NULL, Trace,
   },
   {
     { prototypes::id::EventTarget_workers, prototypes::id::_ID_Count,
       prototypes::id::_ID_Count },
     false,
     &sNativePropertyHooks
-  },
-  -1
+  }
 };
 
 WorkerPrivate*
 Worker::GetInstancePrivate(JSContext* aCx, JSObject* aObj,
                            const char* aFunctionName)
 {
   JSClass* classPtr = JS_GetClass(aObj);
   if (classPtr == Class() || classPtr == ChromeWorker::Class()) {
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -860,18 +860,17 @@ DOMJSClass DedicatedWorkerGlobalScope::s
     JS_EnumerateStub, reinterpret_cast<JSResolveOp>(Resolve), JS_ConvertStub,
     Finalize, NULL, NULL, NULL, NULL, Trace
   },
   {
     { prototypes::id::EventTarget_workers, prototypes::id::_ID_Count,
       prototypes::id::_ID_Count },
     false,
     &sNativePropertyHooks
-  },
-  -1
+  }
 };
 
 JSPropertySpec DedicatedWorkerGlobalScope::sProperties[] = {
   { sEventStrings[STRING_onmessage], STRING_onmessage, PROPERTY_FLAGS,
     JSOP_WRAPPER(GetEventListener), JSOP_WRAPPER(SetEventListener) },
   { 0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER }
 };