Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Clean-up refactoring to eliminate GetLocalElementKind. (issue 11420011)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rossb...@chromium.org  
View profile  
 More options Nov 15 2012, 1:07 pm
From: rossb...@chromium.org
Date: Thu, 15 Nov 2012 18:07:53 +0000
Local: Thurs, Nov 15 2012 1:07 pm
Subject: Clean-up refactoring to eliminate GetLocalElementKind. (issue 11420011)
Reviewers: Michael Starzinger,

Description:
Clean-up refactoring to eliminate GetLocalElementKind.

Also fixes "a".propertyIsEnumerable(0) to correctly return true.

R=mstarzin...@chromium.org
BUG=

Please review this at https://codereview.chromium.org/11420011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
   M src/objects-inl.h
   M src/objects.h
   M src/objects.cc
   M src/runtime.cc
   M test/mjsunit/regress/regress-1692.js


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mstarzin...@chromium.org  
View profile  
 More options Nov 15 2012, 4:45 pm
From: mstarzin...@chromium.org
Date: Thu, 15 Nov 2012 21:45:37 +0000
Local: Thurs, Nov 15 2012 4:45 pm
Subject: Re: Clean-up refactoring to eliminate GetLocalElementKind. (issue 11420011)
The comments boil down to one question: "Where should the AsArrayIndex()  
go?"

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h
File src/objects-inl.h (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h#...
src/objects-inl.h:5039: }
I am not convinced that this is the right place to defer to the
element-case if the key is convertible to an index. I would rather have
FooPropertyBar() only deal with properties and FooElementBar() only deal
with elements.

I understand that the callers throughout the codebase should have one
entry point and not care about that distinction. Maybe having
FooPropertyOrElementBar() in between would be a good idea. Now the name
obviously needs some improvement.

WDYT?

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc#new...
src/objects.cc:252: if (name->AsArrayIndex(&index)) return
GetElement(object, index);
See comment in objects-inl.h about that.

With this one I am even more convinced that it's the wrong place. Either
the unhandlified GetProperty() defers or the caller does it. But this
handlified method should just dispatch.

https://codereview.chromium.org/11420011/diff/5001/src/objects.h
File src/objects.h (left):

https://codereview.chromium.org/11420011/diff/5001/src/objects.h#oldc...
src/objects.h:1853: enum LocalElementKind {
Oh yeah, LocalElementKind be gone. I like that!

https://codereview.chromium.org/11420011/diff/5001/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects.h#newc...
src/objects.h:1850: // These methods do not perform access checks!
Add empty newline above the comment.

https://codereview.chromium.org/11420011/diff/5001/test/mjsunit/regre...
File test/mjsunit/regress/regress-1692.js (right):

https://codereview.chromium.org/11420011/diff/5001/test/mjsunit/regre...
test/mjsunit/regress/regress-1692.js:85:
assertTrue(o.propertyIsEnumerable(0));
Nice catch!

https://codereview.chromium.org/11420011/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rossb...@chromium.org  
View profile  
 More options Nov 16 2012, 7:50 am
From: rossb...@chromium.org
Date: Fri, 16 Nov 2012 12:50:02 +0000
Local: Fri, Nov 16 2012 7:50 am
Subject: Re: Clean-up refactoring to eliminate GetLocalElementKind. (issue 11420011)

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h
File src/objects-inl.h (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h#...
src/objects-inl.h:5039: }
On 2012/11/15 21:45:37, Michael Starzinger wrote:

> I am not convinced that this is the right place to defer to the
element-case if
> the key is convertible to an index. I would rather have

FooPropertyBar() only

> deal with properties and FooElementBar() only deal with elements.
> I understand that the callers throughout the codebase should have one
entry
> point and not care about that distinction. Maybe having
> FooPropertyOrElementBar() in between would be a good idea. Now the
name
> obviously needs some improvement.
> WDYT?

I share your concern, but we already do this in various places in
objects.cc, so your suggestion would have to be part of a (much) larger
(and likely non-trivial) clean-up.

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc#new...
src/objects.cc:252: if (name->AsArrayIndex(&index)) return
GetElement(object, index);
On 2012/11/15 21:45:37, Michael Starzinger wrote:

> See comment in objects-inl.h about that.
> With this one I am even more convinced that it's the wrong place.
Either the
> unhandlified GetProperty() defers or the caller does it. But this
handlified
> method should just dispatch.

As discussed offline, I put this here mainly for performance reasons. I
agree it's not nice. Again, a consistent clean-up is a larger project.

Added a TODO.

https://codereview.chromium.org/11420011/diff/5001/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects.h#newc...
src/objects.h:1850: // These methods do not perform access checks!
On 2012/11/15 21:45:37, Michael Starzinger wrote:

> Add empty newline above the comment.

Done.

https://codereview.chromium.org/11420011/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mstarzin...@chromium.org  
View profile  
 More options Nov 16 2012, 8:18 am
From: mstarzin...@chromium.org
Date: Fri, 16 Nov 2012 13:18:51 +0000
Local: Fri, Nov 16 2012 8:18 am
Subject: Re: Clean-up refactoring to eliminate GetLocalElementKind. (issue 11420011)
LGTM.

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h
File src/objects-inl.h (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects-inl.h#...
src/objects-inl.h:5039: }
On 2012/11/16 12:50:02, rossberg wrote:

> On 2012/11/15 21:45:37, Michael Starzinger wrote:
> > I am not convinced that this is the right place to defer to the
element-case
> if
> > the key is convertible to an index. I would rather have

FooPropertyBar() only

> > deal with properties and FooElementBar() only deal with elements.

> > I understand that the callers throughout the codebase should have
one entry
> > point and not care about that distinction. Maybe having
> > FooPropertyOrElementBar() in between would be a good idea. Now the
name
> > obviously needs some improvement.

> > WDYT?
> I share your concern, but we already do this in various places in
objects.cc, so
> your suggestion would have to be part of a (much) larger (and likely
> non-trivial) clean-up.

Yes, I agree. This doesn't have to be part of this CL as long as we
agree that this particular situation is far from perfect.

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/11420011/diff/5001/src/objects.cc#new...
src/objects.cc:252: if (name->AsArrayIndex(&index)) return
GetElement(object, index);
On 2012/11/16 12:50:02, rossberg wrote:

> On 2012/11/15 21:45:37, Michael Starzinger wrote:
> > See comment in objects-inl.h about that.

> > With this one I am even more convinced that it's the wrong place.
Either the
> > unhandlified GetProperty() defers or the caller does it. But this
handlified
> > method should just dispatch.
> As discussed offline, I put this here mainly for performance reasons.
I agree
> it's not nice. Again, a consistent clean-up is a larger project.
> Added a TODO.

Together with the TODO I can live with this. And this cleanup CL is
definitely going into the right direction.

https://codereview.chromium.org/11420011/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »