Closed
Bug 739572
Opened 13 years ago
Closed 12 years ago
IonMonkey: Inline Array.prototype.{push,pop,shift,concat}
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
Kraken's crypto tests use array.push and array.concat a lot. JM+TI inlines these functions, and also inlines array.pop and array.shift. IM should do the same.
Assignee | ||
Comment 1•13 years ago
|
||
This is a small v8-deltablue win. I can land the jsarray* changes on m-c first.
Attachment #610058 -
Flags: review?(dvander)
Assignee | ||
Comment 2•13 years ago
|
||
The stub calls js::array_push directly now. I think I will change part 1 to do the same to avoid the jsarray* changes/complexity.
I will add array.concat once we have inline object allocation.
Attachment #610129 -
Flags: review?(dvander)
Comment on attachment 610058 [details] [diff] [review]
Part 1: Inline pop and shift
Review of attachment 610058 [details] [diff] [review]:
-----------------------------------------------------------------
Nice.
::: js/src/ion/VMFunctions.cpp
@@ +238,5 @@
>
> +static inline void
> +SetReturnOverrideIfInvalidated(JSContext *cx, const Value &rval)
> +{
> + if (!GetTopIonJSScript(cx)->ion)
This isn't quite enough, I think, because ->ion could be ION_DISABLED_SCRIPT or (maybe worse). You need to cache the original IonScript. Maybe we should have an AutoDetectInvalidation.
Attachment #610058 -
Flags: review?(dvander) → review+
Updated•13 years ago
|
Attachment #610129 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Avoids most of the jsarray.* changes and I added the AutoDetectInvalidation class you suggested.
Attachment #610058 -
Attachment is obsolete: true
Attachment #611511 -
Flags: review?(dvander)
Comment on attachment 611511 [details] [diff] [review]
Part 1: Inline pop and shift - v2
Review of attachment 611511 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/ion/VMFunctions.cpp
@@ +252,5 @@
> + // If the result is |undefined|, the array was probably empty and we
> + // have to monitor the return value.
> + *rval = argv[0];
> + if (rval->isUndefined()) {
> + AutoDetectInvalidation adi(cx, rval);
I think it's better to move these AutoDetectInvalidation calls to the very top, since a slight breeze can invalidate script->ion, it's safer to grab it ASAP.
Attachment #611511 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 6•13 years ago
|
||
https://hg.mozilla.org/projects/ionmonkey/rev/cdc5f3570a4c
https://hg.mozilla.org/projects/ionmonkey/rev/7b2c14a9fde2
Keeping this bug open for array.concat.
Marking FIXED, we can file a follow-up for array.concat.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•