Closed
Bug 1100757
Opened 10 years ago
Closed 10 years ago
Avoid adding a shape guard on the proto in testCommonGetterSetter if the property is non-configurable
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
2.77 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
Right now testCommonGetterSetter adds a shape guard on foundProto. But if the property is non-configurable, we know the getter/setter can't change. So it seems like in that case we can omit the shape guard on the proto, no? Can we tell in this code that the prop is non-configurable? I mean, I guess we could stash that info in the baseline IC, but is there a better way?
Flags: needinfo?(jdemooij)
Comment 1•10 years ago
|
||
(In reply to Please do not ask for reviews for a bit [:bz] from comment #0) > Can we tell in this code that the prop is non-configurable? I mean, I guess > we could stash that info in the baseline IC, but is there a better way? I'm not sure why the shape guard is necessary, but if you're right you could do something like this: Shape *propShape = foundProto->lookupPure(name); if (propShape && !propShape->configurable()) { ... } IonBuilder always runs on the main thread so it won't race. We don't have access to a JSContext though, that's why we use the lookupPure method. It might bail if it sees resolve or lookups hooks though...
Flags: needinfo?(jdemooij)
Comment 2•10 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1) > It might bail if it sees resolve or lookups hooks though... To be clear, "bail" here just means return nullptr, but I looked at the definition and lookupPure calls Shape::searchNoHashify; it doesn't check for class hooks.
Comment 3•10 years ago
|
||
(In reply to Please do not ask for reviews for a bit [:bz] from comment #0) > But if the property is non-configurable, we know the getter/setter can't > change. So it seems like in that case we can omit the shape guard on the > proto, no? In a sane world, sure. In the broken SpiderMonkey world where the JSAPI does currently allow redefining non-configurable properties if you squint right, I am rather leery of doing this. :-\
Assignee | ||
Comment 4•10 years ago
|
||
> In the broken SpiderMonkey world where the JSAPI does currently allow redefining > non-configurable properties if you squint right Would you prefer it if I fixed that first? The one place I know of where Gecko depends on it is going away in bug 1012798, but that causes a slight slowdown due to this bug, which I'd rather like to fix.
Depends on: 1012798
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(jwalden+bmo)
Comment 5•10 years ago
|
||
Well, yes, I'd prefer it. But it is seriously non-trivial, efaust has been more or less working on that sort of thing for months now with JSPROP_IGNORE* bits and other nonsense. So I don't think you should be spending your time on it.
Flags: needinfo?(jwalden+bmo)
Assignee | ||
Comment 6•10 years ago
|
||
OK. Filed bug 1101123 on fixing the JSAPI bit here.
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8525743 -
Flags: review?(efaustbmo)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8529317 -
Flags: review?(efaustbmo)
Assignee | ||
Updated•10 years ago
|
Attachment #8525743 -
Attachment is obsolete: true
Attachment #8525743 -
Flags: review?(efaustbmo)
Comment 9•10 years ago
|
||
Comment on attachment 8529317 [details] [diff] [review] Merged to tip Review of attachment 8529317 [details] [diff] [review]: ----------------------------------------------------------------- With the JSPROP flag I just reviewed, this can now go in.
Attachment #8529317 -
Flags: review?(efaustbmo) → review+
Assignee | ||
Comment 10•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4247f2646a63
Comment 11•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4247f2646a63
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•