I think this can be simplified, but this looks like the right fix.


http://codereview.chromium.org/6548008/diff/4001/src/accessors.cc
File src/accessors.cc (right):

http://codereview.chromium.org/6548008/diff/4001/src/accessors.cc#newcode450
src/accessors.cc:450: if (!function->should_have_prototype()) {
Can we simplify this? How about moving this before the
!function->has_prototype() check and doing something like:

while (!function->should_have_prototype()) {
  found_it = false;
  function = FindInPrototypeChain<JSFunction>(object->GetPrototype(),
&found_it);
  ASSERT(found_it);  // There has to be one because we hit the getter
}

That should be all that we need. Then the original code will do the
right thing as far as I can tell?

http://codereview.chromium.org/6548008/diff/4001/src/accessors.cc#newcode453
src/accessors.cc:453: Handle<String> proto_name =
This code does not use handles. You can use Heap::prototype_symbol()
below instead.

http://codereview.chromium.org/6548008/diff/4001/src/accessors.cc#newcode486
src/accessors.cc:486: return object->SetLocalPropertyIgnoreAttributes(
Please add a comment stating that object does not have a prototype
property since we hit this accessor.

http://codereview.chromium.org/6548008/diff/4001/src/accessors.cc#newcode487
src/accessors.cc:487:
*Factory::NewStringFromAscii(CStrVector("prototype")),
Heap::prototype_symbol()

http://codereview.chromium.org/6548008/

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

Reply via email to