BaselineCompiler: Add optimized stub for JSOP_[GET|CALL]PROP on strings.

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: djvj, Assigned: djvj)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
This is getting hit heavily by both string-fasta, and crypto-sha1 in sunspider.
(Assignee)

Updated

5 years ago
Summary: BaselineCompiler: Add optimized stub for CALLPROP(stringObj, methodName) → BaselineCompiler: Add optimized stub for JSOP_[GET|CALL]PROP on strings.
(Assignee)

Updated

5 years ago
Assignee: general → kvijayan
(Assignee)

Comment 1

5 years ago
Created attachment 711144 [details] [diff] [review]
Patch.

Optimizes GETPROPS and CALLPROPS on strings where the property is directly on |String.prototype|.  Cribbed from JM's string getprop IC code.

However, this code uses |nativeLookup| instead of |lookupProperty| since we don't really care to search the proto chain.

Shaves about 25ms (5%) off of SS running BL+Ion.
Attachment #711144 - Flags: review?(bhackett1024)
Comment on attachment 711144 [details] [diff] [review]
Patch.

Review of attachment 711144 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/ion/BaselineIC.cpp
@@ +2519,5 @@
> +
> +    bool isFixedSlot = stringProto->isFixedSlot(shape->slot());
> +    uint32_t offset = isFixedSlot
> +                      ? JSObject::getFixedSlotOffset(shape->slot())
> +                      : stringProto->dynamicSlotIndex(shape->slot()) * sizeof(Value);

This logic already appears twice in BaselineIC.cpp, can you common it into some ComputeShapeOffset(shape, bool*, uint32_t*) or similar?
Attachment #711144 - Flags: review?(bhackett1024) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/projects/ionmonkey/rev/f27c9d8772ce
(Assignee)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.