summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/llint/LLIntEntrypoint.cpp')
-rw-r--r--Source/JavaScriptCore/llint/LLIntEntrypoint.cpp55
1 files changed, 33 insertions, 22 deletions
diff --git a/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp b/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
index 993ec67b9..f7d761dc1 100644
--- a/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
+++ b/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp
@@ -25,14 +25,15 @@
#include "config.h"
#include "LLIntEntrypoint.h"
-
-#if ENABLE(LLINT)
-
#include "CodeBlock.h"
+#include "HeapInlines.h"
#include "JITCode.h"
+#include "JSCellInlines.h"
#include "JSObject.h"
#include "LLIntThunks.h"
#include "LowLevelInterpreter.h"
+#include "MaxFrameExtentForSlowPathCall.h"
+#include "StackAlignment.h"
#include "VM.h"
namespace JSC { namespace LLInt {
@@ -45,14 +46,12 @@ static void setFunctionEntrypoint(VM& vm, CodeBlock* codeBlock)
if (vm.canUseJIT()) {
if (kind == CodeForCall) {
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(vm.getCTIStub(functionForCallEntryThunkGenerator), JITCode::InterpreterThunk)),
- vm.getCTIStub(functionForCallArityCheckThunkGenerator).code());
+ adoptRef(*new DirectJITCode(vm.getCTIStub(functionForCallEntryThunkGenerator), vm.getCTIStub(functionForCallArityCheckThunkGenerator).code(), JITCode::InterpreterThunk)));
return;
}
ASSERT(kind == CodeForConstruct);
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(vm.getCTIStub(functionForConstructEntryThunkGenerator), JITCode::InterpreterThunk)),
- vm.getCTIStub(functionForConstructArityCheckThunkGenerator).code());
+ adoptRef(*new DirectJITCode(vm.getCTIStub(functionForConstructEntryThunkGenerator), vm.getCTIStub(functionForConstructArityCheckThunkGenerator).code(), JITCode::InterpreterThunk)));
return;
}
#endif // ENABLE(JIT)
@@ -60,14 +59,12 @@ static void setFunctionEntrypoint(VM& vm, CodeBlock* codeBlock)
UNUSED_PARAM(vm);
if (kind == CodeForCall) {
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_call_prologue), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check));
+ adoptRef(*new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_call_prologue), MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check), JITCode::InterpreterThunk)));
return;
}
ASSERT(kind == CodeForConstruct);
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_construct_prologue), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check));
+ adoptRef(*new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_construct_prologue), MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check), JITCode::InterpreterThunk)));
}
static void setEvalEntrypoint(VM& vm, CodeBlock* codeBlock)
@@ -75,16 +72,14 @@ static void setEvalEntrypoint(VM& vm, CodeBlock* codeBlock)
#if ENABLE(JIT)
if (vm.canUseJIT()) {
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(vm.getCTIStub(evalEntryThunkGenerator), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr());
+ adoptRef(*new DirectJITCode(vm.getCTIStub(evalEntryThunkGenerator), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
return;
}
#endif // ENABLE(JIT)
UNUSED_PARAM(vm);
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_eval_prologue), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr());
+ adoptRef(*new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_eval_prologue), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
}
static void setProgramEntrypoint(VM& vm, CodeBlock* codeBlock)
@@ -92,16 +87,29 @@ static void setProgramEntrypoint(VM& vm, CodeBlock* codeBlock)
#if ENABLE(JIT)
if (vm.canUseJIT()) {
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(vm.getCTIStub(programEntryThunkGenerator), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr());
+ adoptRef(*new DirectJITCode(vm.getCTIStub(programEntryThunkGenerator), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
return;
}
#endif // ENABLE(JIT)
UNUSED_PARAM(vm);
codeBlock->setJITCode(
- adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_program_prologue), JITCode::InterpreterThunk)),
- MacroAssemblerCodePtr());
+ adoptRef(*new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_program_prologue), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
+}
+
+static void setModuleProgramEntrypoint(VM& vm, CodeBlock* codeBlock)
+{
+#if ENABLE(JIT)
+ if (vm.canUseJIT()) {
+ codeBlock->setJITCode(
+ adoptRef(*new DirectJITCode(vm.getCTIStub(moduleProgramEntryThunkGenerator), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
+ return;
+ }
+#endif // ENABLE(JIT)
+
+ UNUSED_PARAM(vm);
+ codeBlock->setJITCode(
+ adoptRef(*new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_module_program_prologue), MacroAssemblerCodePtr(), JITCode::InterpreterThunk)));
}
void setEntrypoint(VM& vm, CodeBlock* codeBlock)
@@ -110,6 +118,9 @@ void setEntrypoint(VM& vm, CodeBlock* codeBlock)
case GlobalCode:
setProgramEntrypoint(vm, codeBlock);
return;
+ case ModuleCode:
+ setModuleProgramEntrypoint(vm, codeBlock);
+ return;
case EvalCode:
setEvalEntrypoint(vm, codeBlock);
return;
@@ -123,9 +134,9 @@ void setEntrypoint(VM& vm, CodeBlock* codeBlock)
unsigned frameRegisterCountFor(CodeBlock* codeBlock)
{
- return codeBlock->m_numCalleeRegisters;
+ ASSERT(static_cast<unsigned>(codeBlock->m_numCalleeLocals) == WTF::roundUpToMultipleOf(stackAlignmentRegisters(), static_cast<unsigned>(codeBlock->m_numCalleeLocals)));
+
+ return roundLocalRegisterCountForFramePointerOffset(codeBlock->m_numCalleeLocals + maxFrameExtentForSlowPathCallInRegisters);
}
} } // namespace JSC::LLInt
-
-#endif // ENABLE(LLINT)