Closed
Bug 725595
Opened 14 years ago
Closed 14 years ago
Drop native object checks from JS_(Get|Set)ReservedSlot
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: igor, Assigned: igor)
References
Details
Attachments
(1 file, 1 obsolete file)
|
5.14 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #724310 comment 3 +++
I suppose for historical reasons we allow JS_SetReservedSlot and JS_GetReservedSlot to take a non-native object and do nothing in that case. We should replace those checks with asserts. Also JS_SetReservedSlot calls GCPoke presumably to help the shutdown GC to collect more garbage. I suspect that with cycle collector that is not necessary for quite some time and we can drop that.
| Assignee | ||
Comment 1•14 years ago
|
||
We do not need those native/non-native asserts. The checks in JSObject::(get|set)ReservedSlot should be sufficient to call the API.
Summary: Require that JS_(Get|Set)ReservedSlot is only used with native objects → Drop native object checks from JS_(Get|Set)ReservedSlot
| Assignee | ||
Comment 2•14 years ago
|
||
The patch makes JS_(Get|Set)ReservedSlot a public API around JSObject::(get|set)ReservedSlot. That allowed to remove inlined SetReservedSlot from jsfriendsapi.h. However I have to keep GetReservedSlot as its use is widespread and its removal may have bad performance implications.
Assignee: general → igor
Attachment #596507 -
Flags: review?(jwalden+bmo)
Comment 3•14 years ago
|
||
Actually, we were using js::SetReservedSlot in the new-binding code. It can get pretty hot during prototype object creation and worse yet object wrapping...
Is there actually a reason to remove it?
| Assignee | ||
Comment 4•14 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #3)
> Actually, we were using js::SetReservedSlot in the new-binding code. It can
> get pretty hot during prototype object creation and worse yet object
> wrapping...
>
> Is there actually a reason to remove it?
The reason is to minimize exposure of JS internals. But if this a hot issue, then surely we can keep it.
| Assignee | ||
Comment 5•14 years ago
|
||
The new patch keeps js::SetReservedSlot and its callers outside js engine as is.
Attachment #596507 -
Attachment is obsolete: true
Attachment #596507 -
Flags: review?(jwalden+bmo)
Attachment #596944 -
Flags: review?(jwalden+bmo)
Updated•14 years ago
|
Attachment #596944 -
Flags: review?(jwalden+bmo) → review+
| Assignee | ||
Comment 6•14 years ago
|
||
Comment 7•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Updated•5 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•