Commit e9b0dd2e authored by fpizlo@apple.com's avatar fpizlo@apple.com

FTL should support typed array PutByVal

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

Reviewed by Oliver Hunt.

Due to increased FTL coverage, this revealed a bug in LICM where we were trying to
have AI execute the tail of a block that !cfaDidFinish. We don't need to execute AI
for such blocks since LICM will bail for them anyway, and AI asserts that cfaDidFinish
is true.

* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* ftl/FTLAbbreviations.h:
(JSC::FTL::buildFPToUI):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compilePutByVal):
(JSC::FTL::LowerDFGToLLVM::doubleToInt32):
(JSC::FTL::LowerDFGToLLVM::doubleToUInt32):
* ftl/FTLOutput.h:
(JSC::FTL::Output::fpToUInt):
(JSC::FTL::Output::fpToUInt32):
(JSC::FTL::Output::store8):
(JSC::FTL::Output::store16):
(JSC::FTL::Output::storeFloat):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ed0e80fd
2013-09-07 Filip Pizlo <fpizlo@apple.com>
FTL should support typed array PutByVal
https://bugs.webkit.org/show_bug.cgi?id=120972
Reviewed by Oliver Hunt.
Due to increased FTL coverage, this revealed a bug in LICM where we were trying to
have AI execute the tail of a block that !cfaDidFinish. We don't need to execute AI
for such blocks since LICM will bail for them anyway, and AI asserts that cfaDidFinish
is true.
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* ftl/FTLAbbreviations.h:
(JSC::FTL::buildFPToUI):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compilePutByVal):
(JSC::FTL::LowerDFGToLLVM::doubleToInt32):
(JSC::FTL::LowerDFGToLLVM::doubleToUInt32):
* ftl/FTLOutput.h:
(JSC::FTL::Output::fpToUInt):
(JSC::FTL::Output::fpToUInt32):
(JSC::FTL::Output::store8):
(JSC::FTL::Output::store16):
(JSC::FTL::Output::storeFloat):
2013-09-07 Filip Pizlo <fpizlo@apple.com>
FTL should support basic closure operations
......
......@@ -244,6 +244,8 @@ private:
if (!subLoop)
continue;
BasicBlock* subPreHeader = m_data[subLoop->index()].preHeader;
if (!subPreHeader->cfaDidFinish)
continue;
m_state.initializeTo(subPreHeader);
m_interpreter.execute(node);
}
......
......@@ -205,6 +205,7 @@ static inline LValue buildStore(LBuilder builder, LValue value, LValue pointer)
static inline LValue buildSExt(LBuilder builder, LValue value, LType type) { return LLVMBuildSExt(builder, value, type, ""); }
static inline LValue buildZExt(LBuilder builder, LValue value, LType type) { return LLVMBuildZExt(builder, value, type, ""); }
static inline LValue buildFPToSI(LBuilder builder, LValue value, LType type) { return LLVMBuildFPToSI(builder, value, type, ""); }
static inline LValue buildFPToUI(LBuilder builder, LValue value, LType type) { return LLVMBuildFPToUI(builder, value, type, ""); }
static inline LValue buildSIToFP(LBuilder builder, LValue value, LType type) { return LLVMBuildSIToFP(builder, value, type, ""); }
static inline LValue buildUIToFP(LBuilder builder, LValue value, LType type) { return LLVMBuildUIToFP(builder, value, type, ""); }
static inline LValue buildIntCast(LBuilder builder, LValue value, LType type) { return LLVMBuildIntCast(builder, value, type, ""); }
......
......@@ -155,6 +155,8 @@ inline CapabilityLevel canCompile(Node* node)
case Array::Contiguous:
break;
default:
if (isTypedView(node->arrayMode().typedArrayType()))
return CanCompileAndOSREnter;
return CannotCompile;
}
break;
......
......@@ -49,7 +49,8 @@ namespace JSC { namespace FTL {
macro(J_DFGOperation_E, functionType(int64, intPtr)) \
macro(P_DFGOperation_EC, functionType(intPtr, intPtr, intPtr)) \
macro(V_DFGOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \
macro(V_DFGOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64))
macro(V_DFGOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \
macro(Z_DFGOperation_D, functionType(int32, doubleType))
class IntrinsicRepository : public CommonValues {
public:
......
......@@ -174,7 +174,9 @@ public:
LValue signExt(LValue value, LType type) { return buildSExt(m_builder, value, type); }
LValue zeroExt(LValue value, LType type) { return buildZExt(m_builder, value, type); }
LValue fpToInt(LValue value, LType type) { return buildFPToSI(m_builder, value, type); }
LValue fpToUInt(LValue value, LType type) { return buildFPToUI(m_builder, value, type); }
LValue fpToInt32(LValue value) { return fpToInt(value, int32); }
LValue fpToUInt32(LValue value) { return fpToUInt(value, int32); }
LValue intToFP(LValue value, LType type) { return buildSIToFP(m_builder, value, type); }
LValue intToDouble(LValue value) { return intToFP(value, doubleType); }
LValue unsignedToFP(LValue value, LType type) { return buildUIToFP(m_builder, value, type); }
......@@ -207,9 +209,12 @@ public:
LValue loadPtr(TypedPointer pointer) { return load(pointer, refPtr); }
LValue loadFloat(TypedPointer pointer) { return load(pointer, refFloat); }
LValue loadDouble(TypedPointer pointer) { return load(pointer, refDouble); }
void store8(LValue value, TypedPointer pointer) { store(value, pointer, ref8); }
void store16(LValue value, TypedPointer pointer) { store(value, pointer, ref16); }
void store32(LValue value, TypedPointer pointer) { store(value, pointer, ref32); }
void store64(LValue value, TypedPointer pointer) { store(value, pointer, ref64); }
void storePtr(LValue value, TypedPointer pointer) { store(value, pointer, refPtr); }
void storeFloat(LValue value, TypedPointer pointer) { store(value, pointer, refFloat); }
void storeDouble(LValue value, TypedPointer pointer) { store(value, pointer, refDouble); }
LValue addPtr(LValue value, ptrdiff_t immediate = 0)
......
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