[Laszlo-checkins] r11704 - openlaszlo/trunk/WEB-INF/lps/lfc/debugger

bargull@openlaszlo.org bargull at openlaszlo.org
Thu Nov 6 15:39:05 PST 2008


Author: bargull
Date: 2008-11-06 15:39:03 -0800 (Thu, 06 Nov 2008)
New Revision: 11704

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs
Log:
Change 20081031-bargull-H3n by bargull at dell--p4--2-53 on 2008-10-31 20:08:34
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: merge code in LzMemory

New Features:

Bugs Fixed: LPP-5218

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
The swf8 runtime understands now try-catch, so we can merge back the different code paths 
    

Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs	2008-11-06 23:06:33 UTC (rev 11703)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMemory.lzs	2008-11-06 23:39:03 UTC (rev 11704)
@@ -9,10 +9,6 @@
   * @topic LZX
   * @subtopic Debugging
   *
-  * @devnote [2007-12-08 ptw] Throughout this file the code inside `if
-  * ($as2) { } else` is a duplicate of the following `try` block and
-  * is only needed until the compiler can correctly compile `try` for
-  * $as2.  Once that happens, the $as2 blocks can be removed.
   */
 
 // Memory analysis tools for the debugger
@@ -66,11 +62,6 @@
     }
     return false;
   }
-  if ($as2) {
-    var annotation = this.annotation;
-    delete o[annotation.leaked];
-    o[annotation.marked] = this.markGeneration;
-  } else
   try {
     var annotation = this.annotation;
     delete o[annotation.leaked];
@@ -108,23 +99,17 @@
   // native prototype that will fail when called on the prototype
   // itself).  If so, pretend the object is marked -- we can't trace
   // any deeper
-  if ($as2) {
+  try {
     if (! o.hasOwnProperty(marked)) {
       return null;
     }
     return o[marked] == this.markGeneration;
-  } else
-    try {
-      if (! o.hasOwnProperty(marked)) {
-        return null;
-      }
-      return o[marked] == this.markGeneration;
-    } catch (e) {
-      if (this.debugTrace) {
-        console.log('Not tracing %s\n', o);
-      }
-      return true;
+  } catch (e) {
+    if (this.debugTrace) {
+      console.log('Not tracing %s\n', o);
     }
+    return true;
+  }
 }
 
 /**
@@ -230,10 +215,6 @@
     // But only if asked to
     if (dopath) {
       var path = ose.path.concat(name);
-      if ($as2) {
-        // More compact than an Array
-        o[why] = path.join("\x01");
-      } else
       try {
         // More compact than an Array
         o[why] = path.join("\x01");
@@ -491,14 +472,6 @@
       this.property = path.pop();
       // Make pretty
       this.path = path.join(".");
-      if ($as2) {
-        var p = eval(path[0]);
-        var pl = path.length;
-        for (var i = 1; i < pl; i++) {
-          p = p[path[i]];
-        }
-        this.parent = p;
-      } else
       try {
         var p = eval(path[0]);
         var pl = path.length;
@@ -558,33 +531,6 @@
     this.length = 0;
     for (var i = 0; i < ll; i = j) {
       var j = i + 1;
-      if ($as2) {
-        var p = l[i];
-        p[leaked] = p[size];
-        var pn = p[why];
-        if (typeof(pn) != 'undefined') {
-          while (j < ll) {
-            var c = l[j];
-            var cn = c[why];
-            if (typeof(cn) != 'undefined') {
-              if (cn.indexOf(pn) == 0) {
-                // Don't count loops
-                if (c !== p) {
-                  p[leaked] += c[size];
-                } else {
-                  if (Debug.debugTrace) {
-                    console.log('%s is %s\n', pn, cn);
-                  }
-                }
-                j++;
-                continue;
-              }
-            }
-            break;
-          }
-        }
-        this[this.length++] = new __LzLeak(p);
-      } else
       try {
         var p = l[i];
         p[leaked] = p[size];



More information about the Laszlo-checkins mailing list