Bug 1233124 - Remove mis-named duplicate typedefs for rooted import and export entries r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 18 Dec 2015 12:11:20 +0000
changeset 277004 dde24faeb58077458f68716aec3f30504445097b
parent 277003 91138dad602dd5392e3f4968443af53db5676e70
child 277005 22bb9e57553b227f3d55a1f71010b8ab1e7c2ffa
push id16724
push usercbook@mozilla.com
push dateMon, 21 Dec 2015 11:00:52 +0000
treeherderfx-team@3f3f0361567c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1233124
milestone46.0a1
Bug 1233124 - Remove mis-named duplicate typedefs for rooted import and export entries r=terrence
js/src/builtin/ModuleObject.cpp
js/src/builtin/ModuleObject.h
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -11,19 +11,16 @@
 #include "frontend/SharedContext.h"
 #include "gc/Tracer.h"
 
 #include "jsobjinlines.h"
 
 using namespace js;
 using namespace js::frontend;
 
-typedef JS::Rooted<ImportEntryObject*> RootedImportEntry;
-typedef JS::Rooted<ExportEntryObject*> RootedExportEntry;
-
 template<typename T, Value ValueGetter(T* obj)>
 static bool
 ModuleValueGetterImpl(JSContext* cx, const CallArgs& args)
 {
     args.rval().set(ValueGetter(&args.thisv().toObject().as<T>()));
     return true;
 }
 
@@ -116,17 +113,17 @@ ImportEntryObject::create(JSContext* cx,
                           HandleAtom importName,
                           HandleAtom localName)
 {
     RootedObject proto(cx, cx->global()->getImportEntryPrototype());
     RootedObject obj(cx, NewObjectWithGivenProto(cx, &class_, proto));
     if (!obj)
         return nullptr;
 
-    RootedImportEntry self(cx, &obj->as<ImportEntryObject>());
+    RootedImportEntryObject self(cx, &obj->as<ImportEntryObject>());
     self->initReservedSlot(ModuleRequestSlot, StringValue(moduleRequest));
     self->initReservedSlot(ImportNameSlot, StringValue(importName));
     self->initReservedSlot(LocalNameSlot, StringValue(localName));
     return self;
 }
 
 ///////////////////////////////////////////////////////////////////////////
 // ExportEntryObject
@@ -189,17 +186,17 @@ ExportEntryObject::create(JSContext* cx,
                           HandleAtom maybeImportName,
                           HandleAtom maybeLocalName)
 {
     RootedObject proto(cx, cx->global()->getExportEntryPrototype());
     RootedObject obj(cx, NewObjectWithGivenProto(cx, &class_, proto));
     if (!obj)
         return nullptr;
 
-    RootedExportEntry self(cx, &obj->as<ExportEntryObject>());
+    RootedExportEntryObject self(cx, &obj->as<ExportEntryObject>());
     self->initReservedSlot(ExportNameSlot, StringOrNullValue(maybeExportName));
     self->initReservedSlot(ModuleRequestSlot, StringOrNullValue(maybeModuleRequest));
     self->initReservedSlot(ImportNameSlot, StringOrNullValue(maybeImportName));
     self->initReservedSlot(LocalNameSlot, StringOrNullValue(maybeLocalName));
     return self;
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -936,31 +933,31 @@ ModuleBuilder::buildAndInit(frontend::Pa
             break;
 
           default:
             break;
         }
     }
 
     for (const auto& e : exportEntries_) {
-        RootedExportEntry exp(cx_, e);
+        RootedExportEntryObject exp(cx_, e);
         if (!exp->moduleRequest()) {
-            RootedImportEntry importEntry(cx_, importEntryFor(exp->localName()));
+            RootedImportEntryObject importEntry(cx_, importEntryFor(exp->localName()));
             if (!importEntry) {
                 if (!appendLocalExportEntry(exp))
                     return false;
             } else {
                 if (importEntry->importName() == cx_->names().star) {
                     if (!appendLocalExportEntry(exp))
                         return false;
                 } else {
                     RootedAtom exportName(cx_, exp->exportName());
                     RootedAtom moduleRequest(cx_, importEntry->moduleRequest());
                     RootedAtom importName(cx_, importEntry->importName());
-                    RootedExportEntry exportEntry(cx_);
+                    RootedExportEntryObject exportEntry(cx_);
                     exportEntry = ExportEntryObject::create(cx_,
                                                             exportName,
                                                             moduleRequest,
                                                             importName,
                                                             nullptr);
                     if (!exportEntry || !indirectExportEntries_.append(exportEntry))
                         return false;
                 }
@@ -1034,17 +1031,17 @@ ModuleBuilder::processImport(frontend::P
         MOZ_ASSERT(spec->pn_right->isArity(PN_NAME));
 
         RootedAtom importName(cx_, spec->pn_left->pn_atom);
         RootedAtom localName(cx_, spec->pn_right->pn_atom);
 
         if (!importedBoundNames_.append(localName))
             return false;
 
-        RootedImportEntry importEntry(cx_);
+        RootedImportEntryObject importEntry(cx_);
         importEntry = ImportEntryObject::create(cx_, module, importName, localName);
         if (!importEntry || !importEntries_.append(importEntry))
             return false;
     }
 
     return true;
 }
 
--- a/js/src/builtin/ModuleObject.h
+++ b/js/src/builtin/ModuleObject.h
@@ -49,16 +49,19 @@ class ImportEntryObject : public NativeO
                                      HandleAtom moduleRequest,
                                      HandleAtom importName,
                                      HandleAtom localName);
     JSAtom* moduleRequest();
     JSAtom* importName();
     JSAtom* localName();
 };
 
+typedef Rooted<ImportEntryObject*> RootedImportEntryObject;
+typedef Handle<ImportEntryObject*> HandleImportEntryObject;
+
 class ExportEntryObject : public NativeObject
 {
   public:
     enum
     {
         ExportNameSlot = 0,
         ModuleRequestSlot,
         ImportNameSlot,