Closed
Bug 572820
Opened 14 years ago
Closed 14 years ago
TM: de-slot-ify proto
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Assigned: gal)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
16.97 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Its always an object, so we can as well call it by its name.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee: general → gal
Assignee | ||
Updated•14 years ago
|
Attachment #452028 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•14 years ago
|
||
Attachment #452028 -
Attachment is obsolete: true
Attachment #452028 -
Flags: review?(jorendorff)
Assignee | ||
Updated•14 years ago
|
Attachment #452042 -
Flags: review?(jorendorff)
Comment 3•14 years ago
|
||
Comment on attachment 452042 [details] [diff] [review] parent >+LIns* >+TraceRecorder::stobj_get_proto(nanojit::LIns* obj_ins) >+{ >+ /* proto is quasi-const, we never change it on trace */ >+ return lir->insLoad(LIR_ldp, obj_ins, offsetof(JSObject, proto), ACC_READONLY); >+} I think a call to JS_SetPrototype would change proto without bumping us off trace. This change is probably safe, but for precarious reasons. I'd feel a lot more comfortable using alias analysis to pick up this kind of win, or at the least doing this part in a separate patch from the low-risk cleanup here. r=me except for the ACC_READONLY. Awesome patch.
Attachment #452042 -
Flags: review?(jorendorff) → review+
Comment 4•14 years ago
|
||
Write a testcase that assigns to o.__proto__? Separate bug on making JSSLOT_PARENT opt-in by JSCLASS_HAS_PARENT on file yet? /be
Comment 5•14 years ago
|
||
Comment on attachment 452042 [details] [diff] [review] parent >diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp >+/* >+ * Set object's prototype slot while checking that doing so would not create >+ * a cycle in the proto chain. The cycle check and proto change are done >+ * only when all other requests are finished or suspended to ensure exclusive >+ * access to the chain. If there is a cycle, return false without reporting >+ * an error. Otherwise, set the proto or parent and return true. >+ */ Nit: remove the comment about parent.
Comment 6•14 years ago
|
||
Comment on attachment 452042 [details] [diff] [review] parent >+namespace js { >+ >+bool >+SetProto(JSContext *cx, JSObject *obj, JSObject *proto, bool checkForCycles) ... >+ } else if (!js::SetProtoCheckingForCycles(cx, obj, proto)) { >+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, Nit: no need for js:: here
Assignee | ||
Comment 7•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/8eec1f4b6b8a
Whiteboard: fixed-in-tracemonkey
Comment 8•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/8eec1f4b6b8a
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•