Diff
Modified: branches/dfgFourthTier/LayoutTests/ChangeLog (152943 => 152944)
--- branches/dfgFourthTier/LayoutTests/ChangeLog 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/LayoutTests/ChangeLog 2013-07-20 17:58:57 UTC (rev 152944)
@@ -1,3 +1,29 @@
+2013-07-19 Filip Pizlo <[email protected]>
+
+ fourthTier: String GetByVal out-of-bounds handling is so wrong
+ https://bugs.webkit.org/show_bug.cgi?id=118935
+
+ Reviewed by Geoffrey Garen.
+
+ * fast/js/dfg-string-out-of-bounds-check-structure-expected.txt: Added.
+ * fast/js/dfg-string-out-of-bounds-check-structure.html: Added.
+ * fast/js/dfg-string-out-of-bounds-cse-expected.txt: Added.
+ * fast/js/dfg-string-out-of-bounds-cse.html: Added.
+ * fast/js/dfg-string-out-of-bounds-negative-check-structure-expected.txt: Added.
+ * fast/js/dfg-string-out-of-bounds-negative-check-structure.html: Added.
+ * fast/js/dfg-string-out-of-bounds-negative-proto-value-expected.txt: Added.
+ * fast/js/dfg-string-out-of-bounds-negative-proto-value.html: Added.
+ * fast/js/jsc-test-list:
+ * fast/js/script-tests/dfg-string-out-of-bounds-check-structure.js: Added.
+ (foo):
+ * fast/js/script-tests/dfg-string-out-of-bounds-cse.js: Added.
+ (foo):
+ * fast/js/script-tests/dfg-string-out-of-bounds-negative-check-structure.js: Added.
+ (foo):
+ (while):
+ * fast/js/script-tests/dfg-string-out-of-bounds-negative-proto-value.js: Added.
+ (foo):
+
2013-06-25 Filip Pizlo <[email protected]>
fourthTier: DFG should support switch_string
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure-expected.txt (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure-expected.txt (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure-expected.txt 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,9 @@
+Tests what happens when you do a out-of-bounds access on a string and use that to install a getter that clobbers a structure.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Passed some tests silently.
+
+TEST COMPLETE
+
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure.html (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure.html (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-check-structure.html 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse-expected.txt (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse-expected.txt (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse-expected.txt 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,9 @@
+Tests what happens when you present a CSE opportunity across an out-of-bounds string access.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Passed some tests silently.
+
+TEST COMPLETE
+
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse.html (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse.html (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-cse.html 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure-expected.txt (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure-expected.txt (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure-expected.txt 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,9 @@
+Tests what happens when you do a negative out-of-bounds access on a string and use that to install a getter that clobbers a structure.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Passed some tests silently.
+
+TEST COMPLETE
+
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure.html (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure.html (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-check-structure.html 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value-expected.txt (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value-expected.txt (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value-expected.txt 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,9 @@
+Tests what happens when you do a negative out-of-bounds access on a string while the prototype has a negative indexed property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Passed some tests silently.
+
+TEST COMPLETE
+
Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value.html (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value.html (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-string-out-of-bounds-negative-proto-value.html 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Modified: branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list (152943 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list 2013-07-20 17:58:57 UTC (rev 152944)
@@ -199,6 +199,10 @@
fast/js/dfg-redundant-load-of-captured-variable-proven-constant
fast/js/dfg-side-effect-assignment-osr-exit
fast/js/dfg-sqrt-backwards-propagation
+fast/js/dfg-string-out-of-bounds-check-structure
+fast/js/dfg-string-out-of-bounds-cse
+fast/js/dfg-string-out-of-bounds-negative-check-structure
+fast/js/dfg-string-out-of-bounds-negative-proto-value
fast/js/dfg-string-stricteq
fast/js/dfg-tear-off-arguments-not-activation
fast/js/dfg-to-string-bad-toString
Added: branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-check-structure.js (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-check-structure.js (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-check-structure.js 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,29 @@
+description(
+"Tests what happens when you do a out-of-bounds access on a string and use that to install a getter that clobbers a structure."
+);
+
+function foo(s, o) {
+ var x = o.f;
+ s[42];
+ var y = o.g;
+ return x + y;
+}
+
+noInline(foo);
+silentTestPass = true;
+
+var theObject = {};
+
+var didGetCalled = false;
+String.prototype.__defineGetter__("42", function() { didGetCalled = true; delete theObject.g; theObject.h = 42 });
+
+while (testRunner.numberOfDFGCompiles(foo) < 1) {
+ didGetCalled = false;
+ shouldBe("foo(\"hello\", {f:1, g:2})", "3");
+ shouldBe("didGetCalled", "true");
+}
+
+theObject = {f:1, g:2};
+didGetCalled = false;
+shouldBe("foo(\"hello\", theObject)", "0/0");
+shouldBe("didGetCalled", "true");
Added: branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-cse.js (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-cse.js (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-cse.js 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,23 @@
+description(
+"Tests what happens when you present a CSE opportunity across an out-of-bounds string access."
+);
+
+function foo(s, o) {
+ var x = o.f;
+ s[0];
+ var y = o.f;
+ return x + y;
+}
+
+noInline(foo);
+silentTestPass = true;
+
+var theObject = {};
+
+String.prototype.__defineGetter__("0", function() { theObject.f = 42; });
+
+while (!dfgCompiled({f:foo}))
+ shouldBe("foo(\"\", {f:1})", "2");
+
+theObject = {f:1};
+shouldBe("foo(\"\", theObject)", "43");
Added: branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-check-structure.js (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-check-structure.js (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-check-structure.js 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,23 @@
+description(
+"Tests what happens when you do a negative out-of-bounds access on a string and use that to install a getter that clobbers a structure."
+);
+
+function foo(s, o) {
+ var x = o.f;
+ s[-1];
+ var y = o.g;
+ return x + y;
+}
+
+noInline(foo);
+silentTestPass = true;
+
+var theObject = {};
+
+String.prototype.__defineGetter__("-1", function() { delete theObject.g; });
+
+while (testRunner.numberOfDFGCompiles(foo) < 1)
+ shouldBe("foo(\"hello\", {f:1, g:2})", "3");
+
+theObject = {f:1, g:2};
+shouldBe("foo(\"hello\", theObject)", "0/0");
Added: branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-proto-value.js (0 => 152944)
--- branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-proto-value.js (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-string-out-of-bounds-negative-proto-value.js 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,16 @@
+description(
+"Tests what happens when you do a negative out-of-bounds access on a string while the prototype has a negative indexed property."
+);
+
+function foo(s) {
+ return s[-1];
+}
+
+noInline(foo);
+silentTestPass = true;
+
+String.prototype[-1] = "hello";
+
+for (var i = 0; i < 2; i = dfgIncrement({f:foo, i:i + 1, n:1, compiles:2}))
+ shouldBe("foo(\"hello\")", "\"hello\"");
+
Modified: branches/dfgFourthTier/Source/_javascript_Core/API/JSCTestRunnerUtils.cpp (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/API/JSCTestRunnerUtils.cpp 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/API/JSCTestRunnerUtils.cpp 2013-07-20 17:58:57 UTC (rev 152944)
@@ -48,17 +48,23 @@
JSValueRef numberOfDFGCompiles(JSContextRef context, JSValueRef theFunctionValueRef)
{
+ bool pretendToHaveManyCompiles = false;
+#if ENABLE(DFG_JIT)
+ if (!Options::useJIT() || !Options::useDFGJIT())
+ pretendToHaveManyCompiles = true;
+#else
+ pretendToHaveManyCompiles = true;
+#endif
+
if (FunctionExecutable* executable = getExecutable(context, theFunctionValueRef)) {
CodeBlock* baselineCodeBlock = executable->baselineCodeBlockFor(CodeForCall);
if (!baselineCodeBlock)
return JSValueMakeNumber(context, 0);
-#if ENABLE(DFG_JIT)
+ if (pretendToHaveManyCompiles)
+ return JSValueMakeNumber(context, 1000000.0);
return JSValueMakeNumber(context, baselineCodeBlock->numberOfDFGCompiles());
-#else
- return JSValueMakeNumber(context, 1000000.0);
-#endif
}
return JSValueMakeUndefined(context);
Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-20 17:58:57 UTC (rev 152944)
@@ -1,5 +1,51 @@
2013-07-19 Filip Pizlo <[email protected]>
+ fourthTier: String GetByVal out-of-bounds handling is so wrong
+ https://bugs.webkit.org/show_bug.cgi?id=118935
+
+ Reviewed by Geoffrey Garen.
+
+ Bunch of String GetByVal out-of-bounds fixes:
+
+ - Even if the string proto chain is sane, we need to watch out for negative
+ indices. They may get values or call getters in the prototypes, since proto
+ sanity doesn't check for negative indexed properties, as they are not
+ technically indexed properties.
+
+ - GetByVal String out-of-bounds does in fact clobberWorld(). CSE should be
+ given this information.
+
+ - GetByVal String out-of-bounds does in fact clobberWorld(). CFA should be
+ given this information.
+
+ Also fixed some other things:
+
+ - If the DFG is disabled, the testRunner should pretend that we've done a
+ bunch of DFG compiles. That's necessary to prevent the tests from timing
+ out.
+
+ - Disassembler shouldn't try to dump source code since it's not safe in the
+ concurrent JIT.
+
+ * API/JSCTestRunnerUtils.cpp:
+ (JSC::numberOfDFGCompiles):
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * dfg/DFGAbstractInterpreterInlines.h:
+ (JSC::DFG::::executeEffects):
+ * dfg/DFGDisassembler.cpp:
+ (JSC::DFG::Disassembler::dumpHeader):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::byValIsPure):
+ * dfg/DFGSaneStringGetByValSlowPathGenerator.h: Added.
+ (DFG):
+ (SaneStringGetByValSlowPathGenerator):
+ (JSC::DFG::SaneStringGetByValSlowPathGenerator::SaneStringGetByValSlowPathGenerator):
+ (JSC::DFG::SaneStringGetByValSlowPathGenerator::generateInternal):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
+
+2013-07-19 Filip Pizlo <[email protected]>
+
fourthTier: Structure::isValidOffset() should be able to tell you if you're loading a valid JSValue, and not just not crashing
https://bugs.webkit.org/show_bug.cgi?id=118911
Modified: branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-07-20 17:58:57 UTC (rev 152944)
@@ -366,13 +366,14 @@
0FE5057B178F5B5300B35F8C /* DFGOSRAvailabilityAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5056E178F5B5300B35F8C /* DFGOSRAvailabilityAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5057C178F5B5300B35F8C /* DFGSSAConversionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5056F178F5B5300B35F8C /* DFGSSAConversionPhase.cpp */; };
0FE5057D178F5B5300B35F8C /* DFGSSAConversionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50570178F5B5300B35F8C /* DFGSSAConversionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FE5058217965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5058017965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp */; };
+ 0FE5058317965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5058117965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5058A1798ABF500B35F8C /* DFGAbstractInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE505861798ABF500B35F8C /* DFGAbstractInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5058B1798ABF500B35F8C /* DFGAbstractInterpreterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE505871798ABF500B35F8C /* DFGAbstractInterpreterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5058C1798ABF500B35F8C /* DFGInPlaceAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE505881798ABF500B35F8C /* DFGInPlaceAbstractState.cpp */; };
0FE5058D1798ABF500B35F8C /* DFGInPlaceAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE505891798ABF500B35F8C /* DFGInPlaceAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5058F1798AE7100B35F8C /* DFGMergeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0FE5058217965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5058017965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp */; };
- 0FE5058317965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5058117965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FE50591179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE8534B1723CDA500B618F5 /* DFGDesiredWatchpoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */; };
0FE8534C1723CDA500B618F5 /* DFGDesiredWatchpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FEA0A08170513DB00BB722C /* FTLAbbreviations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1417,13 +1418,14 @@
0FE5056E178F5B5300B35F8C /* DFGOSRAvailabilityAnalysisPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRAvailabilityAnalysisPhase.h; path = dfg/DFGOSRAvailabilityAnalysisPhase.h; sourceTree = "<group>"; };
0FE5056F178F5B5300B35F8C /* DFGSSAConversionPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGSSAConversionPhase.cpp; path = dfg/DFGSSAConversionPhase.cpp; sourceTree = "<group>"; };
0FE50570178F5B5300B35F8C /* DFGSSAConversionPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGSSAConversionPhase.h; path = dfg/DFGSSAConversionPhase.h; sourceTree = "<group>"; };
+ 0FE5058017965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGLoopPreHeaderCreationPhase.cpp; path = dfg/DFGLoopPreHeaderCreationPhase.cpp; sourceTree = "<group>"; };
+ 0FE5058117965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLoopPreHeaderCreationPhase.h; path = dfg/DFGLoopPreHeaderCreationPhase.h; sourceTree = "<group>"; };
0FE505861798ABF500B35F8C /* DFGAbstractInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractInterpreter.h; path = dfg/DFGAbstractInterpreter.h; sourceTree = "<group>"; };
0FE505871798ABF500B35F8C /* DFGAbstractInterpreterInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractInterpreterInlines.h; path = dfg/DFGAbstractInterpreterInlines.h; sourceTree = "<group>"; };
0FE505881798ABF500B35F8C /* DFGInPlaceAbstractState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGInPlaceAbstractState.cpp; path = dfg/DFGInPlaceAbstractState.cpp; sourceTree = "<group>"; };
0FE505891798ABF500B35F8C /* DFGInPlaceAbstractState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInPlaceAbstractState.h; path = dfg/DFGInPlaceAbstractState.h; sourceTree = "<group>"; };
0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGMergeMode.h; path = dfg/DFGMergeMode.h; sourceTree = "<group>"; };
- 0FE5058017965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGLoopPreHeaderCreationPhase.cpp; path = dfg/DFGLoopPreHeaderCreationPhase.cpp; sourceTree = "<group>"; };
- 0FE5058117965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLoopPreHeaderCreationPhase.h; path = dfg/DFGLoopPreHeaderCreationPhase.h; sourceTree = "<group>"; };
+ 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGSaneStringGetByValSlowPathGenerator.h; path = dfg/DFGSaneStringGetByValSlowPathGenerator.h; sourceTree = "<group>"; };
0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWatchpoints.cpp; path = dfg/DFGDesiredWatchpoints.cpp; sourceTree = "<group>"; };
0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWatchpoints.h; path = dfg/DFGDesiredWatchpoints.h; sourceTree = "<group>"; };
0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLAbbreviations.h; path = ftl/FTLAbbreviations.h; sourceTree = "<group>"; };
@@ -2985,7 +2987,6 @@
86EC9DB31328DF44002B2AD7 /* dfg */ = {
isa = PBXGroup;
children = (
- 0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */,
0FE505861798ABF500B35F8C /* DFGAbstractInterpreter.h */,
0FE505871798ABF500B35F8C /* DFGAbstractInterpreterInlines.h */,
0F55C19317276E4600CEABFD /* DFGAbstractValue.cpp */,
@@ -3083,6 +3084,7 @@
0FB4B51D16B62772003F696B /* DFGLongLivedState.h */,
0FE5058017965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.cpp */,
0FE5058117965C3D00B35F8C /* DFGLoopPreHeaderCreationPhase.h */,
+ 0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */,
0F2BDC3D1522801700CD8910 /* DFGMinifiedGraph.h */,
0FB4B51016B3A964003F696B /* DFGMinifiedID.h */,
0F2BDC4C1522818300CD8910 /* DFGMinifiedNode.cpp */,
@@ -3128,6 +3130,7 @@
0F766D4215B2A3BD008F363E /* DFGRegisterSet.h */,
86BB09BE138E381B0056702F /* DFGRepatch.cpp */,
86BB09BF138E381B0056702F /* DFGRepatch.h */,
+ 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */,
86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */,
0F766D4515B3701D008F363E /* DFGScratchRegisterAllocator.h */,
0F1E3A65153A21DF000F9456 /* DFGSilentRegisterSavePlan.h */,
@@ -3507,6 +3510,7 @@
0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */,
0F3B3A2C15475002003ED0FF /* DFGValidate.h in Headers */,
0F2BDC471522802500CD8910 /* DFGValueRecoveryOverride.h in Headers */,
+ 0FE50591179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */,
FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
0FE5055D1787B0CF00B35F8C /* DFGCriticalEdgeBreakingPhase.h in Headers */,
0F2BDC481522802900CD8910 /* DFGValueSource.h in Headers */,
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h 2013-07-20 17:58:57 UTC (rev 152944)
@@ -776,7 +776,9 @@
// GetByVal operation the fact that we're using a watchpoint, using
// something like Array::SaneChain (except not quite, because that
// implies an in-bounds access). None of this feels like it's worth it,
- // so we're going with TOP for now.
+ // so we're going with TOP for now. The same thing applies to
+ // clobbering the world.
+ clobberWorld(node->codeOrigin, indexInBlock);
forNode(node).makeTop();
} else
forNode(node).set(m_graph, m_graph.m_vm.stringStructure.get());
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGDisassembler.cpp (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGDisassembler.cpp 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGDisassembler.cpp 2013-07-20 17:58:57 UTC (rev 152944)
@@ -69,7 +69,6 @@
{
out.print("Generated DFG JIT code for ", CodeBlockWithJITType(m_graph.m_codeBlock, JITCode::DFGJIT), ", instruction count = ", m_graph.m_codeBlock->instructionCount(), ":\n");
out.print(" Optimized with execution counter = ", m_graph.m_profiledBlock->jitExecuteCounter(), "\n");
- out.print(" Source: ", m_graph.m_codeBlock->sourceCodeOnOneLine(), "\n");
out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize()), "):\n");
}
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGGraph.h 2013-07-20 17:58:57 UTC (rev 152944)
@@ -492,7 +492,7 @@
case Array::SlowPutArrayStorage:
return !node->arrayMode().mayStoreToHole();
case Array::String:
- return node->op() == GetByVal;
+ return node->op() == GetByVal && node->arrayMode().isInBounds();
#if USE(JSVALUE32_64)
case Array::Arguments:
if (node->op() == GetByVal)
Added: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSaneStringGetByValSlowPathGenerator.h (0 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSaneStringGetByValSlowPathGenerator.h (rev 0)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSaneStringGetByValSlowPathGenerator.h 2013-07-20 17:58:57 UTC (rev 152944)
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DFGSaneStringGetByValSlowPathGenerator_h
+#define DFGSaneStringGetByValSlowPathGenerator_h
+
+#include <wtf/Platform.h>
+
+#if ENABLE(DFG_JIT)
+
+#include "DFGCommon.h"
+#include "DFGOperations.h"
+#include "DFGSlowPathGenerator.h"
+#include "DFGSpeculativeJIT.h"
+#include <wtf/Vector.h>
+
+namespace JSC { namespace DFG {
+
+class SaneStringGetByValSlowPathGenerator : public JumpingSlowPathGenerator<MacroAssembler::Jump> {
+public:
+ SaneStringGetByValSlowPathGenerator(
+ const MacroAssembler::Jump& from, SpeculativeJIT* jit, JSValueRegs resultRegs,
+ GPRReg baseReg, GPRReg propertyReg)
+ : JumpingSlowPathGenerator<MacroAssembler::Jump>(from, jit)
+ , m_resultRegs(resultRegs)
+ , m_baseReg(baseReg)
+ , m_propertyReg(propertyReg)
+ {
+ jit->silentSpillAllRegistersImpl(false, m_plans, extractResult(resultRegs));
+ }
+
+protected:
+ void generateInternal(SpeculativeJIT* jit)
+ {
+ linkFrom(jit);
+
+ MacroAssembler::Jump isNeg = jit->m_jit.branch32(
+ MacroAssembler::LessThan, m_propertyReg, MacroAssembler::TrustedImm32(0));
+
+#if USE(JSVALUE64)
+ jit->m_jit.move(
+ MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), m_resultRegs.gpr());
+#else
+ jit->m_jit.move(
+ MacroAssembler::TrustedImm32(JSValue::UndefinedTag), m_resultRegs.tagGPR());
+ jit->m_jit.move(
+ MacroAssembler::TrustedImm32(0), m_resultRegs.payloadGPR());
+#endif
+ jumpTo(jit);
+
+ isNeg.link(&jit->m_jit);
+
+ for (unsigned i = 0; i < m_plans.size(); ++i)
+ jit->silentSpill(m_plans[i]);
+ jit->callOperation(operationGetByValStringInt, extractResult(m_resultRegs), m_baseReg, m_propertyReg);
+ GPRReg canTrample = SpeculativeJIT::pickCanTrample(extractResult(m_resultRegs));
+ for (unsigned i = m_plans.size(); i--;)
+ jit->silentFill(m_plans[i], canTrample);
+
+ jumpTo(jit);
+ }
+
+private:
+ JSValueRegs m_resultRegs;
+ GPRReg m_baseReg;
+ GPRReg m_propertyReg;
+ Vector<SilentRegisterSavePlan, 2> m_plans;
+};
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
+#endif // DFGSaneStringGetByValSlowPathGenerator_h
+
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (152943 => 152944)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2013-07-20 07:26:29 UTC (rev 152943)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2013-07-20 17:58:57 UTC (rev 152944)
@@ -33,6 +33,7 @@
#include "DFGArrayifySlowPathGenerator.h"
#include "DFGBinarySwitch.h"
#include "DFGCallArrayAllocatorSlowPathGenerator.h"
+#include "DFGSaneStringGetByValSlowPathGenerator.h"
#include "DFGSlowPathGenerator.h"
#include "JSCJSValueInlines.h"
#include "LinkBuffer.h"
@@ -2114,16 +2115,12 @@
JSGlobalObject* globalObject = m_jit.globalObjectFor(node->codeOrigin);
if (globalObject->stringPrototypeChainIsSane()) {
#if USE(JSVALUE64)
- addSlowPathGenerator(
- slowPathMove(
- outOfBounds, this, TrustedImm64(JSValue::encode(jsUndefined())),
- scratchReg));
+ addSlowPathGenerator(adoptPtr(new SaneStringGetByValSlowPathGenerator(
+ outOfBounds, this, JSValueRegs(scratchReg), baseReg, propertyReg)));
#else
- addSlowPathGenerator(
- slowPathMove(
- outOfBounds, this,
- TrustedImm32(JSValue::UndefinedTag), resultTagReg,
- TrustedImm32(0), scratchReg));
+ addSlowPathGenerator(adoptPtr(new SaneStringGetByValSlowPathGenerator(
+ outOfBounds, this, JSValueRegs(resultTagReg, scratchReg),
+ baseReg, propertyReg)));
#endif
} else {
#if USE(JSVALUE64)