summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index 27eb28fa7..b5058e35a 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -953,14 +953,8 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq(Node& node, bool invert)
void SpeculativeJIT::emitCall(Node& node)
{
- P_DFGOperation_E slowCallFunction;
-
- if (node.op() == Call)
- slowCallFunction = operationLinkCall;
- else {
+ if (node.op() != Call)
ASSERT(node.op() == Construct);
- slowCallFunction = operationLinkConstruct;
- }
// For constructors, the this argument is not passed but we have to make space
// for it.
@@ -998,14 +992,16 @@ void SpeculativeJIT::emitCall(Node& node)
JITCompiler::DataLabelPtr targetToCheck;
JITCompiler::Jump slowPath;
+ CallBeginToken token;
+ m_jit.beginCall(node.codeOrigin, token);
+
+ m_jit.addPtr(TrustedImm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister);
+
slowPath = m_jit.branchPtrWithPatch(MacroAssembler::NotEqual, calleeGPR, targetToCheck, MacroAssembler::TrustedImmPtr(JSValue::encode(JSValue())));
m_jit.loadPtr(MacroAssembler::Address(calleeGPR, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), resultGPR);
- m_jit.storePtr(resultGPR, callFrameSlot(RegisterFile::ScopeChain));
+ m_jit.storePtr(resultGPR, MacroAssembler::Address(GPRInfo::callFrameRegister, static_cast<ptrdiff_t>(sizeof(Register)) * RegisterFile::ScopeChain));
- m_jit.addPtr(TrustedImm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister);
-
CodeOrigin codeOrigin = at(m_compileIndex).codeOrigin;
- CallBeginToken token = m_jit.beginCall();
JITCompiler::Call fastCall = m_jit.nearCall();
m_jit.notifyCall(fastCall, codeOrigin, token);
@@ -1013,14 +1009,10 @@ void SpeculativeJIT::emitCall(Node& node)
slowPath.link(&m_jit);
- m_jit.addPtr(TrustedImm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
- token = m_jit.beginCall();
- JITCompiler::Call slowCall = m_jit.appendCall(slowCallFunction);
- m_jit.addFastExceptionCheck(slowCall, codeOrigin, token);
- m_jit.addPtr(TrustedImm32(m_jit.codeBlock()->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister);
- token = m_jit.beginCall();
- JITCompiler::Call theCall = m_jit.call(GPRInfo::returnValueGPR);
- m_jit.notifyCall(theCall, codeOrigin, token);
+ m_jit.move(calleeGPR, GPRInfo::nonArgGPR0);
+ m_jit.prepareForExceptionCheck();
+ JITCompiler::Call slowCall = m_jit.nearCall();
+ m_jit.notifyCall(slowCall, codeOrigin, token);
done.link(&m_jit);
@@ -2947,7 +2939,7 @@ void SpeculativeJIT::compile(Node& node)
}
case Branch:
- if (isStrictInt32(node.child1().index()) || at(node.child1()).shouldSpeculateInteger()) {
+ if (at(node.child1()).shouldSpeculateInteger()) {
SpeculateIntegerOperand op(this, node.child1());
BlockIndex taken = node.takenBlockIndex();