The default bug view has changed. See this FAQ.

IonMonkey: Inline string[int32]

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 631968 [details] [diff] [review]
Patch

Pretty easy with MCharCodeAt/MFromCharCode. Sunspider base64 and I think unpack-code do this and it's pretty common on the web.
Attachment #631968 - Flags: review?(dvander)
Comment on attachment 631968 [details] [diff] [review]
Patch

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

::: js/src/ion/TypeOracle.cpp
@@ +319,5 @@
> +
> +    if (value->getKnownTypeTag(cx) != JSVAL_TYPE_STRING)
> +        return false;
> +
> +    if (id->getKnownTypeTag(cx) != JSVAL_TYPE_INT32)

Out of curiosity, do calls like this add constraints even though we don't need them in the false case?
Attachment #631968 - Flags: review?(dvander) → review+
(Assignee)

Comment 2

5 years ago
http://hg.mozilla.org/projects/ionmonkey/rev/17e811e71344

(In reply to David Anderson [:dvander] from comment #1)
> > +
> > +    if (id->getKnownTypeTag(cx) != JSVAL_TYPE_INT32)
> 
> Out of curiosity, do calls like this add constraints even though we don't
> need them in the false case?

Yeah if the type set is empty or has a single type. Brian would it make sense to add a function like this:

if (!id->hasKnownTypeTag(cx, JSVAL_TYPE_INT32))
    return false;

Where hasKnownTypeTag only adds a constraint if either 1) the type tag matches the argument or 2) the type set is empty (to enable this optimization later).
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.