[Laszlo-dev] For Review: Change 20090415-ptw-w Summary: Improve catch-errors and backtrace efficiency
André Bargull
andre.bargull at udo.edu
Thu Apr 16 15:31:40 PDT 2009
> + // Not sure why we turn this off now...
> options.putBoolean(Compiler.CATCH_FUNCTION_EXCEPTIONS, false);
I think it's turned off, so you won't emit more try..catch blocks when
you descend into children.
A try..catch block is created in this case, but I don't think that's
right here:
---
<method name="blubb_5" returns="void" >
this.a;
</method>
---
Otherwise approved.
On 4/16/2009 2:59 PM, P T Withington wrote:
> I'll take all your suggestions. We want a compromise between what
> _would_ have been returned in as2 and what _can_ be returned in
> ES5/as3. I honestly forgot about `int` and `uint`. Hopefully no one
> actually uses those, since they are not ECMAScript types (and will not
> be in ES5).
>
> Approved with your changes?
>
> On 2009-04-16, at 05:01EDT, André Bargull wrote:
>
>> Why do you return the empty string if returnType is "String"? Strings
>> can be `null`. And you've missed to include "int" and "uint" (both are
>> coerced to 0 in AS3).
>> I'd say the return values should be (for best cross-runtime compliance):
>> void -> no return
>> int, uint, Number -> 0
>> Boolean -> false
>> all other -> null
>>
>> <canvas debug="true">
>> <script when="immediate"><![CDATA[
>> public class Foo {
>> // void must not have return value in AS3
>> // public function f_void () :void {return null;}
>> // coerced to 0 in AS3
>> public function f_int () :int {return null;}
>> // coerced to 0 in AS3
>> public function f_uint () :uint {return null;}
>> // coerced to 0 in AS3
>> public function f_Number () :Number {return null;}
>> // coerced to false in AS3
>> public function f_Boolean () :Boolean {return null;}
>> // returns null
>> public function f_String () :String {return null;}
>> // returns null
>> public function f_Object () :Object {return null;}
>> // returns null
>> public function f_Date () :Date {return null;}
>> }
>> // make a reference to class so it'll be compiled...
>> Foo;
>> ]]></script>
>> </canvas>
>>
>> On 4/16/2009 1:54 AM, P T Withington wrote:
>>> Change 20090415-ptw-w by ptw at dueling-banjos.home on 2009-04-15
>>> 19:34:51 EDT
>>> in /Users/ptw/OpenLaszlo/trunk-3
>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>
>>> Summary: Improve catch-errors and backtrace efficiency
>>>
>>> Bugs Fixed: LPP-8008 Optimize catcherrors
>>>
>>> Technical Reviewer: a.bargull at intensis.de, hminksy (pending)
>>> QA Reviewer: dda at ddanderson.com (pending)
>>>
>>> Details:
>>> LzMessage: Correct stack skip for $reportSourceWarning (which was
>>> one too many).
>>>
>>> JavascriptGenerator: Eliminate the need for the inner closure to
>>> catch errors. Merge catching of errors with the backtrace
>>> maintainer.
>>>
>>> - noteCallSite should only emit line numbers for positive line
>>> numbers (generated nodes sometimes have -1 as a line number).
>>>
>>> - predecls no longer needed, but need postfix to insert a default
>>> return value to keep the flex compiler happy.
>>>
>>> - Only enable catching of errors if variable analysis shows that
>>> there are dereferences (calls, or property references) that
>>> could err
>>>
>>> - If generating for swf9 and catching errors, insert a 'null'
>>> return at the end of the function that matches the return type
>>> of the function to mimic as2.
>>>
>>> - Eliminate the inner closure for tryAll, we can just wrap the
>>> body directly in a try/catch and eliminate the extra function
>>> call overhead.
>>>
>>> VariableAnalyzer: Make it possible to call computeReferences more
>>> than once (so we can analyze the body before and after the try
>>> wrapper is added). Also, calculate a new property, dereferenced,
>>> that tells if any calls or property references occured.
>>>
>>> Tests:
>>> Turned on lps.properties:compiler.catcherrors, [all demos,
>>> smokecheck] x [dhtml, swf9]
>>>
>>> Files:
>>> M WEB-INF/lps/lfc/debugger/LzMessage.lzs
>>> M WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
>>> M WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java
>>>
>>>
>>> Changeset:
>>> http://svn.openlaszlo.org/openlaszlo/patches/20090415-ptw-w.tar
>>>
>
>
More information about the Laszlo-dev
mailing list