Bug 909826 - Change x86/x64 GenerateEntry to be more like ARM (r=bbouvier)

--HG--
extra : rebase_source : 04e5454e6bb4526875246bc1ca374764d5a8eb39
This commit is contained in:
Luke Wagner 2013-08-28 15:01:36 -05:00
parent 2b1946d99c
commit 7917fc914e
3 changed files with 2 additions and 20 deletions

View File

@ -5248,11 +5248,7 @@ GenerateEntry(ModuleCompiler &m, const AsmJSModule::ExportedFunction &exportedFu
masm.movePtr(StackPointer, Operand(activation, AsmJSActivation::offsetOfErrorRejoinSP()));
#if defined(JS_CPU_X64)
// Install the heap pointer into the globally-pinned HeapReg. The heap
// pointer is stored in the global data section and is patched at dynamic
// link time.
CodeOffsetLabel label = masm.loadRipRelativeInt64(HeapReg);
m.addGlobalAccess(AsmJSGlobalAccess(label.offset(), m.module().heapOffset()));
masm.movq(Operand(IntArgReg1, m.module().heapOffset()), HeapReg);
#endif
Register argv = ABIArgGenerator::NonArgReturnVolatileReg0;
@ -5261,8 +5257,8 @@ GenerateEntry(ModuleCompiler &m, const AsmJSModule::ExportedFunction &exportedFu
masm.movl(Operand(StackPointer, NativeFrameSize + masm.framePushed()), argv);
#elif defined(JS_CPU_X64)
masm.movq(IntArgReg0, argv);
masm.Push(argv);
#endif
masm.Push(argv);
// Bump the stack for the call.
const ModuleCompiler::Func &func = *m.lookupFunction(exportedFunc.name());
@ -5295,12 +5291,7 @@ GenerateEntry(ModuleCompiler &m, const AsmJSModule::ExportedFunction &exportedFu
masm.call(func.code());
masm.freeStack(stackDec);
#if defined(JS_CPU_X86)
masm.movl(Operand(StackPointer, NativeFrameSize + masm.framePushed()), argv);
#elif defined(JS_CPU_X64)
masm.Pop(argv);
#endif
// Store return value in argv[0]
switch (func.sig().retType().which()) {

View File

@ -362,13 +362,8 @@ CallAsmJS(JSContext *cx, unsigned argc, Value *vp)
JitActivation jitActivation(cx, /* firstFrameIsConstructing = */ false, /* active */ false);
// Call the per-exported-function trampoline created by GenerateEntry.
#ifdef JS_CPU_ARM
if (!module.entryTrampoline(func)(coercedArgs.begin(), module.globalData()))
return false;
#else
if (!module.entryTrampoline(func)(coercedArgs.begin()))
return false;
#endif
}
switch (func.returnType()) {

View File

@ -183,11 +183,7 @@ class AsmJSModule
ionCodeOffset_ = off;
}
};
#ifdef JS_CPU_ARM
typedef int32_t (*CodePtr)(uint64_t *args, uint8_t *global);
#else
typedef int32_t (*CodePtr)(uint64_t *args);
#endif
typedef Vector<AsmJSCoercion, 0, SystemAllocPolicy> ArgCoercionVector;