- 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
Loads/stores with non-escaping arrays can be disambiguated from loads/store
with unknown identity.
This enables better load elimination for non-escaping arrays.
For example in the following code:
test() {
var a = new List(1);
var b = new List(1);
a[0] = 42;
b[0] = 43;
return a[0] + b[0];
}
we can now eliminate both loads a[0] and b[0] where before all stores to [0] were
considered to interfere with each other..
R=srdjan@google.com
Review URL: https://codereview.chromium.org//189543013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33523 260f80e4-7a28-3924-810f-c04153c831b5
This is needed for generalizing allocation sinking to
work with instance fields and plain field offsets.
MaterializeObject now works with a set of Field/Smi objects
Right now this should be performance-neutral, but it already
simplifies the code be removing the fake fields previously used
for type arguments, closure function/context.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//189513003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33478 260f80e4-7a28-3924-810f-c04153c831b5
The optimizing compiler can replace a type test with a cid-comparison
under certain conditions. This CL translates the instance-of call
into a inline comparison in the optimizer and not - as previously -
in the code generator. This results in better generated code for
like
if (x is y) {...}
when y does not have sub-classes and does not have type arguments.
R=regis@google.com
Review URL: https://codereview.chromium.org//178193020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33231 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
This change rewrites the code from the ARM assembler for parsing /proc/cpuinfo on Linux and Android, and collects it into a CpuInfo class that can be used for other architectures as well. This code is in cpuinfo_*.cc. /proc/cpuinfo equivalents are used for Mac and Windows. CpuInfo is used by the VM service to report on the hardware dart is running on. In the future CpuInfo can also be used here to provide more information.
R=iposva@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org//120723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32468 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 optimizer can now track side effects to array locations
at a constant index when eliminating array loads. Stores to
arrays with a constant index affect loads from arrays
at the same constant index _and_ loads from an unknown (non-constant)
index. Stores to an array with an unknown index affect all array loads.
For instance code like
var a = new List(2);
a[0] = 123;
a[1] = 456;
print(a[0] + a[1]);
we can now eliminate both loads from a[0] and a[1], where before
only the loads from a[1] was eliminated.
I changed the internal encoding of Alias to use BitField instead of
plain integers. This makes it a little easire to extend.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//145133009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32014 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