Bug 881882 - rm JS_ASMJS (r=sstangl)

--HG--
extra : rebase_source : 9b848e6206b471fef6e57432697d6c28b68e80c2
This commit is contained in:
Luke Wagner 2013-06-12 16:29:09 -07:00
parent a9a4d2d5eb
commit a89035aa2b
8 changed files with 12 additions and 47 deletions

View File

@ -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, ScopedJSDeletePtr<Asm
return m.finish(module);
}
#endif // defined(JS_ASMJS)
static bool
Warn(JSContext *cx, int code, const char *str = NULL)
{
@ -6088,7 +6084,6 @@ js::CompileAsmJS(JSContext *cx, TokenStream &ts, ParseNode *fn, const CompileOpt
if (cx->compartment()->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;

View File

@ -12,10 +12,6 @@
# include <mach/mach.h>
#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;

View File

@ -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)

View File

@ -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
}

View File

@ -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;
}

View File

@ -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

View File

@ -973,7 +973,6 @@ JSOpToCondition(JSOp op, bool isSigned)
typedef Vector<MIRType, 8> 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

View File

@ -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<JSObject>();