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

Issue 6932068: A first skeleton for introducing Harmony proxies (Closed)

Created:
9 years, 7 months ago by rossberg
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

A first skeleton for introducing Harmony proxies. 1) Add new type JSProxy for representing proxy objects. Currently devoid of functionality, i.e., all properties are undefined. 2) Some rudimentary global $Proxy functions to create proxies. Next step: Hook up getProperty and getOwnProperty handlers. Will probably require introducing a new LookupResult type, which is a mixture of INTERCEPTOR (handles any property) and CALLBACK (calls back to JS). Can we unify this somehow? TODO: Should probably rename existing Proxy type to something like "Foreign", to avoid confusion. Committed: http://code.google.com/p/v8/source/detail?r=7887

Patch Set 1 #

Total comments: 8

Patch Set 2 : Addressed Kevin's comments. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -20 lines) Patch
M include/v8.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/bootstrapper.cc View 1 1 chunk +6 lines, -4 lines 0 comments Download
M src/factory.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/heap.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M src/heap.cc View 1 1 chunk +21 lines, -0 lines 2 comments Download
M src/ia32/frames-ia32.h View 1 2 chunks +5 lines, -3 lines 0 comments Download
M src/objects.h View 1 6 chunks +38 lines, -1 line 0 comments Download
M src/objects.cc View 1 5 chunks +15 lines, -10 lines 0 comments Download
M src/objects-debug.cc View 1 2 chunks +8 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 3 chunks +10 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 3 chunks +13 lines, -0 lines 0 comments Download
M src/objects-visiting.cc View 1 1 chunk +5 lines, -0 lines 2 comments Download
M src/proxy.js View 1 1 chunk +37 lines, -0 lines 0 comments Download
M src/runtime.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 1 chunk +11 lines, -0 lines 0 comments Download
M src/runtime.js View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
rossberg
9 years, 7 months ago (2011-05-06 14:24:33 UTC) #1
Kevin Millikin (Chromium)
This LGTM as a start. There is not yet any sharing of maps for proxies. ...
9 years, 7 months ago (2011-05-13 08:08:30 UTC) #2
rossberg
I added a TODO about map sharing to heap.cc. We probably will want to cache ...
9 years, 7 months ago (2011-05-13 09:21:53 UTC) #3
rossberg
I added a TODO to AllocateJSProxy. We probably will want to cache proxy maps keyed ...
9 years, 7 months ago (2011-05-13 09:26:14 UTC) #4
Vyacheslav Egorov (Chromium)
DBC There is a GC related problem bug see comment in object-visiting.cc. http://codereview.chromium.org/6932068/diff/9002/src/heap.cc File src/heap.cc ...
9 years, 7 months ago (2011-05-22 14:45:49 UTC) #5
rossberg
9 years, 7 months ago (2011-05-23 08:45:28 UTC) #6
Hi Slava, thanks, I gonna send you a patch shortly.

http://codereview.chromium.org/6932068/diff/9002/src/heap.cc
File src/heap.cc (right):

http://codereview.chromium.org/6932068/diff/9002/src/heap.cc#newcode3220
src/heap.cc:3220: if (!maybe_map_obj->ToObject(&map_obj)) return maybe_map_obj;
On 2011/05/22 14:45:50, Vyacheslav Egorov wrote:
> I introduced a helpful templated To<T> accessor to avoid boilerplate code:
> 
> if (!maybe_map_obj->To<Map>(&map)) ...

Ah, nice. Done.

http://codereview.chromium.org/6932068/diff/9002/src/objects-visiting.cc
File src/objects-visiting.cc (right):

http://codereview.chromium.org/6932068/diff/9002/src/objects-visiting.cc#newc...
src/objects-visiting.cc:92: return GetVisitorIdForSize(kVisitDataObject,
On 2011/05/22 14:45:50, Vyacheslav Egorov wrote:
> This introduces a subtle GC problem: JS_PROXY is not a data object. Data
objects
> do not contain pointers in their bodies.
> 
> We should either pretend that JS_PROXY is a struct (kVisitStruct,
> kVisitStructGeneric) or introduce a separate kVisitJSProxy. 
> 
> I think pretending that JS_PROXY is a struct should be fine especially because
> proxies are probably not going to need any special handling by visitors.

Done.

Powered by Google App Engine
This is Rietveld 408576698