Commit 6cd705df authored by fpizlo@apple.com's avatar fpizlo@apple.com

FTL should have an inefficient but correct implementation of GetById

https://bugs.webkit.org/show_bug.cgi?id=122740

Reviewed by Mark Hahnenberg.
        
It took some effort to realize that the node->prediction() check in the DFG backends
are completely unnecessary since the ByteCodeParser will always insert a ForceOSRExit
if !prediction.
        
But other than that this was an easy patch.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetById):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 42e10638
2013-10-13 Filip Pizlo <fpizlo@apple.com>
FTL should have an inefficient but correct implementation of GetById
https://bugs.webkit.org/show_bug.cgi?id=122740
Reviewed by Mark Hahnenberg.
It took some effort to realize that the node->prediction() check in the DFG backends
are completely unnecessary since the ByteCodeParser will always insert a ForceOSRExit
if !prediction.
But other than that this was an easy patch.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetById):
2013-10-13 Mark Lam <mark.lam@apple.com>
Transition misc cti_op_* JITStubs to JIT operations.
......
......@@ -1768,11 +1768,7 @@ void ByteCodeParser::handleGetById(
ASSERT(getByIdStatus.structureSet().size());
// The implementation of GetByOffset does not know to terminate speculative
// execution if it doesn't have a prediction, so we do it manually.
if (prediction == SpecNone)
addToGraph(ForceOSRExit);
else if (m_graph.compilation())
if (m_graph.compilation())
m_graph.compilation()->noticeInlinedGetById();
Node* originalBaseForBaselineJIT = base;
......
......@@ -3778,10 +3778,7 @@ void SpeculativeJIT::compile(Node* node)
}
case GetById: {
if (!node->prediction()) {
terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), 0);
break;
}
ASSERT(node->prediction());
switch (node->child1().useKind()) {
case CellUse: {
......
......@@ -4068,10 +4068,7 @@ void SpeculativeJIT::compile(Node* node)
break;
}
case GetById: {
if (!node->prediction()) {
terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), 0);
break;
}
ASSERT(node->prediction());
switch (node->child1().useKind()) {
case CellUse: {
......
......@@ -94,6 +94,7 @@ inline CapabilityLevel canCompile(Node* node)
case GetClosureRegisters:
case GetClosureVar:
case PutClosureVar:
case GetById:
// These are OK.
break;
case GetIndexedPropertyStorage:
......
......@@ -51,6 +51,7 @@ namespace JSC { namespace FTL {
#define FOR_EACH_FUNCTION_TYPE(macro) \
macro(I_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \
macro(J_JITOperation_E, functionType(int64, intPtr)) \
macro(J_JITOperation_EJI, functionType(int64, intPtr, int64, intPtr)) \
macro(P_JITOperation_EC, functionType(intPtr, intPtr, intPtr)) \
macro(V_JITOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \
macro(V_JITOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \
......
......@@ -348,6 +348,9 @@ private:
case PhantomPutStructure:
compilePhantomPutStructure();
break;
case GetById:
compileGetById();
break;
case GetButterfly:
compileGetButterfly();
break;
......@@ -1209,6 +1212,26 @@ private:
m_ftlState.jitCode->common.notifyCompilingStructureTransition(m_graph.m_plan, codeBlock(), m_node);
}
void compileGetById()
{
LValue base = 0;
switch (m_node->child1().useKind()) {
case CellUse:
base = lowCell(m_node->child1());
break;
case UntypedUse:
base = lowJSValue(m_node->child1());
break;
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
StringImpl* uid = m_graph.identifiers()[m_node->identifierNumber()];
setJSValue(vmCall(m_out.operation(operationGetById), m_callFrame, base, m_out.constIntPtr(uid)));
}
void compileGetButterfly()
{
setStorage(m_out.loadPtr(lowCell(m_node->child1()), m_heaps.JSObject_butterfly));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment