Diff
Modified: branches/jsCStack/Source/_javascript_Core/CMakeLists.txt (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/CMakeLists.txt 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/CMakeLists.txt 2014-01-07 03:42:30 UTC (rev 161393)
@@ -166,6 +166,7 @@
dfg/DFGSpeculativeJIT32_64.cpp
dfg/DFGSpeculativeJIT64.cpp
dfg/DFGStackLayoutPhase.cpp
+ dfg/DFGStrengthReductionPhase.cpp
dfg/DFGThunks.cpp
dfg/DFGTierUpCheckInjectionPhase.cpp
dfg/DFGTypeCheckHoistingPhase.cpp
Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/ChangeLog 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog 2014-01-07 03:42:30 UTC (rev 161393)
@@ -1,5 +1,9 @@
2014-01-06 Filip Pizlo <[email protected]>
+ Merge trunk r160292.
+
+2014-01-06 Filip Pizlo <[email protected]>
+
Merge trunk r160238, r160242, r160246, r160252, r160257.
2014-01-06 Michael Saboff <[email protected]>
Modified: branches/jsCStack/Source/_javascript_Core/GNUmakefile.list.am (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/GNUmakefile.list.am 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/GNUmakefile.list.am 2014-01-07 03:42:30 UTC (rev 161393)
@@ -380,6 +380,8 @@
Source/_javascript_Core/dfg/DFGSSAConversionPhase.h \
Source/_javascript_Core/dfg/DFGStackLayoutPhase.cpp \
Source/_javascript_Core/dfg/DFGStackLayoutPhase.h \
+ Source/_javascript_Core/dfg/DFGStrengthReductionPhase.cpp \
+ Source/_javascript_Core/dfg/DFGStrengthReductionPhase.h \
Source/_javascript_Core/dfg/DFGStructureAbstractValue.h \
Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp \
Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.h \
Modified: branches/jsCStack/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2014-01-07 03:42:30 UTC (rev 161393)
@@ -412,6 +412,7 @@
<ClCompile Include="..\dfg\DFGSpeculativeJIT64.cpp" />
<ClCompile Include="..\dfg\DFGSSAConversionPhase.cpp" />
<ClCompile Include="..\dfg\DFGStackLayoutPhase.cpp" />
+ <ClCompile Include="..\dfg\DFGStrengthReductionPhase.cpp" />
<ClCompile Include="..\dfg\DFGThunks.cpp" />
<ClCompile Include="..\dfg\DFGTierUpCheckInjectionPhase.cpp" />
<ClCompile Include="..\dfg\DFGToFTLDeferredCompilationCallback.cpp" />
@@ -919,6 +920,7 @@
<ClInclude Include="..\dfg\DFGSpeculativeJIT.h" />
<ClInclude Include="..\dfg\DFGSSAConversionPhase.h" />
<ClInclude Include="..\dfg\DFGStackLayoutPhase.h" />
+ <ClInclude Include="..\dfg\DFGStrengthReductionPhase.h" />
<ClInclude Include="..\dfg\DFGStructureAbstractValue.h" />
<ClInclude Include="..\dfg\DFGThunks.h" />
<ClInclude Include="..\dfg\DFGTierUpCheckInjectionPhase.h" />
Modified: branches/jsCStack/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2014-01-07 03:42:30 UTC (rev 161393)
@@ -391,6 +391,8 @@
0FC09792146A6F7300CF2442 /* DFGOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */; };
0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0979F146B28C700CF2442 /* DFGThunks.cpp */; };
0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097A0146B28C700CF2442 /* DFGThunks.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FC20CB51852E2C600C9E954 /* DFGStrengthReductionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC20CB31852E2C600C9E954 /* DFGStrengthReductionPhase.cpp */; };
+ 0FC20CB61852E2C600C9E954 /* DFGStrengthReductionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC20CB41852E2C600C9E954 /* DFGStrengthReductionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FC314121814559100033232 /* RegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC314101814559100033232 /* RegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FC314131814559100033232 /* TempRegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC314111814559100033232 /* TempRegisterSet.cpp */; };
0FC3141518146D7000033232 /* RegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC3141418146D7000033232 /* RegisterSet.cpp */; };
@@ -1725,6 +1727,8 @@
0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExitCompiler.cpp; path = dfg/DFGOSRExitCompiler.cpp; sourceTree = "<group>"; };
0FC0979F146B28C700CF2442 /* DFGThunks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGThunks.cpp; path = dfg/DFGThunks.cpp; sourceTree = "<group>"; };
0FC097A0146B28C700CF2442 /* DFGThunks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGThunks.h; path = dfg/DFGThunks.h; sourceTree = "<group>"; };
+ 0FC20CB31852E2C600C9E954 /* DFGStrengthReductionPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStrengthReductionPhase.cpp; path = dfg/DFGStrengthReductionPhase.cpp; sourceTree = "<group>"; };
+ 0FC20CB41852E2C600C9E954 /* DFGStrengthReductionPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStrengthReductionPhase.h; path = dfg/DFGStrengthReductionPhase.h; sourceTree = "<group>"; };
0FC314101814559100033232 /* RegisterSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterSet.h; sourceTree = "<group>"; };
0FC314111814559100033232 /* TempRegisterSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TempRegisterSet.cpp; sourceTree = "<group>"; };
0FC3141418146D7000033232 /* RegisterSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterSet.cpp; sourceTree = "<group>"; };
@@ -3999,6 +4003,8 @@
A7D89CF117A0B8CC00773AD8 /* DFGSSAConversionPhase.h */,
0F9FB4F217FCB91700CB67F8 /* DFGStackLayoutPhase.cpp */,
0F9FB4F317FCB91700CB67F8 /* DFGStackLayoutPhase.h */,
+ 0FC20CB31852E2C600C9E954 /* DFGStrengthReductionPhase.cpp */,
+ 0FC20CB41852E2C600C9E954 /* DFGStrengthReductionPhase.h */,
0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */,
0FC0979F146B28C700CF2442 /* DFGThunks.cpp */,
0FC097A0146B28C700CF2442 /* DFGThunks.h */,
@@ -4625,6 +4631,7 @@
0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */,
0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */,
+ 0FC20CB61852E2C600C9E954 /* DFGStrengthReductionPhase.h in Headers */,
0FB14E1F18124ACE009B6B4D /* JITInlineCacheGenerator.h in Headers */,
86CC85A10EE79A4700288682 /* JITInlines.h in Headers */,
0F6B1CBE1861246A00845D97 /* RegisterPreservationWrapperGenerator.h in Headers */,
@@ -5525,6 +5532,7 @@
0F235BEB17178E7300690C7F /* DFGOSRExitBase.cpp in Sources */,
0FC09792146A6F7300CF2442 /* DFGOSRExitCompiler.cpp in Sources */,
0FC09776146943B000CF2442 /* DFGOSRExitCompiler32_64.cpp in Sources */,
+ 0FC20CB51852E2C600C9E954 /* DFGStrengthReductionPhase.cpp in Sources */,
0FC0977214693AF900CF2442 /* DFGOSRExitCompiler64.cpp in Sources */,
0F7025A91714B0FA00382C0E /* DFGOSRExitCompilerCommon.cpp in Sources */,
0FEFC9AA1681A3B300567F53 /* DFGOSRExitJumpPlaceholder.cpp in Sources */,
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -1148,6 +1148,7 @@
break;
case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
break;
case CreateArguments:
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGClobberize.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGClobberize.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGClobberize.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -144,7 +144,9 @@
return;
case VariableWatchpoint:
+ case TypedArrayWatchpoint:
read(Watchpoint_fire);
+ write(SideState);
return;
case NotifyWrite:
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -95,17 +95,6 @@
}
case BitOr: {
- // Optimize X|0 -> X.
- if (node->child2()->isConstant()) {
- JSValue C2 = m_graph.valueOfJSConstant(node->child2().node());
- if (C2.isInt32() && !C2.asInt32()) {
- m_insertionSet.insertNode(m_indexInBlock, SpecNone, Phantom, node->codeOrigin,
- Edge(node->child2().node(), KnownInt32Use));
- node->children.removeEdge(1);
- node->convertToIdentity();
- break;
- }
- }
fixIntEdge(node->child1());
fixIntEdge(node->child2());
break;
@@ -951,6 +940,7 @@
case ExtractOSREntryLocal:
case LoopHint:
case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
break;
#else
default:
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -749,10 +749,8 @@
return activation->registers();
}
-JSArrayBufferView* Graph::tryGetFoldableView(Node* node, ArrayMode arrayMode)
+JSArrayBufferView* Graph::tryGetFoldableView(Node* node)
{
- if (arrayMode.typedArrayType() == NotTypedArray)
- return 0;
if (!node->hasConstant())
return 0;
JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(valueOfJSConstant(node));
@@ -763,6 +761,18 @@
return view;
}
+JSArrayBufferView* Graph::tryGetFoldableView(Node* node, ArrayMode arrayMode)
+{
+ if (arrayMode.typedArrayType() == NotTypedArray)
+ return 0;
+ return tryGetFoldableView(node);
+}
+
+JSArrayBufferView* Graph::tryGetFoldableViewForChild1(Node* node)
+{
+ return tryGetFoldableView(child(node, 0).node(), node->arrayMode());
+}
+
} } // namespace JSC::DFG
#endif
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGGraph.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -807,7 +807,9 @@
JSActivation* tryGetActivation(Node*);
WriteBarrierBase<Unknown>* tryGetRegisters(Node*);
+ JSArrayBufferView* tryGetFoldableView(Node*);
JSArrayBufferView* tryGetFoldableView(Node*, ArrayMode);
+ JSArrayBufferView* tryGetFoldableViewForChild1(Node*);
VM& m_vm;
Plan& m_plan;
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGNode.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGNode.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGNode.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -972,6 +972,16 @@
{
return reinterpret_cast<VariableWatchpointSet*>(m_opInfo);
}
+
+ bool hasTypedArray()
+ {
+ return op() == TypedArrayWatchpoint;
+ }
+
+ JSArrayBufferView* typedArray()
+ {
+ return reinterpret_cast<JSArrayBufferView*>(m_opInfo);
+ }
bool hasStructureTransitionData()
{
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGNodeType.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGNodeType.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGNodeType.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -171,6 +171,7 @@
macro(Arrayify, NodeMustGenerate) \
macro(ArrayifyToStructure, NodeMustGenerate) \
macro(GetIndexedPropertyStorage, NodeResultStorage) \
+ macro(TypedArrayWatchpoint, NodeMustGenerate) \
macro(GetByOffset, NodeResultJS) \
macro(PutByOffset, NodeMustGenerate) \
macro(GetArrayLength, NodeResultInt32) \
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGPlan.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGPlan.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGPlan.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -53,6 +53,7 @@
#include "DFGResurrectionForValidationPhase.h"
#include "DFGSSAConversionPhase.h"
#include "DFGStackLayoutPhase.h"
+#include "DFGStrengthReductionPhase.h"
#include "DFGTierUpCheckInjectionPhase.h"
#include "DFGTypeCheckHoistingPhase.h"
#include "DFGUnificationPhase.h"
@@ -203,6 +204,7 @@
if (validationEnabled())
validate(dfg);
+ changed |= performStrengthReduction(dfg);
performCFA(dfg);
changed |= performConstantFolding(dfg);
changed |= performArgumentsSimplification(dfg);
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -577,6 +577,7 @@
case LoopHint:
case NotifyWrite:
case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
break;
// This gets ignored because it already has a prediction.
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGSafeToExecute.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGSafeToExecute.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGSafeToExecute.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -244,6 +244,7 @@
case InvalidationPoint:
case NotifyWrite:
case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
return true;
case GetByVal:
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -2331,7 +2331,7 @@
{
if (node->op() == PutByValAlias)
return JITCompiler::Jump();
- if (JSArrayBufferView* view = m_jit.graph().tryGetFoldableView(m_jit.graph().child(node, 0).node(), node->arrayMode())) {
+ if (JSArrayBufferView* view = m_jit.graph().tryGetFoldableViewForChild1(node)) {
uint32_t length = view->length();
Node* indexNode = m_jit.graph().child(node, 1).node();
if (m_jit.graph().isInt32Constant(indexNode) && static_cast<uint32_t>(m_jit.graph().valueOfInt32Constant(indexNode)) < length)
@@ -4046,8 +4046,7 @@
bool SpeculativeJIT::compileConstantIndexedPropertyStorage(Node* node)
{
- JSArrayBufferView* view = m_jit.graph().tryGetFoldableView(
- node->child1().node(), node->arrayMode());
+ JSArrayBufferView* view = m_jit.graph().tryGetFoldableViewForChild1(node);
if (!view)
return false;
if (view->mode() == FastTypedArray)
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -3591,7 +3591,8 @@
break;
}
- case AllocationProfileWatchpoint: {
+ case AllocationProfileWatchpoint:
+ case TypedArrayWatchpoint: {
noResult(node);
break;
}
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -3886,7 +3886,8 @@
break;
}
- case AllocationProfileWatchpoint: {
+ case AllocationProfileWatchpoint:
+ case TypedArrayWatchpoint: {
noResult(node);
break;
}
Modified: branches/jsCStack/Source/_javascript_Core/dfg/DFGWatchpointCollectionPhase.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/dfg/DFGWatchpointCollectionPhase.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/dfg/DFGWatchpointCollectionPhase.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -95,20 +95,15 @@
if (m_node->arrayMode().type() == Array::String)
handleStringGetByVal();
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_node->child1().node(), m_node->arrayMode()))
+ if (JSArrayBufferView* view = m_graph.tryGetFoldableViewForChild1(m_node))
addLazily(view);
break;
case PutByVal:
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_graph.varArgChild(m_node, 0).node(), m_node->arrayMode()))
+ if (JSArrayBufferView* view = m_graph.tryGetFoldableViewForChild1(m_node))
addLazily(view);
break;
- case GetArrayLength:
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_node->child1().node(), m_node->arrayMode()))
- addLazily(view);
- break;
-
case StringCharAt:
handleStringGetByVal();
break;
@@ -144,7 +139,7 @@
break;
case GetIndexedPropertyStorage:
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_node->child1().node(), m_node->arrayMode())) {
+ if (JSArrayBufferView* view = m_graph.tryGetFoldableViewForChild1(m_node)) {
// FIXME: It would be awesome to be able to fold the property storage for
// these GC-allocated typed arrays. For now it doesn't matter because the
// most common use-cases for constant typed arrays involve large arrays with
@@ -155,6 +150,10 @@
}
break;
+ case TypedArrayWatchpoint:
+ addLazily(m_node->typedArray());
+ break;
+
default:
break;
}
Modified: branches/jsCStack/Source/_javascript_Core/ftl/FTLCapabilities.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/ftl/FTLCapabilities.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/ftl/FTLCapabilities.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -101,6 +101,7 @@
case StringCharCodeAt:
case AllocatePropertyStorage:
case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
case VariableWatchpoint:
case NotifyWrite:
case Call:
Modified: branches/jsCStack/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -291,11 +291,6 @@
case Phantom:
compilePhantom();
break;
- case Flush:
- case PhantomLocal:
- case SetArgument:
- case LoopHint:
- break;
case ArithAdd:
case ValueAdd:
compileAddSub();
@@ -423,10 +418,6 @@
case NotifyWrite:
compileNotifyWrite();
break;
- case VariableWatchpoint:
- break;
- case FunctionReentryWatchpoint:
- break;
case GetMyScope:
compileGetMyScope();
break;
@@ -497,6 +488,14 @@
case Int52ToValue:
compileInt52ToValue();
break;
+ case Flush:
+ case PhantomLocal:
+ case SetArgument:
+ case LoopHint:
+ case VariableWatchpoint:
+ case FunctionReentryWatchpoint:
+ case TypedArrayWatchpoint:
+ break;
default:
RELEASE_ASSERT_NOT_REACHED();
break;
@@ -1452,7 +1451,7 @@
return;
}
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_node->child1().node(), m_node->arrayMode())) {
+ if (JSArrayBufferView* view = m_graph.tryGetFoldableView(m_node)) {
if (view->mode() != FastTypedArray) {
setStorage(m_out.constIntPtr(view->vector()));
return;
@@ -1825,7 +1824,7 @@
OutOfBounds, noValue(), 0,
m_out.aboveOrEqual(
index,
- typedArrayLength(child1.node(), m_node->arrayMode(), base)));
+ typedArrayLength(child1, m_node->arrayMode(), base)));
}
TypedPointer pointer = TypedPointer(
@@ -2973,16 +2972,16 @@
m_out.phi(m_out.intPtr, fastButterfly, slowButterfly));
}
- LValue typedArrayLength(Node* baseNode, ArrayMode arrayMode, LValue base)
+ LValue typedArrayLength(Edge baseEdge, ArrayMode arrayMode, LValue base)
{
- if (JSArrayBufferView* view = m_graph.tryGetFoldableView(baseNode, arrayMode))
+ if (JSArrayBufferView* view = m_graph.tryGetFoldableView(baseEdge.node(), arrayMode))
return m_out.constInt32(view->length());
return m_out.load32(base, m_heaps.JSArrayBufferView_length);
}
LValue typedArrayLength(Edge baseEdge, ArrayMode arrayMode)
{
- return typedArrayLength(baseEdge.node(), arrayMode, lowCell(baseEdge));
+ return typedArrayLength(baseEdge, arrayMode, lowCell(baseEdge));
}
LValue boolify(Edge edge)
Modified: branches/jsCStack/Source/_javascript_Core/jsc.cpp (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/jsc.cpp 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/jsc.cpp 2014-01-07 03:42:30 UTC (rev 161393)
@@ -33,6 +33,7 @@
#include "InitializeThreading.h"
#include "Interpreter.h"
#include "JSArray.h"
+#include "JSArrayBuffer.h"
#include "JSFunction.h"
#include "JSLock.h"
#include "JSProxy.h"
@@ -114,6 +115,7 @@
static EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionNeverInlineFunction(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionNumberOfDFGCompiles(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionTransferArrayBuffer(ExecState*);
static NO_RETURN_WITH_VALUE EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*);
#if ENABLE(SAMPLING_FLAGS)
@@ -235,6 +237,7 @@
addFunction(vm, "neverInlineFunction", functionNeverInlineFunction, 1);
addFunction(vm, "noInline", functionNeverInlineFunction, 1);
addFunction(vm, "numberOfDFGCompiles", functionNumberOfDFGCompiles, 1);
+ addFunction(vm, "transferArrayBuffer", functionTransferArrayBuffer, 1);
#if ENABLE(SAMPLING_FLAGS)
addFunction(vm, "setSamplingFlags", functionSetSamplingFlags, 1);
addFunction(vm, "clearSamplingFlags", functionClearSamplingFlags, 1);
@@ -505,6 +508,21 @@
return JSValue::encode(numberOfDFGCompiles(exec));
}
+EncodedJSValue JSC_HOST_CALL functionTransferArrayBuffer(ExecState* exec)
+{
+ if (exec->argumentCount() < 1)
+ return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Not enough arguments")));
+
+ JSArrayBuffer* buffer = jsDynamicCast<JSArrayBuffer*>(exec->argument(0));
+ if (!buffer)
+ return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Expected an array buffer")));
+
+ ArrayBufferContents dummyContents;
+ buffer->impl()->transfer(dummyContents);
+
+ return JSValue::encode(jsUndefined());
+}
+
EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*)
{
exit(EXIT_SUCCESS);
Modified: branches/jsCStack/Source/_javascript_Core/runtime/ArrayBufferView.h (161392 => 161393)
--- branches/jsCStack/Source/_javascript_Core/runtime/ArrayBufferView.h 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Source/_javascript_Core/runtime/ArrayBufferView.h 2014-01-07 03:42:30 UTC (rev 161393)
@@ -79,6 +79,8 @@
// Helper to verify that a given sub-range of an ArrayBuffer is
// within range.
+ // FIXME: This should distinguish between alignment errors and bounds errors.
+ // https://bugs.webkit.org/show_bug.cgi?id=125391
template <typename T>
static bool verifySubRange(
PassRefPtr<ArrayBuffer> buffer,
Modified: branches/jsCStack/Tools/ChangeLog (161392 => 161393)
--- branches/jsCStack/Tools/ChangeLog 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Tools/ChangeLog 2014-01-07 03:42:30 UTC (rev 161393)
@@ -1,3 +1,7 @@
+2014-01-06 Filip Pizlo <[email protected]>
+
+ Merge trunk r160292.
+
2013-12-06 Dan Bernstein <[email protected]>
[Mac] Transition MiniBrowser to the Cocoa API: load delegate
Modified: branches/jsCStack/Tools/Scripts/run-_javascript_core-tests (161392 => 161393)
--- branches/jsCStack/Tools/Scripts/run-_javascript_core-tests 2014-01-07 03:17:11 UTC (rev 161392)
+++ branches/jsCStack/Tools/Scripts/run-_javascript_core-tests 2014-01-07 03:42:30 UTC (rev 161393)
@@ -239,6 +239,7 @@
"PerformanceTests/SunSpider/tests/sunspider-1.0",
"PerformanceTests/SunSpider/tests/v8-v6",
"Source/_javascript_Core/tests/mozilla/mozilla-tests.yaml",
+ "Source/_javascript_Core/tests/stress",
"LayoutTests/js/regress/script-tests",
"PerformanceTests/SunSpider/profiler-test.yaml",
"LayoutTests/jsc-layout-tests.yaml"