JITStubCall(JIT* jit, JSObject* (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Cell)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
JITStubCall(JIT* jit, JSPropertyNameIterator* (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Cell)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
JITStubCall(JIT* jit, void* (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(VoidPtr)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
JITStubCall(JIT* jit, int (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Int)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
JITStubCall(JIT* jit, bool (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Int)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
JITStubCall(JIT* jit, void (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Void)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
-#if USE(JSVALUE32_64)
JITStubCall(JIT* jit, EncodedJSValue (JIT_STUB *stub)(STUB_ARGS_DECLARATION))
: m_jit(jit)
, m_stub(stub)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
, m_returnType(Value)
+#endif
, m_stackIndex(JITSTACKFRAME_ARGS_INDEX)
{
}
-#endif
// Arguments are added first to last.
m_jit->poke(argument, m_stackIndex);
m_stackIndex += stackIndexStep;
}
+
+ void addArgument(JIT::Imm32 argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
void addArgument(JIT::TrustedImmPtr argument)
{
m_jit->poke(argument, m_stackIndex);
m_stackIndex += stackIndexStep;
}
+
+ void addArgument(JIT::ImmPtr argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
void addArgument(JIT::RegisterID argument)
{
+#if USE(JSVALUE32_64)
m_jit->poke(argument, m_stackIndex);
+#else
+ m_jit->poke64(argument, m_stackIndex);
+#endif
m_stackIndex += stackIndexStep;
}
m_jit->poke(JIT::Imm32(value.tag()), m_stackIndex + 1);
m_stackIndex += stackIndexStep;
}
+#else
+ void addArgument(JIT::TrustedImm64 argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
+
+ void addArgument(JIT::Imm64 argument)
+ {
+ m_jit->poke(argument, m_stackIndex);
+ m_stackIndex += stackIndexStep;
+ }
#endif
void addArgument(JIT::RegisterID tag, JIT::RegisterID payload)
void addArgument(unsigned src, JIT::RegisterID scratchRegister) // src is a virtual register.
{
if (m_jit->m_codeBlock->isConstantRegisterIndex(src))
- addArgument(JIT::ImmPtr(JSValue::encode(m_jit->m_codeBlock->getConstant(src))));
+ addArgument(JIT::Imm64(JSValue::encode(m_jit->m_codeBlock->getConstant(src))));
else {
- m_jit->loadPtr(JIT::Address(JIT::callFrameRegister, src * sizeof(Register)), scratchRegister);
+ m_jit->load64(JIT::Address(JIT::callFrameRegister, src * sizeof(Register)), scratchRegister);
addArgument(scratchRegister);
}
m_jit->killLastResultRegister();
#endif
m_jit->restoreArgumentReference();
+ m_jit->updateTopCallFrame();
JIT::Call call = m_jit->call();
m_jit->m_calls.append(CallRecord(call, m_jit->m_bytecodeOffset, m_stub.value()));
m_jit->emitStoreCell(dst, JIT::returnValueRegister);
return call;
}
+
+ JIT::Call callWithValueProfiling(unsigned dst)
+ {
+ ASSERT(m_returnType == Value || m_returnType == Cell);
+ JIT::Call call = this->call();
+ ASSERT(JIT::returnValueRegister == JIT::regT0);
+ if (m_returnType == Cell)
+ m_jit->move(JIT::TrustedImm32(JSValue::CellTag), JIT::regT1);
+ m_jit->emitValueProfilingSite();
+ if (m_returnType == Value)
+ m_jit->emitStore(dst, JIT::regT1, JIT::regT0);
+ else
+ m_jit->emitStoreCell(dst, JIT::returnValueRegister);
+ return call;
+ }
#else
JIT::Call call(unsigned dst) // dst is a virtual register.
{
- ASSERT(m_returnType == VoidPtr || m_returnType == Cell);
+ ASSERT(m_returnType == Value || m_returnType == Cell);
JIT::Call call = this->call();
m_jit->emitPutVirtualRegister(dst);
return call;
}
+
+ JIT::Call callWithValueProfiling(unsigned dst)
+ {
+ ASSERT(m_returnType == Value || m_returnType == Cell);
+ JIT::Call call = this->call();
+ ASSERT(JIT::returnValueRegister == JIT::regT0);
+ m_jit->emitValueProfilingSite();
+ m_jit->emitPutVirtualRegister(dst);
+ return call;
+ }
#endif
JIT::Call call(JIT::RegisterID dst) // dst is a machine register.
{
-#if USE(JSVALUE32_64)
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
ASSERT(m_returnType == Value || m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell);
-#else
- ASSERT(m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell);
#endif
JIT::Call call = this->call();
if (dst != JIT::returnValueRegister)
JIT* m_jit;
FunctionPtr m_stub;
+#if USE(JSVALUE32_64) || !ASSERT_DISABLED
enum { Void, VoidPtr, Int, Value, Cell } m_returnType;
+#endif
size_t m_stackIndex;
};
}