Backed out 2 changesets (bug 895015, bug 893434) for Android test_asmjs timeouts on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 18 Jul 2013 13:03:05 -0400
changeset 152278 fe3437dad9630ed3ec38e9dc00aabe2a40c54b5e
parent 152277 df2ffeb51fc031a2e3c56ec0a590274c9d1fbc19
child 152279 d64c6ceee5a7199b2e32fe1d2add359be59f331e
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs895015, 893434
milestone25.0a1
backs outcadcb731a8fb37f69d849b31606d0e6bc33a8a58
17404ee140f37a48050ebff6096c77dc9e1c55a5
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
Backed out 2 changesets (bug 895015, bug 893434) for Android test_asmjs timeouts on a CLOSED TREE. Backed out changeset cadcb731a8fb (bug 895015) Backed out changeset 17404ee140f3 (bug 893434)
js/src/ion/AsmJSLink.cpp
js/src/jit-test/lib/asm.js
js/src/jit-test/tests/asm.js/testGlobals.js
js/src/vm/SPSProfiler.cpp
--- a/js/src/ion/AsmJSLink.cpp
+++ b/js/src/ion/AsmJSLink.cpp
@@ -31,28 +31,16 @@ static bool
 LinkFail(JSContext *cx, const char *str)
 {
     JS_ReportErrorFlagsAndNumber(cx, JSREPORT_WARNING, js_GetErrorMessage,
                                  NULL, JSMSG_USE_ASM_LINK_FAIL, str);
     return false;
 }
 
 static bool
