From 4b82c566a45cf0aeadda1b362adea7500a567d58 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Wed, 12 Jun 2013 16:29:09 -0700 Subject: [PATCH] Bug 881882 - rm JS_ASMJS (r=sstangl) --HG-- extra : rebase_source : 9b848e6206b471fef6e57432697d6c28b68e80c2 --- js/src/ion/AsmJS.cpp | 12 ------------ js/src/ion/AsmJS.h | 10 +++------- js/src/ion/AsmJSLink.cpp | 4 ---- js/src/ion/AsmJSSignalHandlers.cpp | 21 +++++++-------------- js/src/ion/EffectiveAddressAnalysis.cpp | 4 ---- js/src/ion/IonMacroAssembler.cpp | 2 -- js/src/ion/IonMacroAssembler.h | 2 -- js/src/jsdbgapi.cpp | 4 ++-- 8 files changed, 12 insertions(+), 47 deletions(-) diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index 82a7c8c9ef2e..ddbee04c707e 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -29,8 +29,6 @@ using namespace js::ion; # include "jitprofiling.h" #endif -#ifdef JS_ASMJS - /*****************************************************************************/ // ParseNode utilities @@ -6062,8 +6060,6 @@ CheckModule(JSContext *cx, TokenStream &ts, ParseNode *fn, ScopedJSDeletePtrcompartment()->debugMode()) return Warn(cx, JSMSG_USE_ASM_TYPE_FAIL, "Disabled by debugger"); -#ifdef JS_ASMJS if (!EnsureAsmJSSignalHandlersInstalled(cx->runtime())) return Warn(cx, JSMSG_USE_ASM_TYPE_FAIL, "Platform missing signal handler support"); @@ -6124,9 +6119,6 @@ js::CompileAsmJS(JSContext *cx, TokenStream &ts, ParseNode *fn, const CompileOpt SetAsmJSModuleObject(moduleFun, moduleObj); return Warn(cx, JSMSG_USE_ASM_TYPE_OK); -#else - return Warn(cx, JSMSG_USE_ASM_TYPE_FAIL, "Platform not supported (yet)"); -#endif } JSBool @@ -6134,13 +6126,9 @@ 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->hasOption(JSOPTION_ASMJS); -#else - bool available = false; -#endif args.rval().set(BooleanValue(available)); return true; diff --git a/js/src/ion/AsmJS.h b/js/src/ion/AsmJS.h index fbcdb82d9676..c0147c7be93a 100644 --- a/js/src/ion/AsmJS.h +++ b/js/src/ion/AsmJS.h @@ -12,10 +12,6 @@ # include #endif -#if defined(JS_ION) -# define JS_ASMJS -#endif - namespace js { class ScriptSource; @@ -158,11 +154,11 @@ struct AsmJSParallelTask // Returns true if the given native is the one that is used to implement asm.js // module functions. -#ifdef JS_ASMJS -bool +#ifdef JS_ION +extern bool IsAsmJSModuleNative(js::Native native); #else -static inline bool +inline bool IsAsmJSModuleNative(js::Native native) { return false; diff --git a/js/src/ion/AsmJSLink.cpp b/js/src/ion/AsmJSLink.cpp index 74d267c23c19..e8fb35277e4d 100644 --- a/js/src/ion/AsmJSLink.cpp +++ b/js/src/ion/AsmJSLink.cpp @@ -23,8 +23,6 @@ using namespace js; using namespace js::ion; using namespace mozilla; -#ifdef JS_ASMJS - static bool LinkFail(JSContext *cx, const char *str) { @@ -529,5 +527,3 @@ js::IsAsmJSModuleNative(js::Native native) { return native == LinkAsmJS; } - -#endif // defined(JS_ASMJS) diff --git a/js/src/ion/AsmJSSignalHandlers.cpp b/js/src/ion/AsmJSSignalHandlers.cpp index 25d50f097d74..6536507bcaa0 100644 --- a/js/src/ion/AsmJSSignalHandlers.cpp +++ b/js/src/ion/AsmJSSignalHandlers.cpp @@ -16,8 +16,6 @@ using namespace js; using namespace js::ion; using namespace mozilla; -#ifdef JS_ASMJS - #if defined(XP_WIN) # define XMM_sig(p,i) ((p)->Xmm##i) # define EIP_sig(p) ((p)->Eip) @@ -935,26 +933,24 @@ AsmJSFaultHandler(int signum, siginfo_t *info, void *context) } } # endif -#endif // JS_ASMJS bool EnsureAsmJSSignalHandlersInstalled(JSRuntime *rt) { -#if defined(JS_ASMJS) -# if defined(XP_MACOSX) +#if defined(XP_MACOSX) // On OSX, each JSRuntime gets its own handler. return rt->asmJSMachExceptionHandler.installed() || rt->asmJSMachExceptionHandler.install(rt); -# else +#else // Assume Windows or Unix. For these platforms, there is a single, // process-wide signal handler installed. Take care to only install it once. InstallSignalHandlersMutex::Lock lock; if (lock.handlersInstalled()) return true; -# if defined(XP_WIN) +# if defined(XP_WIN) if (!AddVectoredExceptionHandler(/* FirstHandler = */true, AsmJSExceptionHandler)) return false; -# else // assume Unix +# else // assume Unix struct sigaction sigAction; sigAction.sa_sigaction = &AsmJSFaultHandler; sigemptyset(&sigAction.sa_mask); @@ -963,10 +959,9 @@ EnsureAsmJSSignalHandlersInstalled(JSRuntime *rt) return false; if (sigaction(SIGBUS, &sigAction, &sPrevBusHandler)) return false; -# endif +# endif lock.setHandlersInstalled(); -# endif #endif return true; } @@ -984,7 +979,6 @@ EnsureAsmJSSignalHandlersInstalled(JSRuntime *rt) void js::TriggerOperationCallbackForAsmJSCode(JSRuntime *rt) { -#if defined(JS_ASMJS) JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock()); AsmJSActivation *activation = rt->mainThread.asmJSActivationStackFromAnyThread(); @@ -993,14 +987,13 @@ js::TriggerOperationCallbackForAsmJSCode(JSRuntime *rt) const AsmJSModule &module = activation->module(); -# if defined(XP_WIN) +#if defined(XP_WIN) DWORD oldProtect; if (!VirtualProtect(module.functionCode(), module.functionBytes(), PAGE_NOACCESS, &oldProtect)) MOZ_CRASH(); -# else // assume Unix +#else // assume Unix if (mprotect(module.functionCode(), module.functionBytes(), PROT_NONE)) MOZ_CRASH(); -# endif #endif } diff --git a/js/src/ion/EffectiveAddressAnalysis.cpp b/js/src/ion/EffectiveAddressAnalysis.cpp index e936a6ebfe8d..45b83de2d68a 100644 --- a/js/src/ion/EffectiveAddressAnalysis.cpp +++ b/js/src/ion/EffectiveAddressAnalysis.cpp @@ -9,7 +9,6 @@ using namespace js; using namespace ion; -#ifdef JS_ASMJS static void AnalyzeLsh(MBasicBlock *block, MLsh *lsh) { @@ -87,7 +86,6 @@ AnalyzeLsh(MBasicBlock *block, MLsh *lsh) last->replaceAllUsesWith(eaddr); block->insertAfter(last, eaddr); } -#endif // This analysis converts patterns of the form: // truncate(x + (y << {0,1,2,3})) @@ -106,13 +104,11 @@ AnalyzeLsh(MBasicBlock *block, MLsh *lsh) bool EffectiveAddressAnalysis::analyze() { -#if defined(JS_ASMJS) for (ReversePostorderIterator block(graph_.rpoBegin()); block != graph_.rpoEnd(); block++) { for (MInstructionIterator i = block->begin(); i != block->end(); i++) { if (i->isLsh()) AnalyzeLsh(*block, i->toLsh()); } } -#endif return true; } diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index e60feedbce77..3ec382bfad49 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -1208,7 +1208,6 @@ MacroAssembler::popRooted(VMFunction::RootType rootType, Register cellReg, } } -#ifdef JS_ASMJS ABIArgIter::ABIArgIter(const MIRTypeVector &types) : gen_(), types_(types), @@ -1226,4 +1225,3 @@ ABIArgIter::operator++(int) if (!done()) gen_.next(types_[i_]); } -#endif diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index a009d85d4123..7c48e7081f48 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -973,7 +973,6 @@ JSOpToCondition(JSOp op, bool isSigned) typedef Vector MIRTypeVector; -#ifdef JS_ASMJS class ABIArgIter { ABIArgGenerator gen_; @@ -993,7 +992,6 @@ class ABIArgIter MIRType mirType() const { JS_ASSERT(!done()); return types_[i_]; } uint32_t stackBytesConsumedSoFar() const { return gen_.stackBytesConsumedSoFar(); } }; -#endif } // namespace ion } // namespace js diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 1132434c829b..5ee1c1a98e50 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -29,7 +29,7 @@ #include "vm/Interpreter.h" #include "vm/Shape.h" -#ifdef JS_ASMJS +#ifdef JS_ION #include "ion/AsmJSModule.h" #endif @@ -912,7 +912,7 @@ JS_DumpCompartmentPCCounts(JSContext *cx) JS_DumpPCCounts(cx, script); } -#if defined(JS_ASMJS) && defined(DEBUG) +#if defined(JS_ION) && defined(DEBUG) for (unsigned thingKind = FINALIZE_OBJECT0; thingKind < FINALIZE_OBJECT_LIMIT; thingKind++) { for (CellIter i(cx->zone(), (AllocKind) thingKind); !i.done(); i.next()) { JSObject *obj = i.get();