ASSERT_VALID_CODE_POINTER(m_value);
}
+ template<typename returnType, typename argType1, typename argType2, typename argType3, typename argType4, typename argType5, typename argType6>
+ FunctionPtr(returnType(*value)(argType1, argType2, argType3, argType4, argType5, argType6))
+ : m_value((void*)value)
+ {
+ ASSERT_VALID_CODE_POINTER(m_value);
+ }
+
+
// MSVC doesn't seem to treat functions with different calling conventions as
// different types; these methods already defined for fastcall, below.
#if CALLING_CONVENTION_IS_STDCALL && !OS(WINDOWS)
void InstructionSelection::callValue(IR::Call *call, IR::Temp *result)
{
+ IR::Temp *baseTemp = call->base->asTemp();
+ assert(baseTemp != 0);
+
+ int argc = prepareVariableArguments(call->args);
+ IR::Temp* thisObject = 0;
+ generateFunctionCall(__qmljs_call_value, ContextRegister, result, baseTemp, thisObject, baseAddressForCallArguments(), TrustedImm32(argc));
+ checkExceptions();
}
void InstructionSelection::callProperty(IR::Call *call, IR::Temp *result)
{
+ IR::Member *member = call->base->asMember();
+ assert(member != 0);
+ assert(member->base->asTemp() != 0);
+
+ int argc = prepareVariableArguments(call->args);
+ IR::Temp* thisObject = 0;
+ generateFunctionCall(__qmljs_call_property, ContextRegister, result, member->base->asTemp(), identifier(*member->name), baseAddressForCallArguments(), TrustedImm32(argc));
+ checkExceptions();
}
void InstructionSelection::constructActivationProperty(IR::New *call, IR::Temp *result)
push(TrustedImmPtr(name));
}
+ template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6>
+ void generateFunctionCall(FunctionPtr function, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6)
+ {
+ // Reverse order
+ push(arg6);
+ push(arg5);
+ push(arg4);
+ push(arg3);
+ push(arg2);
+ push(arg1);
+ callAbsolute(function);
+ add32(TrustedImm32(6 * sizeof(void*)), StackPointerRegister);
+ }
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
void generateFunctionCall(FunctionPtr function, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5)
{