summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/runtime/Executable.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-24 11:24:40 +0100
committerBen Murdoch <benm@google.com>2011-06-02 09:53:15 +0100
commit81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch)
tree7a9e5ed86ff429fd347a25153107221543909b19 /Source/JavaScriptCore/runtime/Executable.h
parent94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff)
downloadexternal_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/JavaScriptCore/runtime/Executable.h')
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index 544e487..b2565a0 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -92,22 +92,29 @@ namespace JSC {
#endif
};
-#if ENABLE(JIT)
class NativeExecutable : public ExecutableBase {
friend class JIT;
public:
+#if ENABLE(JIT)
static PassRefPtr<NativeExecutable> create(MacroAssemblerCodePtr callThunk, NativeFunction function, MacroAssemblerCodePtr constructThunk, NativeFunction constructor)
{
if (!callThunk)
return adoptRef(new NativeExecutable(JITCode(), function, JITCode(), constructor));
return adoptRef(new NativeExecutable(JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor));
}
+#else
+ static PassRefPtr<NativeExecutable> create(NativeFunction function, NativeFunction constructor)
+ {
+ return adoptRef(new NativeExecutable(function, constructor));
+ }
+#endif
~NativeExecutable();
NativeFunction function() { return m_function; }
private:
+#if ENABLE(JIT)
NativeExecutable(JITCode callThunk, NativeFunction function, JITCode constructThunk, NativeFunction constructor)
: ExecutableBase(NUM_PARAMETERS_IS_HOST)
, m_function(function)
@@ -118,13 +125,20 @@ namespace JSC {
m_jitCodeForCallWithArityCheck = callThunk.addressForCall();
m_jitCodeForConstructWithArityCheck = constructThunk.addressForCall();
}
+#else
+ NativeExecutable(NativeFunction function, NativeFunction constructor)
+ : ExecutableBase(NUM_PARAMETERS_IS_HOST)
+ , m_function(function)
+ , m_constructor(constructor)
+ {
+ }
+#endif
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
class VPtrHackExecutable : public ExecutableBase {
public:
@@ -398,13 +412,11 @@ namespace JSC {
return m_executable->isHostFunction();
}
-#if ENABLE(JIT)
inline NativeFunction JSFunction::nativeFunction()
{
ASSERT(isHostFunction());
return static_cast<NativeExecutable*>(m_executable.get())->function();
}
-#endif
}
#endif