Last Comment Bug 771383 - IonMonkey: constant fold length/elements accesses on singleton typed arrays
: IonMonkey: constant fold length/elements accesses on singleton typed arrays
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: x86 Mac OS X
-- normal (vote)
: ---
Assigned To: general
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 771106
  Show dependency treegraph
Reported: 2012-07-05 16:50 PDT by Brian Hackett (:bhackett)
Modified: 2012-07-07 11:29 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (171cc91d4c18) (13.21 KB, patch)
2012-07-05 16:50 PDT, Brian Hackett (:bhackett)
dvander: review+
Details | Diff | Splinter Review

Description User image Brian Hackett (:bhackett) 2012-07-05 16:50:53 PDT
Created attachment 639517 [details] [diff] [review]
patch (171cc91d4c18)

Once created, typed array lengths and elements pointers are immutable.  Now that typed arrays can be singletons, these values can be baked in for accesses on these arrays.  This reduces register pressure / instruction counts for length accesses, makes a tiny difference for elements too (elements currently need to be in a register).  This also simplifies things for further optimizations towards bug 771106.
Comment 1 User image David Anderson [:dvander] 2012-07-05 20:11:31 PDT
Comment on attachment 639517 [details] [diff] [review]
patch (171cc91d4c18)

Review of attachment 639517 [details] [diff] [review]:

::: js/src/ion/shared/Lowering-shared.cpp
@@ +72,5 @@
>      return true;
>  }
>  bool
> +LIRGeneratorShared::visitConstantElements(MConstantElements *ins)

This should go in Lowering.cpp nowadays (the file name is confusing but shared is for utility functions).
Comment 2 User image Brian Hackett (:bhackett) 2012-07-07 11:29:49 PDT

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