Backed out changeset 8d198ef0b559 (bug 1082583) for test_headers.html failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 15 Oct 2014 13:17:06 -0400
changeset 210556 1caf249e58c3024c91f5732ca00d4483a16d2e35
parent 210555 7f5287115874d9efd54ee8d2db40459577e8eddc
child 210557 a280a03c9f3cc6207cd17a7c76081e4e7ffd4eea
push id9381
push userryanvm@gmail.com
push dateWed, 15 Oct 2014 18:41:20 +0000
treeherderfx-team@a280a03c9f3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1082583
milestone36.0a1
backs out8d198ef0b5596bc4c6c1a72ef9ae3c981025ca65
Backed out changeset 8d198ef0b559 (bug 1082583) for test_headers.html failures. CLOSED TREE
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3902,18 +3902,17 @@ def getJSToNativeConversionInfo(type, de
                                 treatNullAs="Default",
                                 isEnforceRange=False,
                                 isClamp=False,
                                 isNullOrUndefined=False,
                                 exceptionCode=None,
                                 lenientFloatCode=None,
                                 allowTreatNonCallableAsNull=False,
                                 isCallbackReturnValue=False,
-                                sourceDescription="value",
-                                nestingLevel=""):
+                                sourceDescription="value"):
     """
     Get a template for converting a JS value to a native object based on the
     given type and descriptor.  If failureCode is given, then we're actually
     testing whether we can convert the argument to the desired type.  That
     means that failures to convert due to the JS value being the wrong type of
     value need to use failureCode instead of throwing exceptions.  Failures to
     convert that are due to JS exceptions (from toString or valueOf methods) or
     out of memory conditions need to throw exceptions no matter what
@@ -4106,19 +4105,16 @@ def getJSToNativeConversionInfo(type, de
 
         setToNullCode = "${declName} = nullptr;\n"
         template = wrapObjectTemplate(templateBody, type, setToNullCode,
                                       failureCode)
         return JSToNativeConversionInfo(template, declType=declType,
                                         dealWithOptional=isOptional,
                                         declArgs=declArgs)
 
-    def incrementNestingLevel():
-        return 1 if nestingLevel is "" else ++nestingLevel
-
     assert not (isEnforceRange and isClamp)  # These are mutually exclusive
 
     if type.isArray():
         raise TypeError("Can't handle array arguments yet")
 
     if type.isSequence():
         assert not isEnforceRange and not isClamp
 
@@ -4156,77 +4152,75 @@ def getJSToNativeConversionInfo(type, de
             sequenceClass = "binding_detail::AutoSequence"
 
         # XXXbz we can't include the index in the sourceDescription, because
         # we don't really have a way to pass one in dynamically at runtime...
         elementInfo = getJSToNativeConversionInfo(
             elementType, descriptorProvider, isMember="Sequence",
             exceptionCode=exceptionCode, lenientFloatCode=lenientFloatCode,
             isCallbackReturnValue=isCallbackReturnValue,
-            sourceDescription="element of %s" % sourceDescription,
-            nestingLevel=incrementNestingLevel())
+            sourceDescription="element of %s" % sourceDescription)
         if elementInfo.dealWithOptional:
             raise TypeError("Shouldn't have optional things in sequences")
         if elementInfo.holderType is not None:
             raise TypeError("Shouldn't need holders for sequences")
 
         typeName = CGTemplatedType(sequenceClass, elementInfo.declType)
         sequenceType = typeName.define()
         if nullable:
             typeName = CGTemplatedType("Nullable", typeName)
             arrayRef = "${declName}.SetValue()"
         else:
             arrayRef = "${declName}"
 
         elementConversion = string.Template(elementInfo.template).substitute({
-                "val": "temp" + str(nestingLevel),
-                "declName": "slot" + str(nestingLevel),
+                "val": "temp",
+                "declName": "slot",
                 # We only need holderName here to handle isExternal()
                 # interfaces, which use an internal holder for the
                 # conversion even when forceOwningType ends up true.
-                "holderName": "tempHolder" + str(nestingLevel),
+                "holderName": "tempHolder",
                 "passedToJSImpl": "${passedToJSImpl}"
             })
 
         # NOTE: Keep this in sync with variadic conversions as needed
         templateBody = fill(
             """
-            JS::ForOfIterator iter${nestingLevel}(cx);
-            if (!iter${nestingLevel}.init($${val}, JS::ForOfIterator::AllowNonIterable)) {
+            JS::ForOfIterator iter(cx);
+            if (!iter.init($${val}, JS::ForOfIterator::AllowNonIterable)) {
               $*{exceptionCode}
             }
-            if (!iter${nestingLevel}.valueIsIterable()) {
+            if (!iter.valueIsIterable()) {
               $*{notSequence}
             }
-            ${sequenceType} &arr${nestingLevel} = ${arrayRef};
-            JS::Rooted<JS::Value> temp${nestingLevel}(cx);
+            ${sequenceType} &arr = ${arrayRef};
+            JS::Rooted<JS::Value> temp(cx);
             while (true) {
               bool done;
-              if (!iter${nestingLevel}.next(&temp, &done)) {
+              if (!iter.next(&temp, &done)) {
                 $*{exceptionCode}
               }
               if (done) {
                 break;
               }
-              ${elementType}* slotPtr${nestingLevel} = arr${nestingLevel}.AppendElement();
-              if (!slotPtr${nestingLevel}) {
+              ${elementType}* slotPtr = arr.AppendElement();
+              if (!slotPtr) {
                 JS_ReportOutOfMemory(cx);
                 $*{exceptionCode}
               }
-              ${elementType}& slot${nestingLevel} = *slotPtr${nestingLevel};
+              ${elementType}& slot = *slotPtr;
               $*{elementConversion}
             }
             """,
             exceptionCode=exceptionCode,
             notSequence=notSequence,
             sequenceType=sequenceType,
             arrayRef=arrayRef,
             elementType=elementInfo.declType.define(),
-            elementConversion=elementConversion,
-            nestingLevel=str(nestingLevel))
+            elementConversion=elementConversion)
 
         templateBody = wrapObjectTemplate(templateBody, type,
                                           "${declName}.SetNull();\n", notSequence)
         if isinstance(defaultValue, IDLEmptySequenceValue):
             if type.nullable():
                 codeToSetEmpty = "${declName}.SetValue();\n"
             else:
                 codeToSetEmpty = "/* Array is already empty; nothing to do */\n"
@@ -4263,18 +4257,17 @@ def getJSToNativeConversionInfo(type, de
             valueType = type.inner.inner
         else:
             valueType = type.inner
 
         valueInfo = getJSToNativeConversionInfo(
             valueType, descriptorProvider, isMember="MozMap",
             exceptionCode=exceptionCode, lenientFloatCode=lenientFloatCode,
             isCallbackReturnValue=isCallbackReturnValue,
-            sourceDescription="value in %s" % sourceDescription,
-            nestingLevel=incrementNestingLevel())
+            sourceDescription="value in %s" % sourceDescription)
         if valueInfo.dealWithOptional:
             raise TypeError("Shouldn't have optional things in MozMap")
         if valueInfo.holderType is not None:
             raise TypeError("Shouldn't need holders for MozMap")
 
         typeName = CGTemplatedType("MozMap", valueInfo.declType)
         mozMapType = typeName.define()
         if nullable: