[Laszlo-checkins] r10470 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc

dda@openlaszlo.org dda at openlaszlo.org
Thu Jul 24 18:44:48 PDT 2008


Author: dda
Date: 2008-07-24 18:44:47 -0700 (Thu, 24 Jul 2008)
New Revision: 10470

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationContext.java
Log:
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 


------------------------------------------------------------------------ 


Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationContext.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationContext.java	2008-07-25 01:41:07 UTC (rev 10469)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationContext.java	2008-07-25 01:44:47 UTC (rev 10470)
@@ -23,7 +23,7 @@
  */
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2004, 2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -35,9 +35,7 @@
 public class TranslationContext extends HashMap {
   public static String FLASM = "flasm";
   public static String VARIABLES = "variables";
-  public static String LOWERVARIABLES = "lowerVariables";
   public static String REGISTERS = "registers";
-  public static String LOWERREGISTERS = "lowerRegisters";
 
   public Object type;                  // Class or String
   public TranslationContext parent;



More information about the Laszlo-checkins mailing list