Bug 973238 Part 1 -- Remove getSuitableClaspAndProto r=sfink
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Mon, 10 Mar 2014 16:23:24 -0400
changeset 176468 d86d8ac76b25041018a6002eb0f10c55d970e325
parent 176467 99a8ea57ec6580caf24130c883546e9810e58e26
child 176469 ef6d290021ffe41d5f3891c8ecd15467b682ca21
push id41772
push usernmatsakis@mozilla.com
push dateTue, 01 Apr 2014 20:13:59 +0000
treeherdermozilla-inbound@ef6d290021ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs973238
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 973238 Part 1 -- Remove getSuitableClaspAndProto r=sfink
js/src/builtin/TypedObject.cpp
js/src/builtin/TypedObject.h
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -1380,72 +1380,16 @@ js_InitTypedObjectDummy(JSContext *cx, H
      * This function is entered into the jsprototypes.h table
      * as the initializer for `TypedObject`. It should not
      * be executed via the `standard_class_atoms` mechanism.
      */
 
     MOZ_ASSUME_UNREACHABLE("shouldn't be initializing TypedObject via the JSProtoKey initializer mechanism");
 }
 
-/*
- * Each type repr has an associated TI type object (these will
- * eventually be used as the TI type objects for type objects, though
- * they are not now). To create these TI type objects, we need to know
- * the clasp/proto of the type object for a particular kind. This
- * accessor function returns those. In the case of the predefined type
- * objects, like scalars/references/x4s, this is invoked while
- * creating the typed object module, and thus does not require that
- * the typed object module is fully initialized. For array types and
- * struct types, it is invoked when the user creates an instance of
- * those types (and hence requires that the typed object module is
- * already initialized).
- */
-/*static*/ bool
-TypedObjectModuleObject::getSuitableClaspAndProto(JSContext *cx,
-                                                  TypeDescr::Kind kind,
-                                                  const Class **clasp,
-                                                  MutableHandleObject proto)
-{
-    Rooted<GlobalObject *> global(cx, cx->global());
-    JS_ASSERT(global);
-    switch (kind) {
-      case TypeDescr::Scalar:
-        *clasp = &ScalarTypeDescr::class_;
-        proto.set(global->getOrCreateFunctionPrototype(cx));
-        break;
-
-      case TypeDescr::Reference:
-        *clasp = &ReferenceTypeDescr::class_;
-        proto.set(global->getOrCreateFunctionPrototype(cx));
-        break;
-
-      case TypeDescr::X4:
-        *clasp = &X4TypeDescr::class_;
-        proto.set(global->getOrCreateFunctionPrototype(cx));
-        break;
-
-      case TypeDescr::Struct:
-        *clasp = &StructTypeDescr::class_;
-        proto.set(&global->getTypedObjectModule().getSlot(StructTypePrototype).toObject());
-        break;
-
-      case TypeDescr::SizedArray:
-        *clasp = &SizedArrayTypeDescr::class_;
-        proto.set(&global->getTypedObjectModule().getSlot(ArrayTypePrototype).toObject());
-        break;
-
-      case TypeDescr::UnsizedArray:
-        *clasp = &UnsizedArrayTypeDescr::class_;
-        proto.set(&global->getTypedObjectModule().getSlot(ArrayTypePrototype).toObject());
-        break;
-    }
-
-    return !!proto;
-}
-
 /******************************************************************************
  * Typed objects
  */
 
 /*static*/ TypedObject *
 TypedObject::createUnattached(JSContext *cx,
                              HandleTypeDescr descr,
                              int32_t length)
--- a/js/src/builtin/TypedObject.h
+++ b/js/src/builtin/TypedObject.h
@@ -479,21 +479,16 @@ class TypedObjectModuleObject : public J
   public:
     enum Slot {
         ArrayTypePrototype,
         StructTypePrototype,
         SlotCount
     };
 
     static const Class class_;
-
-    static bool getSuitableClaspAndProto(JSContext *cx,
-                                         TypeDescr::Kind kind,
-                                         const Class **clasp,
-                                         MutableHandleObject proto);
 };
 
 /*
  * Base type for typed objects and handles. Basically any type whose
  * contents consist of typed memory.
  */
 class TypedObject : public ArrayBufferViewObject
 {