summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/jit/JITStubs.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/jit/JITStubs.h')
-rw-r--r--JavaScriptCore/jit/JITStubs.h53
1 files changed, 40 insertions, 13 deletions
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index 17fd0d9..fe4bcfb 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -29,10 +29,10 @@
#ifndef JITStubs_h
#define JITStubs_h
-#include <wtf/Platform.h>
-
#include "MacroAssemblerCodeRef.h"
#include "Register.h"
+#include "ThunkGenerators.h"
+#include <wtf/HashMap.h>
#if ENABLE(JIT)
@@ -45,16 +45,16 @@ namespace JSC {
class FunctionExecutable;
class Identifier;
class JSGlobalData;
- class JSGlobalData;
+ class JSGlobalObject;
class JSObject;
class JSPropertyNameIterator;
class JSValue;
class JSValueEncodedAsPointer;
+ class NativeExecutable;
class Profiler;
class PropertySlot;
class PutPropertySlot;
class RegisterFile;
- class JSGlobalObject;
class RegExp;
union JITStubArg {
@@ -79,7 +79,7 @@ namespace JSC {
MacroAssemblerCodePtr ctiStringLengthTrampoline;
MacroAssemblerCodePtr ctiVirtualCallLink;
MacroAssemblerCodePtr ctiVirtualCall;
- MacroAssemblerCodePtr ctiNativeCallThunk;
+ RefPtr<NativeExecutable> ctiNativeCallThunk;
MacroAssemblerCodePtr ctiSoftModulo;
};
@@ -108,10 +108,10 @@ namespace JSC {
ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
};
#elif CPU(X86)
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
#pragma pack(push)
#pragma pack(4)
-#endif // COMPILER(MSVC)
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
struct JITStackFrame {
void* reserved; // Unused
JITStubArg args[6];
@@ -135,9 +135,9 @@ namespace JSC {
// When JIT code makes a call, it pushes its return address just below the rest of the stack.
ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
};
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
#pragma pack(pop)
-#endif // COMPILER(MSVC)
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
#elif CPU(ARM_THUMB2)
struct JITStackFrame {
void* reserved; // Unused
@@ -191,6 +191,30 @@ namespace JSC {
// When JIT code makes a call, it pushes its return address just below the rest of the stack.
ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
};
+#elif CPU(MIPS)
+ struct JITStackFrame {
+ void* reserved; // Unused
+ JITStubArg args[6];
+
+ void* preservedGP; // store GP when using PIC code
+ void* preservedS0;
+ void* preservedS1;
+ void* preservedS2;
+ void* preservedReturnAddress;
+
+ ReturnAddressPtr thunkReturnAddress;
+
+ // These arguments passed in a1..a3 (a0 contained the entry code pointed, which is not preserved)
+ RegisterFile* registerFile;
+ CallFrame* callFrame;
+ JSValue* exception;
+
+ // These arguments passed on the stack.
+ Profiler** enabledProfilerReference;
+ JSGlobalData* globalData;
+
+ ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
+ };
#else
#error "JITStackFrame not defined for this platform."
#endif
@@ -243,6 +267,7 @@ namespace JSC {
class JITThunks {
public:
JITThunks(JSGlobalData*);
+ ~JITThunks();
static void tryCacheGetByID(CallFrame*, CodeBlock*, ReturnAddressPtr returnAddress, JSValue baseValue, const Identifier& propertyName, const PropertySlot&, StructureStubInfo* stubInfo);
static void tryCachePutByID(CallFrame*, CodeBlock*, ReturnAddressPtr returnAddress, JSValue baseValue, const PutPropertySlot&, StructureStubInfo* stubInfo);
@@ -250,10 +275,13 @@ namespace JSC {
MacroAssemblerCodePtr ctiStringLengthTrampoline() { return m_trampolineStructure.ctiStringLengthTrampoline; }
MacroAssemblerCodePtr ctiVirtualCallLink() { return m_trampolineStructure.ctiVirtualCallLink; }
MacroAssemblerCodePtr ctiVirtualCall() { return m_trampolineStructure.ctiVirtualCall; }
- MacroAssemblerCodePtr ctiNativeCallThunk() { return m_trampolineStructure.ctiNativeCallThunk; }
+ NativeExecutable* ctiNativeCallThunk() { return m_trampolineStructure.ctiNativeCallThunk.get(); }
MacroAssemblerCodePtr ctiSoftModulo() { return m_trampolineStructure.ctiSoftModulo; }
+ NativeExecutable* specializedThunk(JSGlobalData* globalData, ThunkGenerator generator);
private:
+ typedef HashMap<ThunkGenerator, RefPtr<NativeExecutable> > ThunkMap;
+ ThunkMap m_thunkMap;
RefPtr<ExecutablePool> m_executablePool;
TrampolineStructure m_trampolineStructure;
@@ -276,6 +304,8 @@ extern "C" {
EncodedJSValue JIT_STUB cti_op_get_by_id_array_fail(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_get_by_id_generic(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_get_by_id_method_check(STUB_ARGS_DECLARATION);
+ EncodedJSValue JIT_STUB cti_op_get_by_id_getter_stub(STUB_ARGS_DECLARATION);
+ EncodedJSValue JIT_STUB cti_op_get_by_id_custom_stub(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_get_by_id_proto_fail(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_get_by_id_proto_list(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_get_by_id_proto_list_full(STUB_ARGS_DECLARATION);
@@ -326,7 +356,6 @@ extern "C" {
JSObject* JIT_STUB cti_op_new_func(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_new_func_exp(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_new_object(STUB_ARGS_DECLARATION);
- JSObject* JIT_STUB cti_op_new_regexp(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_push_activation(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_push_new_scope(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_push_scope(STUB_ARGS_DECLARATION);
@@ -334,9 +363,7 @@ extern "C" {
JSPropertyNameIterator* JIT_STUB cti_op_get_pnames(STUB_ARGS_DECLARATION);
VoidPtrPair JIT_STUB cti_op_call_arityCheck(STUB_ARGS_DECLARATION);
int JIT_STUB cti_op_eq(STUB_ARGS_DECLARATION);
-#if USE(JSVALUE32_64)
int JIT_STUB cti_op_eq_strings(STUB_ARGS_DECLARATION);
-#endif
int JIT_STUB cti_op_jless(STUB_ARGS_DECLARATION);
int JIT_STUB cti_op_jlesseq(STUB_ARGS_DECLARATION);
int JIT_STUB cti_op_jtrue(STUB_ARGS_DECLARATION);