Modified: trunk/Source/_javascript_Core/ChangeLog (158747 => 158748)
--- trunk/Source/_javascript_Core/ChangeLog 2013-11-06 16:36:46 UTC (rev 158747)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-11-06 16:38:45 UTC (rev 158748)
@@ -1,5 +1,18 @@
2013-11-05 Filip Pizlo <[email protected]>
+ FTL should support StringCharCodeAt
+ https://bugs.webkit.org/show_bug.cgi?id=123854
+
+ Reviewed by Sam Weinig.
+
+ * ftl/FTLCapabilities.cpp:
+ (JSC::FTL::canCompile):
+ * ftl/FTLLowerDFGToLLVM.cpp:
+ (JSC::FTL::LowerDFGToLLVM::compileNode):
+ (JSC::FTL::LowerDFGToLLVM::compileStringCharCodeAt):
+
+2013-11-05 Filip Pizlo <[email protected]>
+
FTL should support NewObject
https://bugs.webkit.org/show_bug.cgi?id=123849
Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (158747 => 158748)
--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp 2013-11-06 16:36:46 UTC (rev 158747)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp 2013-11-06 16:38:45 UTC (rev 158748)
@@ -98,6 +98,7 @@
case Int52ToValue:
case InvalidationPoint:
case StringCharAt:
+ case StringCharCodeAt:
// These are OK.
break;
case GetById:
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (158747 => 158748)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2013-11-06 16:36:46 UTC (rev 158747)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2013-11-06 16:38:45 UTC (rev 158748)
@@ -371,6 +371,9 @@
case StringCharAt:
compileStringCharAt();
break;
+ case StringCharCodeAt:
+ compileStringCharCodeAt();
+ break;
case GetByOffset:
compileGetByOffset();
break;
@@ -1847,6 +1850,53 @@
setJSValue(m_out.phi(m_out.int64, results));
}
+ void compileStringCharCodeAt()
+ {
+ LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 8-bit case"));
+ LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 16-bit case"));
+ LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt continuation"));
+
+ LValue base = lowCell(m_node->child1());
+ LValue index = lowInt32(m_node->child2());
+ LValue storage = lowStorage(m_node->child3());
+
+ speculate(
+ Uncountable, noValue(), 0,
+ m_out.aboveOrEqual(index, m_out.load32(base, m_heaps.JSString_length)));
+
+ LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value);
+
+ m_out.branch(
+ m_out.testIsZero32(
+ m_out.load32(stringImpl, m_heaps.StringImpl_hashAndFlags),
+ m_out.constInt32(StringImpl::flagIs8Bit())),
+ is16Bit, is8Bit);
+
+ LBasicBlock lastNext = m_out.appendTo(is8Bit, is16Bit);
+
+ ValueFromBlock char8Bit = m_out.anchor(m_out.zeroExt(
+ m_out.load8(m_out.baseIndex(
+ m_heaps.characters8,
+ storage, m_out.zeroExt(index, m_out.intPtr),
+ m_state.forNode(m_node->child2()).m_value)),
+ m_out.int32));
+ m_out.jump(continuation);
+
+ m_out.appendTo(is16Bit, continuation);
+
+ ValueFromBlock char16Bit = m_out.anchor(m_out.zeroExt(
+ m_out.load16(m_out.baseIndex(
+ m_heaps.characters16,
+ storage, m_out.zeroExt(index, m_out.intPtr),
+ m_state.forNode(m_node->child2()).m_value)),
+ m_out.int32));
+ m_out.jump(continuation);
+
+ m_out.appendTo(continuation, lastNext);
+
+ setInt32(m_out.phi(m_out.int32, char8Bit, char16Bit));
+ }
+
void compileGetByOffset()
{
StorageAccessData& data =
"">