Bug 858783 - Check user-controlled asm.js flag. r=luke
authorSean Stangl <sstangl@mozilla.com>
Thu, 11 Apr 2013 11:39:59 -0700
changeset 128489 e438d532b4af99ab3c358a24f153355dc2db8d67
parent 128488 83b8038839f1bda4c5f42afe54b63469a61eeb6f
child 128490 f556245d6da1f6edf50fbbea4180d2d22d1a3a63
push id24529
push userryanvm@gmail.com
push dateFri, 12 Apr 2013 11:51:36 +0000
treeherdermozilla-central@5bc732a49eae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs858783
milestone23.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 858783 - Check user-controlled asm.js flag. r=luke
js/src/ion/AsmJS.cpp
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -5524,17 +5524,18 @@ js::CompileAsmJS(JSContext *cx, TokenStr
 
 JSBool
 js::IsAsmJSCompilationAvailable(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
 #ifdef JS_ASMJS
     bool available = JSC::MacroAssembler().supportsFloatingPoint() &&
-                     !cx->compartment->debugMode();
+                     !cx->compartment->debugMode() &&
+                     cx->hasOption(JSOPTION_ASMJS);
 #else
     bool available = false;
 #endif
 
     args.rval().set(BooleanValue(available));
     return true;
 }