- Adds a PairLocation type (Location is still a single word but now has two tags one for constants and one for pairs).
- New representations: kPairOfTagged & kPairOfUnboxedDouble.
- Register allocator uses second SSA index for Definitions that use two registers.
- Fix LiveRange shape for kWritableRegister inputs.
- Updated MergedMathInstr that returns a kPairOfTagged or kPairOfUnboxedDouble (depending on the merged math kind).
- A new instruction (ExtractNthOutput) for extracting a single register from an instruction that has a output register pair.
Open issues that need to be addressed in a follow up CL:
- Adjust PhiInstr and handling of PhiInstr in the register allocator to work with output pairs (once unboxed mints are in GPRs).
R=fschneider@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//215363004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34833 260f80e4-7a28-3924-810f-c04153c831b5
Added two new IL instructions: DoubleToFloat and FloatToDouble.
This enables store-to-load forwarding for Float32 arrays which was
not working before because of the implicit conversions.
Loads are now translated as:
v3 <- LoadIndexed(v2, v1)
v4 <- FloatToDouble(v3)
Stores:
v5 <- DoubleToFloat(v4)
StoreIndexed(v7, v6, v5)
There is no explicit representation for float values because
they are never used in a deoptimization environment. The only
real uses are at FloatToDouble and StoreIndexed.
For example when copying a value from one Float32 array to another
there is no intermediate conversions anymore
a[0] = b[0] before:
movss xmm1,[ebx+0x7]
cvtss2sd xmm1,xmm1
cvtsd2ss xmm2,xmm1
movss [edx+0x7],xmm2
after:
movss xmm1,[ebx+0x7]
movss [edx+0x7],xmm1
Also in this change:
Eliminate GuardField based on cid information of list factories.
GC unused symbols
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//172293004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32891 260f80e4-7a28-3924-810f-c04153c831b5
The motivation for the change is to make allocation sinking more
general when type arguments are in play. As a result I cleaned up the code
dealing with constructor type arguments as follows:
* Remove ExtractConstructorTypeArguments and ExtractConstructorInstantiator
from the intermediate language.
* The allocation stub takes now 1 argument (instead of 2) for parameterized
classes.
* The allocation stub always get an instantiated type arguments object
as input. It does not need to do a lookup in the instantiations array anymore.
* The code for looking up cached instantiated type arguments is moved
to the InstantiateTypeArguments instruction. This instruction is now also
used for object allocation. I'm not sure how relevant the cache lookup is
performance-wise. dart2js compilation did not show any regression without it.
R=regis@google.com
Review URL: https://codereview.chromium.org//163683006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32697 260f80e4-7a28-3924-810f-c04153c831b5
The call to the native List factory is lowered into IL instructions if
the length is known to be a valid smi.
This is mostly performance neutral. The acutal allocation now takes place
in the array allocation stub instead of the intrinsic code (and the runtime
List_allocate in case the fast case path fails).
This is a preparation for enabling allocation sinking for arrays and will
be extended to handle type list allocation as well. This way the allocation
site is explicitly represented as a CreateArrayInstr, instead of just being
a static call.
Another benefit is that this allows to simplify the special handling of
recognized factory calls in the optimizer once all array types are handled
this way.
R=johnmccutchan@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//138523004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32194 260f80e4-7a28-3924-810f-c04153c831b5
The bit has_finally was only used to skip the checking of the stack height
at return statements: There was an unused value floating on top of the
expression stack in unoptimized code if the finally block preceded a normal
return statement. Normallyi, that does not cause harm. Optimized code is not
affected since it has a fixed stack size for expression evaluation.
This CL fixes the stack height for functions with try-finally by introducing
a temporary local where the return value is saved before an inlined
finally-block.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//149603003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32157 260f80e4-7a28-3924-810f-c04153c831b5
When untagged values flow into a exception-throwing instruction
they need to be converted eagerly. Catch block entries assume all
values are tagged at the entry.
I changed the generation of moves at throwing
instructions in try-catch: Instead of manuallu emitting moves,
construct a parallel move and use the resolver to emit the native code.
This eliminates a lot of duplicated code from all platforms.
It will also allow to re-use stack space that is currently allocated
separately for each individual try-catch in a function.
I added a few more unrelated minor changes in various parts of the VM
* Simpilify guard code generation
* Resolve refactoring TODO in deoptimization
* Improve names
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//125103002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31536 260f80e4-7a28-3924-810f-c04153c831b5
This CL has no change in functionality and is purely clean up and
refactoring. Instead of manually generating the moves at throwing
instructions in try-catch, construct a parallel move and use the resolver
to emit the native code. This eliminates a lot of duplicated code
from all platforms.
It will also allow to re-use stack space that is currently allocated
separately for each individual try-catch in a function.
I added a few more unrelated minor changes in various parts of the VM
* Simpilify guard code generation
* Resolve refactoring TODO in deoptimization
* Improve names
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//119213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31326 260f80e4-7a28-3924-810f-c04153c831b5
This allows the optimizing compiler to generate unboxed loads/stores
to fields containing double values. The double value is stored
in a reusable double object.
Unboxed loads/stores are generated for optimized code. Unoptimized code
allocates a new double on loads. To avoid performance regressions
for fields that are only written few times (e.g. only in the constructor)
I put a heuristic in place that
compares the usage count of setters and getters. Unboxed operations
are only generated if the setter is invoked a significant amount of
times (threshold is 10% of getter invocations).
The CL is so big because it changes the way LocationSummmary
is allocated: We now have a bit to generate different summaries
for optimized and unoptimized code.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//99573005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31164 260f80e4-7a28-3924-810f-c04153c831b5