From 81bc750723a18f21cd17d1b173cd2a4dda9cea6e Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 24 May 2011 11:24:40 +0100 Subject: Merge WebKit at r80534: Intial merge by Git Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61 --- Source/JavaScriptCore/runtime/Executable.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Source/JavaScriptCore/runtime/Executable.h') 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 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 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(m_executable.get())->function(); } -#endif } #endif -- cgit v1.1