[Laszlo-dev] For Review: Change 20080724-dda-2 Summary: minor cleanup of SWF6 compiler transforms
Donald Anderson
dda at ddanderson.com
Thu Jul 24 14:50:44 PDT 2008
Change 20080724-dda-2 by dda at lester.local on 2008-07-24 16:43:04 EDT
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: minor cleanup of SWF6 compiler transforms
New Features:
Bugs Fixed: LPP-6669 (Remove swf6 byte-code kludges from
CodeGenerator.java)
Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Most of the issues implied by the LPP-6669 cannot be fixed - but
details are listed here.
0) Removed some code specific to swf6 involving using lower case for
variable and register names
Examined and tested the various transforms in question:
1)
// swf6 returns undefined for comparisons with NaN, it
// is supposed to return false (note that you cannot
// eliminate one NOT by inverting the sense of the
// comparison
BinopInstrs.put(ParserConstants.LT, new Instruction[]
{Instructions.LessThan, Instructions.NOT, Instructions.NOT});
Tried setting this to just Instructions.LesThan, but smokecheck gives
errors on NaN comparisons.
2)
// swf6 does not have GE or LE, but inverting the
// complement operator does not work for NaN ordering
// Luckily, LogicalOr coerces undefined to false, so we
// don't have to play the NOT NOT trick above
BinopInstrs.put(ParserConstants.LE, new Instruction[]
Tried setting LE to { Instructions.GT, Instructions.NOT }
smokecheck also gives errors on NaN comparisons.
For kicks, also tried setting LE to { Instructions.GT,
Instructions.NOT , Instructions.NOT , Instructions.NOT }
to see if the 'double NOT' trick might work, but also gives the
same smokecheck errors.
Also examined flasm source to see if GE or LE has been added (they
have not).
3)
// swf6 does not have NE or SNE either, but inverting
// the complement is correct for NaN
There are no new opcodes for NE or SNE (at least as known to flasm)
4)
// Approximate a in b as b.a =! void 0
No new opcodes for 'in'
5) Special case of 'is' in translateBinaryExpression.
No new opcodes for 'is'
6) Special case of 'cast' in translateBinaryExpression.
There is a SWF 'CAST' operator that leaves a 'null' on the stack in
case of error.
This is not being utilized, and there's already a separate TODO for
this item.
It didn't seem to be under the purvue of this Jira bug.
Tests:
regression: smokecheck swf8/dhtml
Files:
M WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080724-dda-2.tar
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080724/50865658/attachment.html
More information about the Laszlo-dev
mailing list