Closed
Bug 1103152
Opened 10 years ago
Closed 10 years ago
Remove some JSClass stub functions
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: jorendorff, Assigned: jorendorff)
Details
Attachments
(2 files)
|
165.33 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
|
3.35 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
I want to make all JSClass function pointer members nullable. This is the first step. I'll make these nullable:
addProperty
delProperty
enumerate
resolve
convert
and I'll remove the corresponding stub functions JS_DeletePropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub. (addProperty uses JS_PropertyStub which can't be removed yet.)
After this, only getProperty and setProperty will remain.
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8527106 -
Flags: review?(jwalden+bmo)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•10 years ago
|
||
| Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8527106 [details] [diff] [review]
Remove JS_DeletePropertyStub, JS_EnumerateStub, JS_ResolveStub, and JS_ConvertStub. Make five mandatory JSClass hooks optional (nullable)
Review of attachment 8527106 [details] [diff] [review]:
-----------------------------------------------------------------
Shifting review. I really want to land this and the patches in bug 1103368 as soon as I can. They're going to bitrot like crazy.
Attachment #8527106 -
Flags: review?(jwalden+bmo) → review?(bhackett1024)
Comment 4•10 years ago
|
||
Comment on attachment 8527106 [details] [diff] [review]
Remove JS_DeletePropertyStub, JS_EnumerateStub, JS_ResolveStub, and JS_ConvertStub. Make five mandatory JSClass hooks optional (nullable)
Review of attachment 8527106 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!!!!
::: js/src/jsapi.cpp
@@ +2143,5 @@
> return true;
> }
>
> JS_PUBLIC_API(bool)
> +JS::OrdinaryToPrimitive(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp)
OrdinaryConvert, or OrdinaryDefaultValue?
Attachment #8527106 -
Flags: review?(bhackett1024) → review+
Comment 5•10 years ago
|
||
(In reply to Brian Hackett (:bhackett) from comment #4)
> OrdinaryConvert, or OrdinaryDefaultValue?
The algorithm in the spec is named OrdinaryToPrimitive:
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive (scroll down a little there)
Beyond that, this entire mechanism is going to more or less go away when we implement conversion-to-primitive using a @@toPrimitive symbol, so it's not worth polishing things (like renaming the field from convert to toPrimitive or similar).
| Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Brian Hackett (:bhackett) from comment #4)
> > +JS::OrdinaryToPrimitive(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp)
>
> OrdinaryConvert, or OrdinaryDefaultValue?
Waldo's right, the name just follows the spec.
I admit, I did think "this name sucks" as I typed it in.
Added a comment to help explain:
/*
* Implements ES6 draft rev 28 (2014 Oct 14) 7.1.1, second algorithm.
*
* Most users should not call this -- use JS::ToNumber, ToBoolean, or ToString
* instead. This should only be called from custom convert hooks. It implements
* the default conversion behavior shared by most objects in JS, so it's useful
* as a fallback.
*/
extern JS_PUBLIC_API(bool)
OrdinaryToPrimitive(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp);
| Assignee | ||
Comment 7•10 years ago
|
||
| Assignee | ||
Comment 9•10 years ago
|
||
| Assignee | ||
Comment 10•10 years ago
|
||
14:20:40 INFO - {standard input}: Assembler messages:
14:20:40 INFO - {standard input}:49744: Error: can't resolve `_ZN2js16TypedArrayObject7classesE' {*UND* section} - `.LPIC442' {*UND* section}
14:20:40 ERROR - make[6]: *** [Unified_cpp_js_src8.o] Error 1
14:20:40 INFO - make[6]: *** Waiting for unfinished jobs....
**Assembler**?!
No clue what's going on here.
| Assignee | ||
Comment 11•10 years ago
|
||
| Assignee | ||
Comment 12•10 years ago
|
||
| Assignee | ||
Comment 13•10 years ago
|
||
| Assignee | ||
Comment 14•10 years ago
|
||
| Assignee | ||
Comment 15•10 years ago
|
||
| Assignee | ||
Comment 16•10 years ago
|
||
| Assignee | ||
Comment 17•10 years ago
|
||
| Assignee | ||
Comment 18•10 years ago
|
||
| Assignee | ||
Comment 19•10 years ago
|
||
Try-bisecting continues apace. The good news is, it looks like 3 of the 5 hooks can be nulled out without angering the fickle Ice Cream Sandwich gods. I'm guessing 4 would be fine. Still no idea what's really causing this.
| Assignee | ||
Comment 20•10 years ago
|
||
| Assignee | ||
Comment 21•10 years ago
|
||
| Assignee | ||
Comment 22•10 years ago
|
||
| Assignee | ||
Comment 23•10 years ago
|
||
| Assignee | ||
Comment 24•10 years ago
|
||
| Assignee | ||
Comment 25•10 years ago
|
||
| Assignee | ||
Comment 26•10 years ago
|
||
| Assignee | ||
Comment 27•10 years ago
|
||
| Assignee | ||
Comment 28•10 years ago
|
||
Re: comment 27, I gave up and #ifdef'd some code just for GCC 4.4.
If that works, let's land it and move on...
| Assignee | ||
Comment 29•10 years ago
|
||
Attachment #8531447 -
Flags: review?(bhackett1024)
Updated•10 years ago
|
Attachment #8531447 -
Flags: review?(bhackett1024) → review+
| Assignee | ||
Comment 30•10 years ago
|
||
| Assignee | ||
Comment 31•10 years ago
|
||
| Assignee | ||
Comment 32•10 years ago
|
||
| Assignee | ||
Comment 33•10 years ago
|
||
Comment 34•10 years ago
|
||
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
•