On Thu, Dec 8, 2011 at 1:57 PM, Michael Starzinger
<[email protected]>wrote:

> I think that's exactly what they are. IMHO, constructors are methods of
> the object holding them.
>

Nah.  'this' in the body of the constructor has no relation to any object
holding it.


> That object might be a real object (as in the
> case of raytrace.js) or some global object. The constructor just gets a
> newly created object passed as the 'this' value. But again, I am missing
> the big picture to see the problems down the line.
>

This change treats global variables like all others, and does not use ICs.


> I still don't see the difference in that regard between [[Call]] and
> [[Construct]]. All differences between those two invocations are taken
> care of by the construct stub. All other aspects should be the same for
> both.
>

Sorry, I had that completely backwards.  The semantic problem is today with
this change, and would be fixed if we implemented the ES 5 semantics of
method calls.  The semantics of 'new F.G(arg0, ...) is to evaluate F.G,
evaluate the arguments from left to right, and then invoke the constructor.
 If you use CallIC for that, you get evaluate F, evaluate G, evaluate the
arguments from left to right, lookup the G-value property of F-value, and
then invoke the constructor.

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to