summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/Executable.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/Executable.h')
-rw-r--r--JavaScriptCore/runtime/Executable.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/JavaScriptCore/runtime/Executable.h b/JavaScriptCore/runtime/Executable.h
index ac63c49..39ddf49 100644
--- a/JavaScriptCore/runtime/Executable.h
+++ b/JavaScriptCore/runtime/Executable.h
@@ -86,6 +86,8 @@ namespace JSC {
protected:
JITCode m_jitCodeForCall;
JITCode m_jitCodeForConstruct;
+ MacroAssemblerCodePtr m_jitCodeForCallWithArityCheck;
+ MacroAssemblerCodePtr m_jitCodeForConstructWithArityCheck;
#endif
};
@@ -93,9 +95,9 @@ namespace JSC {
class NativeExecutable : public ExecutableBase {
friend class JIT;
public:
- static PassRefPtr<NativeExecutable> create(MacroAssemblerCodePtr thunk, NativeFunction function)
+ static PassRefPtr<NativeExecutable> create(MacroAssemblerCodePtr callThunk, NativeFunction function, MacroAssemblerCodePtr constructThunk, NativeFunction constructor)
{
- return adoptRef(new NativeExecutable(JITCode::HostFunction(thunk), function));
+ return adoptRef(new NativeExecutable(JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor));
}
~NativeExecutable();
@@ -103,15 +105,21 @@ namespace JSC {
NativeFunction function() { return m_function; }
private:
- NativeExecutable(JITCode thunk, NativeFunction function)
+ NativeExecutable(JITCode callThunk, NativeFunction function, JITCode constructThunk, NativeFunction constructor)
: ExecutableBase(NUM_PARAMETERS_IS_HOST)
, m_function(function)
+ , m_constructor(constructor)
{
- m_jitCodeForCall = thunk;
- m_jitCodeForConstruct = thunk;
+ m_jitCodeForCall = callThunk;
+ m_jitCodeForConstruct = constructThunk;
+ m_jitCodeForCallWithArityCheck = callThunk.addressForCall();
+ m_jitCodeForConstructWithArityCheck = constructThunk.addressForCall();
}
NativeFunction m_function;
+ // Probably should be a NativeConstructor, but this will currently require rewriting the JIT
+ // trampoline. It may be easier to make NativeFunction be passed 'this' as a part of the ArgList.
+ NativeFunction m_constructor;
};
#endif
@@ -403,6 +411,20 @@ namespace JSC {
return m_jitCodeForConstruct;
}
+ MacroAssemblerCodePtr generatedJITCodeForCallWithArityCheck()
+ {
+ ASSERT(m_jitCodeForCall);
+ ASSERT(m_jitCodeForCallWithArityCheck);
+ return m_jitCodeForCallWithArityCheck;
+ }
+
+ MacroAssemblerCodePtr generatedJITCodeForConstructWithArityCheck()
+ {
+ ASSERT(m_jitCodeForConstruct);
+ ASSERT(m_jitCodeForConstructWithArityCheck);
+ return m_jitCodeForConstructWithArityCheck;
+ }
+
private:
void generateJITCodeForCall(ExecState*, ScopeChainNode*);
void generateJITCodeForConstruct(ExecState*, ScopeChainNode*);