Commit 2ccb78f6 authored by cwzwarich@webkit.org's avatar cwzwarich@webkit.org

2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>

        Reviewed by Oliver.

        Bug 19730: REGRESSION (r34497): Text in alerts in "Leisure suit Larry" is not wrapped
        <https://bugs.webkit.org/show_bug.cgi?id=19730>

        Do not convert the pair (less, jtrue) to jless when jtrue is a jump
        target. An example of this is when the condition of a while loop is a
        LogicalOrNode.

        JavaScriptCore:

        * VM/CodeGenerator.cpp:
        (KJS::CodeGenerator::emitLabel):

        LayoutTests:

        * fast/js/codegen-loops-logical-nodes-expected.txt: Added.
        * fast/js/codegen-loops-logical-nodes.html: Added.
        * fast/js/resources/codegen-loops-logical-nodes.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6b4c93f9
2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Bug 19730: REGRESSION (r34497): Text in alerts in "Leisure suit Larry" is not wrapped
<https://bugs.webkit.org/show_bug.cgi?id=19730>
Do not convert the pair (less, jtrue) to jless when jtrue is a jump
target. An example of this is when the condition of a while loop is a
LogicalOrNode.
* VM/CodeGenerator.cpp:
(KJS::CodeGenerator::emitLabel):
2008-06-20 Ariya Hidayat <ariya.hidayat@trolltech.com>
Reviewed by Adam Roben.
......
......@@ -390,6 +390,10 @@ PassRefPtr<LabelID> CodeGenerator::newLabel()
PassRefPtr<LabelID> CodeGenerator::emitLabel(LabelID* l0)
{
l0->setLocation(instructions().size());
// This disables peephole optimizations when an instruction is a jump target
m_lastOpcodeID = op_end;
return l0;
}
......
2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Tests for:
Bug 19730: REGRESSION (r34497): Text in alerts in "Leisure suit Larry" is not wrapped
<https://bugs.webkit.org/show_bug.cgi?id=19730>
* fast/js/codegen-loops-logical-nodes-expected.txt: Added.
* fast/js/codegen-loops-logical-nodes.html: Added.
* fast/js/resources/codegen-loops-logical-nodes.js: Added.
2008-06-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.
Tests loop codegen when the condition is a logical node.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS while_or_eq() is true
PASS while_or_neq() is true
PASS while_or_less() is true
PASS while_or_lesseq() is true
PASS while_and_eq() is true
PASS while_and_neq() is true
PASS while_and_less() is true
PASS while_and_lesseq() is true
PASS for_or_eq() is true
PASS for_or_neq() is true
PASS for_or_less() is true
PASS for_or_lesseq() is true
PASS for_and_eq() is true
PASS for_and_neq() is true
PASS for_and_less() is true
PASS for_and_lesseq() is true
PASS dowhile_or_eq() is true
PASS dowhile_or_neq() is true
PASS dowhile_or_less() is true
PASS dowhile_or_lesseq() is true
PASS dowhile_and_eq() is true
PASS dowhile_and_neq() is true
PASS dowhile_and_less() is true
PASS dowhile_and_lesseq() is true
PASS successfullyParsed is true
TEST COMPLETE
<!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-loops-logical-nodes.js"></script>
<script src="resources/js-test-post.js"></script>
</body>
</html>
description(
"Tests loop codegen when the condition is a logical node."
);
function while_or_eq()
{
var a = 0;
while (a == 0 || a == 0)
return true;
return false;
}
shouldBeTrue("while_or_eq()");
function while_or_neq()
{
var a = 0;
while (a != 1 || a != 1)
return true;
return false;
}
shouldBeTrue("while_or_neq()");
function while_or_less()
{
var a = 0;
while (a < 1 || a < 1)
return true;
return false;
}
shouldBeTrue("while_or_less()");
function while_or_lesseq()
{
var a = 0;
while (a <= 1 || a <= 1)
return true;
return false;
}
shouldBeTrue("while_or_lesseq()");
function while_and_eq()
{
var a = 0;
while (a == 0 && a == 0)
return true;
return false;
}
shouldBeTrue("while_and_eq()");
function while_and_neq()
{
var a = 0;
while (a != 1 && a != 1)
return true;
return false;
}
shouldBeTrue("while_and_neq()");
function while_and_less()
{
var a = 0;
while (a < 1 && a < 1)
return true;
return false;
}
shouldBeTrue("while_and_less()");
function while_and_lesseq()
{
var a = 0;
while (a <= 1 && a <= 1)
return true;
return false;
}
shouldBeTrue("while_and_lesseq()");
function for_or_eq()
{
for (var a = 0; a == 0 || a == 0; )
return true;
return false;
}
shouldBeTrue("for_or_eq()");
function for_or_neq()
{
for (var a = 0; a != 1 || a != 1; )
return true;
return false;
}
shouldBeTrue("for_or_neq()");
function for_or_less()
{
for (var a = 0; a < 1 || a < 1; )
return true;
return false;
}
shouldBeTrue("for_or_less()");
function for_or_lesseq()
{
for (var a = 0; a <= 1 || a <= 1; )
return true;
return false;
}
shouldBeTrue("for_or_lesseq()");
function for_and_eq()
{
for (var a = 0; a == 0 && a == 0; )
return true;
return false;
}
shouldBeTrue("for_and_eq()");
function for_and_neq()
{
for (var a = 0; a != 1 && a != 1; )
return true;
return false;
}
shouldBeTrue("for_and_neq()");
function for_and_less()
{
for (var a = 0; a < 1 && a < 1; )
return true;
return false;
}
shouldBeTrue("for_and_less()");
function for_and_lesseq()
{
for (var a = 0; a <= 1 && a <= 1; )
return true;
return false;
}
shouldBeTrue("for_and_lesseq()");
function dowhile_or_eq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a == 0 || a == 0)
return false;
}
shouldBeTrue("dowhile_or_eq()");
function dowhile_or_neq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a != 1 || a != 1)
return false;
}
shouldBeTrue("dowhile_or_neq()");
function dowhile_or_less()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a < 1 || a < 1)
return false;
}
shouldBeTrue("dowhile_or_less()");
function dowhile_or_lesseq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a <= 1 || a <= 1)
return false;
}
shouldBeTrue("dowhile_or_lesseq()");
function dowhile_and_eq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a == 0 && a == 0)
return false;
}
shouldBeTrue("dowhile_and_eq()");
function dowhile_and_neq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a != 1 && a != 1)
return false;
}
shouldBeTrue("dowhile_and_neq()");
function dowhile_and_less()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a < 1 && a < 1)
return false;
}
shouldBeTrue("dowhile_and_less()");
function dowhile_and_lesseq()
{
var a = 0;
var i = 0;
do {
if (i > 0)
return true;
i++;
} while (a <= 1 && a <= 1)
return false;
}
shouldBeTrue("dowhile_and_lesseq()");
var successfullyParsed = true;
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