Closed
Bug 579158
Opened 15 years ago
Closed 15 years ago
js_XDRAtom creates unnecessary JSString during decoding
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: luke, Assigned: luke)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
|
5.44 KB,
patch
|
Details | Diff | Splinter Review |
bug 579140 comment 8 points out that js_XDRAtom creates an unnecessary JSString for already-atomized strings. Since atoms may only be strings, it seems the fix is just to fold js_XDRStringAtom into js_XDRAtom.
Attachment #457663 -
Flags: review?(igor)
| Assignee | ||
Comment 1•15 years ago
|
||
Oops, wrong dependency.
Comment 2•15 years ago
|
||
Comment on attachment 457663 [details] [diff] [review]
fix
When you are fixing this it would be nice to rename those jsval_ tags into xdr_ ones to avoid any confusion with jsval internals.
Attachment #457663 -
Flags: review?(igor) → review+
| Assignee | ||
Comment 3•15 years ago
|
||
Oops, I forgot to address your other requests.
| Assignee | ||
Comment 4•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 5•15 years ago
|
||
Comment on attachment 457726 [details] [diff] [review]
fix with nits
>-enum jsvaltag {
>+enum XDRValueTag {
> JSVAL_OBJECT = 0x0,
> JSVAL_INT = 0x1,
> JSVAL_DOUBLE = 0x2,
> JSVAL_STRING = 0x4,
> JSVAL_SPECIAL = 0x6,
> JSVAL_XDRNULL = 0x8,
> JSVAL_XDRVOID = 0xA
> };
I should have been more clear in comments and stated that the nit was not only about the enum type name but also about constants names. They should be renamed to XDRTAG_OBJECT etc to avoid any resemblance to JSVAL internals and their indexes can be simply 0,1,2 etc. Note that the latter change at this point would need a bumping ox xdr version.
| Assignee | ||
Comment 6•15 years ago
|
||
Of course, d'oh! Will fix.
| Assignee | ||
Updated•15 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•