-GetDataProperty(JSContext *cx, const Value &objVal, HandlePropertyName field, MutableHandleValue v)
-{
-    if (!objVal.isObject())
-        return LinkFail(cx, "accessing property of non-object");
-    if (!objVal.toObject().isNative())
-        return LinkFail(cx, "accessing property of non-host object");
-    if (!HasDataProperty(cx, &objVal.toObject(), NameToId(field), v.address()))
-        return LinkFail(cx, "object missing data property");
-    return true;
-}
-
-static bool
 ValidateGlobalVariable(JSContext *cx, const AsmJSModule &module, AsmJSModule::Global &global,
                        HandleValue importVal)
 {
     JS_ASSERT(global.which() == AsmJSModule::Global::Variable);
 
     void *datum = module.globalVarIndexToGlobalDatum(global.varIndex());
 
     switch (global.varInitKind()) {
@@ -62,17 +50,17 @@ ValidateGlobalVariable(JSContext *cx, co
             *(int32_t *)datum = v.toInt32();
         else
             *(double *)datum = v.toDouble();
         break;
       }
       case AsmJSModule::Global::InitImport: {
         RootedPropertyName field(cx, global.varImportField());
         RootedValue v(cx);
-        if (!GetDataProperty(cx, importVal, field, &v))
+        if (!GetProperty(cx, importVal, field, &v))
             return false;
 
         switch (global.varImportCoercion()) {
           case AsmJS_ToInt32:
             if (!ToInt32(cx, v, (int32_t *)datum))
                 return false;
             break;
           case AsmJS_ToNumber:
@@ -88,49 +76,49 @@ ValidateGlobalVariable(JSContext *cx, co
 }
 
 static bool
 ValidateFFI(JSContext *cx, AsmJSModule::Global &global, HandleValue importVal,
             AutoObjectVector *ffis)
 {
     RootedPropertyName field(cx, global.ffiField());
     RootedValue v(cx);
-    if (!GetDataProperty(cx, importVal, field, &v))
+    if (!GetProperty(cx, importVal, field, &v))
         return false;
 
     if (!v.isObject() || !v.toObject().is<JSFunction>())
         return LinkFail(cx, "FFI imports must be functions");
 
     (*ffis)[global.ffiIndex()] = &v.toObject().as<JSFunction>();
     return true;
 }
 
 static bool
 ValidateArrayView(JSContext *cx, AsmJSModule::Global &global, HandleValue globalVal,
                   HandleValue bufferVal)
 {
     RootedPropertyName field(cx, global.viewName());
     RootedValue v(cx);
-    if (!GetDataProperty(cx, globalVal, field, &v))
+    if (!GetProperty(cx, globalVal, field, &v))
         return false;
 
     if (!IsTypedArrayConstructor(v, global.viewType()))
         return LinkFail(cx, "bad typed array constructor");
 
     return true;
 }
 
 static bool
 ValidateMathBuiltin(JSContext *cx, AsmJSModule::Global &global, HandleValue globalVal)
 {
     RootedValue v(cx);
-    if (!GetDataProperty(cx, globalVal, cx->names().Math, &v))
+    if (!GetProperty(cx, globalVal, cx->names().Math, &v))
         return false;
     RootedPropertyName field(cx, global.mathName());
-    if (!GetDataProperty(cx, v, field, &v))
+    if (!GetProperty(cx, v, field, &v))
         return false;
 
     Native native = NULL;
     switch (global.mathBuiltin()) {
       case AsmJSMathBuiltin_sin: native = math_sin; break;
       case AsmJSMathBuiltin_cos: native = math_cos; break;
       case AsmJSMathBuiltin_tan: native = math_tan; break;
       case AsmJSMathBuiltin_asin: native = math_asin; break;
@@ -153,17 +141,17 @@ ValidateMathBuiltin(JSContext *cx, AsmJS
     return true;
 }
 
 static bool
 ValidateGlobalConstant(JSContext *cx, AsmJSModule::Global &global, HandleValue globalVal)
 {
     RootedPropertyName field(cx, global.constantName());
     RootedValue v(cx);
-    if (!GetDataProperty(cx, globalVal, field, &v))
+    if (!GetProperty(cx, globalVal, field, &v))
         return false;
 
     if (!v.isNumber())
         return LinkFail(cx, "global constant value needs to be a number");
 
     // NaN != NaN
     if (IsNaN(global.constantValue())) {
         if (!IsNaN(v.toNumber()))
@@ -268,22 +256,18 @@ DynamicallyLinkModule(JSContext *cx, Cal
 AsmJSActivation::AsmJSActivation(JSContext *cx, AsmJSModule &module)
   : cx_(cx),
     module_(module),
     errorRejoinSP_(NULL),
     profiler_(NULL),
     resumePC_(NULL)
 {
     if (cx->runtime()->spsProfiler.enabled()) {
-        // Use a profiler string that matches jsMatch regex in
-        // browser/devtools/profiler/cleopatra/js/parserWorker.js.
-        // (For now use a single static string to avoid further slowing down
-        // calls into asm.js.)
         profiler_ = &cx->runtime()->spsProfiler;
-        profiler_->enterNative("asm.js code :0", this);
+        profiler_->enterNative("asm.js code", this);
     }
 
     prev_ = cx_->runtime()->mainThread.asmJSActivationStack_;
 
     JSRuntime::AutoLockForOperationCallback lock(cx_->runtime());
     cx_->runtime()->mainThread.asmJSActivationStack_ = this;
 
     (void) errorRejoinSP_;  // squelch GCC warning
--- a/js/src/jit-test/lib/asm.js
+++ b/js/src/jit-test/lib/asm.js
@@ -73,25 +73,18 @@ function assertAsmTypeFail()
     options("werror");
 }
 
 function assertAsmLinkFail(f)
 {
     if (!isAsmJSCompilationAvailable())
         return;
 
-    assertEq(isAsmJSModule(f), true);
-
     // Verify no error is thrown with warnings off
-    var ret = f.apply(null, Array.slice(arguments, 1));
-
-    assertEq(isAsmJSFunction(ret), false);
-    if (typeof ret === 'object')
-        for (f of ret)
-            assertEq(isAsmJSFunction(f), false);
+    f.apply(null, Array.slice(arguments, 1));
 
     // Turn on warnings-as-errors
     var oldOpts = options("werror");
     assertEq(oldOpts.indexOf("werror"), -1);
 
     // Verify an error is thrown
     var caught = false;
     try {
--- a/js/src/jit-test/tests/asm.js/testGlobals.js
+++ b/js/src/jit-test/tests/asm.js/testGlobals.js
@@ -38,34 +38,20 @@ assertAsmLinkAlwaysFail(code, null);
 assertAsmLinkFail(code, 3);
 assertAsmLinkFail(code, {});
 assertAsmLinkFail(code, {Infinity:Infinity});
 assertAsmLinkFail(code, {Infinity:-Infinity});
 assertEq(asmLink(code, {NaN:NaN})(), NaN);
 var code = asmCompile('global', USE_ASM + 'var i=global.NaN; function f() { return +i } return f');
 assertEq(asmLink(code, this)(), NaN);
 
-assertAsmLinkFail(asmCompile('glob','foreign','buf', USE_ASM + 'var t = new glob.Int32Array(buf); function f() {} return f'), {get Int32Array(){return Int32Array}}, null, new ArrayBuffer(4096))
-assertAsmLinkFail(asmCompile('glob','foreign','buf', USE_ASM + 'var t = new glob.Int32Array(buf); function f() {} return f'), new Proxy({}, {get:function() {return Int32Array}}), null, new ArrayBuffer(4096))
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Math.sin; function f() {} return f'), {get Math(){return Math}});
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Math.sin; function f() {} return f'), new Proxy({}, {get:function(){return Math}}));
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Math.sin; function f() {} return f'), {Math:{get sin(){return Math.sin}}});
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Math.sin; function f() {} return f'), {Math:new Proxy({}, {get:function(){return Math.sin}})});
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Infinity; function f() {} return f'), {get Infinity(){return Infinity}});
-assertAsmLinkFail(asmCompile('glob', USE_ASM + 'var t = glob.Math.sin; function f() {} return f'), new Proxy({}, {get:function(){return Infinity}}));
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x|0; function f() {} return f'), null, {get x(){return 42}})
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = +foreign.x; function f() {} return f'), null, {get x(){return 42}})
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x|0; function f() {} return f'), null, new Proxy({}, {get:function() { return 42}}));
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = +foreign.x; function f() {} return f'), null, new Proxy({}, {get:function() { return 42}}));
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x; function f() {} return f'), null, {get x(){return function(){}}})
-assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x; function f() {} return f'), null, new Proxy({}, {get:function() { return function(){}}}));
 assertAsmTypeFail('global', 'imp', USE_ASM + "var i=imp; function f() { return i|0 } return f");
 assertAsmTypeFail('global', 'imp', USE_ASM + "var j=0;var i=j.i|0; function f() { return i|0 } return f");
 assertAsmLinkAlwaysFail(asmCompile('global','imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), null, undefined);
 assertAsmLinkAlwaysFail(asmCompile('global','imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), this, undefined);
 assertAsmLinkAlwaysFail(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), null, null);
 assertAsmLinkAlwaysFail(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), this, null);
-assertAsmLinkFail(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), this, 42);
+assertEq(asmLink(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f"), this, 42)(), 0);
 assertEq(asmLink(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f")(null, {i:42})), 42);
 assertEq(asmLink(asmCompile('global', 'imp', USE_ASM + "var i=imp.i|0; function f() { return i|0 } return f")(null, {i:1.4})), 1);
 assertEq(asmLink(asmCompile('global', 'imp', USE_ASM + "var i=+imp.i; function f() { return +i } return f")(null, {i:42})), 42);
 assertEq(asmLink(asmCompile('global', 'imp', USE_ASM + "var i=+imp.i; function f() { return +i } return f")(this, {i:1.4})), 1.4);
 assertEq(asmLink(asmCompile(USE_ASM + "var g=0; function f() { var i=42; while (1) { break; } g = i; return g|0 } return f"))(), 42);
--- a/js/src/vm/SPSProfiler.cpp
+++ b/js/src/vm/SPSProfiler.cpp
@@ -200,18 +200,16 @@ SPSProfiler::pop()
  * Serializes the script/function pair into a "descriptive string" which is
  * allowed to fail. This function cannot trigger a GC because it could finalize
  * some scripts, resize the hash table of profile strings, and invalidate the
  * AddPtr held while invoking allocProfileString.
  */
 const char*
 SPSProfiler::allocProfileString(JSContext *cx, JSScript *script, JSFunction *maybeFun)
 {
-    // Note: this profiler string is regexp-matched by
-    // browser/devtools/profiler/cleopatra/js/parserWorker.js.
     DebugOnly<uint64_t> gcBefore = cx->runtime()->gcNumber;
     StringBuffer buf(cx);
     bool hasAtom = maybeFun != NULL && maybeFun->displayAtom() != NULL;
     if (hasAtom) {
         if (!buf.append(maybeFun->displayAtom()))
             return NULL;
         if (!buf.append(" ("))
             return NULL;