Closed Bug 1172943 Opened 9 years ago Closed 9 years ago

Use unboxed arrays for JSON and script literal arrays

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
It would be good to use unboxed arrays for JSON and script literal arrays (those in a JSOP_OBJECT). The attached patch makes this change, which is pretty straightforward. Copy on write arrays in a script are still always boxed.
Attachment #8617327 - Flags: review?(jdemooij)
Comment on attachment 8617327 [details] [diff] [review] patch Review of attachment 8617327 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsobj.cpp @@ -1965,5 @@ > template bool > js::XDRObjectLiteral(XDRState<XDR_DECODE>* xdr, MutableHandleObject obj); > > -JSObject* > -js::CloneObjectLiteral(JSContext* cx, HandleObject srcObj) Nice. ::: js/src/vm/NativeObject.h @@ +932,5 @@ > + const Value& v = elements_[start + i]; > + if (v.isObject() && IsInsideNursery(&v.toObject())) { > + JS::shadow::Runtime* shadowRuntime = shadowRuntimeFromMainThread(); > + shadowRuntime->gcStoreBufferPtr()->putSlotFromAnyThread(this, HeapSlot::Element, > + start, count); Hm you could narrow the range to start at |start + i|. Probably not worth it though. ::: js/src/vm/ObjectGroup.cpp @@ +733,3 @@ > {} > > + ArrayObjectKey(TypeSet::Type type) Should be |explicit| now. ::: js/src/vm/ObjectGroup.h @@ +593,5 @@ > + // have any element type. > + static JSObject* newArrayObject(ExclusiveContext* cx, const Value* vp, size_t length, > + NewObjectKind newKind, > + bool copyOnWrite = false, > + bool forRest = false); I think it'd be nice to use an enum instead of the 2 bools, as forRest and copyOnWrite can't be true at the same time (and then callers don't need the comments).
Attachment #8617327 - Flags: review?(jdemooij) → review+
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: