FW: debugging interfaces

# Allen Wirfs-Brock (16 years ago)

This was sent to es5-discuss even though the original thread was on es

# Allen Wirfs-Brock (16 years ago)

Actually meant to forward this one rather than the previous Brendan message...

From: es5-discuss-bounces at mozilla.org [mailto:es5-discuss-bounces at mozilla.org] On Behalf Of Brendan Eich Sent: Thursday, August 13, 2009 11:47 AM To: David-Sarah Hopwood Cc: es5-discuss at mozilla.org Subject: Re: debugging interfaces

On Aug 13, 2009, at 11:33 AM, David-Sarah Hopwood wrote:

Jordan Osete wrote:

Then, if we accept the idea of keeping only a reference to the objects until information about them is explicitly requested, couldn't we do the same things for the variables and arguments objects ?

Keeping a reference to these would interfere with the use of optimized calling conventions where arguments are only stored in machine registers and never reified (when 'arguments' is not referred to). Similarly for variable frames, which need not be reified unless they are captured by a closure.

Right. Or, even moreso, if possible -- there may be no variable object reified in an implementation that optimizes harder. ES1-5 take pains to avoid any reference to such an object escaping. Firefox 3.5 optimizes various closure cases including non-escaping Algol-like procedures (using a display) and closures capturing write-once variables whose initialisers dominate the closure ("flat closures", what Chez Scheme calls "display closures"). Assignment conversion (a la Chez Scheme) is being explored.

If we impose a model where you have to "compile with -g" to get first-class stack inspection, otherwise you get nothing, developers will always turn on the deoptimizing debugger-friendly option, after being burned by missing the chance to diagnose a bug in flagrante because they were running in optimized mode.

I like Christian's proposal, FWIW. We should see about other VMs implementing it.