Looks like a good start. I think we need to do more to the new JSFunction map. In particular, we need to remove the prototype accessor completely. Maybe you can allocate the 'JSFunction with no prototype' map up front and just change to
that map in the RemovePrototype method?

http://codereview.chromium.org/1722003/diff/1/8
File src/accessors.cc (right):

http://codereview.chromium.org/1722003/diff/1/8#newcode445
src/accessors.cc:445: if
(function->map()->is_function_prototype_removed()) {
Maybe add a function->should_have_prototype() method?

Also, still having the GetPrototype accessor on the function means that
the function will have the prototype property but the value of the
property will be undefined. Is that the intended behavior? I think the
intended behavior is that the prototype property is not there at all?

In other words: "'prototype' in eval" should evaluate to false, right?

I think we need a special kind of JSFunction that does not have this
accessor.

http://codereview.chromium.org/1722003/diff/1/5
File src/bootstrapper.cc (right):

http://codereview.chromium.org/1722003/diff/1/5#newcode339
src/bootstrapper.cc:339: Factory::NewFunctionWithPrototype(symbol,
Can we make NewFunctionWithPrototype handle the case where we explicitly
do not want a function prototype? That way, maybe we can avoid having a
RemovePrototype() method and just give the function the correct map with
the bit set when it is created? Also, we probably need to make sure that
the function does not have the prototype accessor at all.

I guess you still need something like RemovePrototype so you can remove
the prototype from the funtions in the JS natives...

http://codereview.chromium.org/1722003/diff/1/7
File src/objects.h (right):

http://codereview.chromium.org/1722003/diff/1/7#newcode2860
src/objects.h:2860: inline void set_function_prototype_removed(bool
value);
Maybe this should be called function_should_have_prototype?

http://codereview.chromium.org/1722003/show

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

Reply via email to