Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Issue 210953005: Clean up some "GetProperty" methods/functions. (Closed)

Created:
6 years, 9 months ago by Yang
Modified:
6 years, 9 months ago
Reviewers:
Igor Sheludko
CC:
v8-dev
Visibility:
Public.

Description

Clean up some "GetProperty" methods/functions. Runtime::GetObjectProperty: - handled string.charAt, element access and property access - now handlified GetProperty in handles.cc: - called to Runtime::GetObjectProperty - now removed Object::GetProperty (handlified version): - handled element access and property access - now changed to only do property access New: Object::GetPropertyOrElement: - handles element access and property access R=ishell@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=20327

Patch Set 1 #

Total comments: 11

Patch Set 2 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -118 lines) Patch
M src/api.cc View 1 6 chunks +17 lines, -9 lines 0 comments Download
M src/bootstrapper.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/execution.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/handles.h View 1 chunk +0 lines, -4 lines 0 comments Download
M src/handles.cc View 1 2 chunks +4 lines, -12 lines 0 comments Download
M src/ic.cc View 1 2 chunks +6 lines, -2 lines 0 comments Download
M src/isolate.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/json-stringifier.h View 3 chunks +3 lines, -3 lines 0 comments Download
M src/objects.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects.cc View 1 12 chunks +33 lines, -32 lines 0 comments Download
M src/runtime.h View 1 1 chunk +3 lines, -9 lines 0 comments Download
M src/runtime.cc View 1 8 chunks +28 lines, -39 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Yang
6 years, 9 months ago (2014-03-25 14:31:53 UTC) #1
Igor Sheludko
If the comments do not make sense then lgtm. https://codereview.chromium.org/210953005/diff/1/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/210953005/diff/1/src/bootstrapper.cc#newcode1941 src/bootstrapper.cc:1941: ...
6 years, 9 months ago (2014-03-26 18:37:31 UTC) #2
Yang
Committed patchset #2 manually as r20327 (presubmit successful).
6 years, 9 months ago (2014-03-28 09:49:40 UTC) #3
Yang
6 years, 9 months ago (2014-03-28 09:56:58 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/210953005/diff/1/src/bootstrapper.cc
File src/bootstrapper.cc (right):

https://codereview.chromium.org/210953005/diff/1/src/bootstrapper.cc#newcode1941
src/bootstrapper.cc:1941: Handle<JSFunction>::cast(Object::GetProperty(
On 2014/03/26 18:37:31, Igor Sheludko wrote:
> We don't need all the checks performed by Runtime::GetObjectProperty() for
> global objects. Right?

Right. The object is the global object (not a string), and the key is not a
number.

https://codereview.chromium.org/210953005/diff/1/src/execution.cc
File src/execution.cc (right):

https://codereview.chromium.org/210953005/diff/1/src/execution.cc#newcode786
src/execution.cc:786: Handle<Object> char_at = Object::GetProperty(
On 2014/03/26 18:37:31, Igor Sheludko wrote:
> We don't need all the checks done by Runtime::GetObjectProperty() for js
> builtins object. Right?

Right.

https://codereview.chromium.org/210953005/diff/1/src/json-stringifier.h
File src/json-stringifier.h (right):

https://codereview.chromium.org/210953005/diff/1/src/json-stringifier.h#newco...
src/json-stringifier.h:660: for (int i = 0; i < map->NumberOfOwnDescriptors();
i++) {
On 2014/03/26 18:37:31, Igor Sheludko wrote:
> Shouldn't we create a HandleScope here inside the loop?

No. This is working as intended. The string we are dumping to may be
extended/reallocated as we go. So if we had a new handle scope in each loop, we
would also have to escape the handle in each loop, like at the end of this
function. The way it currently is works fine, we can change it if it turns out
to be a problem at some point.

https://codereview.chromium.org/210953005/diff/1/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/210953005/diff/1/src/objects.cc#newcode3606
src/objects.cc:3606: Handle<Object> configurable = Object::GetProperty(desc,
configurable_name);
On 2014/03/26 18:37:31, Igor Sheludko wrote:
> Is it possible to get undefined or null as a desc here? If not is it worth
> ASSERTing about that?

I think it's alright the way it is. This is purely mechanical after all.

https://codereview.chromium.org/210953005/diff/1/src/objects.cc#newcode3741
src/objects.cc:3741: RETURN_IF_EMPTY_HANDLE_VALUE(isolate, setter, NONE);
On 2014/03/26 18:37:31, Igor Sheludko wrote:
> Add two spaces in front of the line.

Done.

Powered by Google App Engine
This is Rietveld 408576698