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

Issue 505303004: Ensure that JSProxy::Fix gives the generated JSObject map a constructor (Closed)

Created:
6 years, 3 months ago by adamk
Modified:
6 years, 3 months ago
Reviewers:
rossberg, Toon Verwaest
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Ensure that JSProxy::Fix gives the generated JSObject map a constructor All JSObjects in V8 either have a map()->constructor() field or are JSFunctions. JSProxy::Fix, however, was not enforcing this, and Object.observe's use of JSObject::GetCreationContext() exposed this. Note that this is not Object.observe-specific: the API call v8::Object::CreationContext() also would have revealed this bug. This patch chooses Object as a reasonable constructor to put on the newly-fixed object's map. Note that this has no effect on the "constructor" property in JS. In doing so, I've also tightened up the code underlying JSProxy::Fix to only support JSObject and JSFunction as possible output types. BUG=405844 LOG=N R=rossberg@chromium.org, verwaest@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=23466

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -24 lines) Patch
M src/factory.h View 3 chunks +8 lines, -9 lines 1 comment Download
M src/factory.cc View 3 chunks +21 lines, -15 lines 1 comment Download
A test/mjsunit/harmony/regress/regress-405844.js View 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
adamk
adamk@chromium.org changed reviewers: + rossberg@chromium.org, verwaest@chromium.org
6 years, 3 months ago (2014-08-26 22:07:23 UTC) #1
adamk
6 years, 3 months ago (2014-08-26 22:07:23 UTC) #2
adamk
https://codereview.chromium.org/505303004/diff/1/src/factory.h File src/factory.h (right): https://codereview.chromium.org/505303004/diff/1/src/factory.h#newcode708 src/factory.h:708: void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); I made ...
6 years, 3 months ago (2014-08-26 22:10:54 UTC) #3
Toon Verwaest
lgtm, nice cleanup along the way. We should get rid of uses of GetCreationContext though. ...
6 years, 3 months ago (2014-08-27 09:54:35 UTC) #4
rossberg
LGTM too
6 years, 3 months ago (2014-08-27 11:15:29 UTC) #5
adamk
On 2014/08/27 at 09:54:35, verwaest wrote: > lgtm, nice cleanup along the way. > > ...
6 years, 3 months ago (2014-08-27 15:50:38 UTC) #6
adamk
6 years, 3 months ago (2014-08-27 15:54:38 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 manually as 23466.

Powered by Google App Engine
This is Rietveld 408576698