Last Comment Bug 763599 - IonMonkey: Inline string[int32]
: IonMonkey: Inline string[int32]
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
:
:
Mentors:
Depends on:
Blocks: IonSpeed
  Show dependency treegraph
 
Reported: 2012-06-11 11:44 PDT by Jan de Mooij [:jandem]
Modified: 2012-06-13 02:09 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (9.97 KB, patch)
2012-06-11 11:44 PDT, Jan de Mooij [:jandem]
dvander: review+
Details | Diff | Splinter Review

Description Jan de Mooij [:jandem] 2012-06-11 11:44:33 PDT
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.
Comment 1 David Anderson [:dvander] 2012-06-12 14:29:08 PDT
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?
Comment 2 Jan de Mooij [:jandem] 2012-06-13 02:09:20 PDT
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).

Note You need to log in before you can comment on or make changes to this bug.