Reviewed by Oliver.
Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
<https://bugs.webkit.org/show_bug.cgi?id=19830>
Ensure that we do not eliminate a write to a local register when doing
peephole optimizations.
JavaScriptCore:
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitJumpIfTrue):
(KJS::CodeGenerator::emitJumpIfFalse):
LayoutTests:
* fast/js/codegen-peephole-locals-expected.txt: Added.
* fast/js/codegen-peephole-locals.html: Added.
* fast/js/resources/codegen-peephole-locals.js: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34903
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Oliver.
+
+ Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
+ <https://bugs.webkit.org/show_bug.cgi?id=19830>
+
+ Ensure that we do not eliminate a write to a local register when doing
+ peephole optimizations.
+
+ * VM/CodeGenerator.cpp:
+ (KJS::CodeGenerator::emitJumpIfTrue):
+ (KJS::CodeGenerator::emitJumpIfFalse):
+
2008-06-30 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Alder.
retrieveLastBinaryOp(dstIndex, src1Index, src2Index);
- if (cond->index() == dstIndex && !cond->refCount()) {
+ if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
rewindBinaryOp();
emitOpcode(target->isForwardLabel() ? op_jless : op_loop_if_less);
instructions().append(src1Index);
retrieveLastBinaryOp(dstIndex, src1Index, src2Index);
- if (cond->index() == dstIndex && !cond->refCount()) {
+ if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
rewindBinaryOp();
emitOpcode(op_jnless);
instructions().append(src1Index);
+2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+
+ Reviewed by Oliver.
+
+ Tests for:
+
+ Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
+ <https://bugs.webkit.org/show_bug.cgi?id=19830>
+
+ * fast/js/codegen-peephole-locals-expected.txt: Added.
+ * fast/js/codegen-peephole-locals.html: Added.
+ * fast/js/resources/codegen-peephole-locals.js: Added.
+
2008-06-30 Adele Peterson <adele@apple.com>
Reviewed by Anders.
--- /dev/null
+Tests whether peephole optimizations on bytecode properly deal with local registers.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS if_less_test() is true
+PASS if_else_less_test() is true
+PASS conditional_less_test() is true
+PASS logical_and_less_test() is true
+PASS logical_or_less_test() is true
+PASS do_while_less_test() is true
+PASS while_less_test() is true
+PASS for_less_test() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/codegen-peephole-locals.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
--- /dev/null
+description(
+"Tests whether peephole optimizations on bytecode properly deal with local registers."
+);
+
+function if_less_test()
+{
+ var a = 0;
+ var b = 2;
+ if (a = 1 < 2)
+ return a == 1;
+}
+
+shouldBeTrue("if_less_test()");
+
+function if_else_less_test()
+{
+ var a = 0;
+ var b = 2;
+ if (a = 1 < 2)
+ return a == 1;
+ else
+ return false;
+}
+
+shouldBeTrue("if_else_less_test()");
+
+function conditional_less_test()
+{
+ var a = 0;
+ var b = 2;
+ return (a = 1 < 2) ? a == 1 : false;
+}
+
+shouldBeTrue("conditional_less_test()");
+
+function logical_and_less_test()
+{
+ var a = 0;
+ var b = 2;
+ return (a = 1 < 2) && a == 1;
+}
+
+shouldBeTrue("logical_and_less_test()");
+
+function logical_or_less_test()
+{
+ var a = 0;
+ var b = 2;
+ var result = (a = 1 < 2) || a == 1;
+ return a == 1;
+}
+
+shouldBeTrue("logical_or_less_test()");
+
+function do_while_less_test()
+{
+ var a = 0;
+ var count = 0;
+ do {
+ if (count == 1)
+ return a == 1;
+ count++;
+ } while (a = 1 < 2)
+}
+
+shouldBeTrue("do_while_less_test()");
+
+function while_less_test()
+{
+ var a = 0;
+ while (a = 1 < 2)
+ return a == 1;
+}
+
+shouldBeTrue("while_less_test()");
+
+function for_less_test()
+{
+ for (var a = 0; a = 1 < 2; )
+ return a == 1;
+}
+
+shouldBeTrue("for_less_test()");
+
+var successfullyParsed = true;