Commit Graph

434 Commits

Author SHA1 Message Date
fschneider@google.com b3098a263b Fix polymorphic inlining of method dispatchers.
Field dispatchers and noSuchMethod dispatchers are generated by the VM
compiler and should always be inlined - this CL fixes the case of polymorphic
inlining where dipatchers were not inlined in the same way as for monomorphic
calls sites.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//235013002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35490 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-28 18:01:57 +00:00
regis@google.com e0ab99b0b2 Remember all deopt reasons in ic_data, not just the last one.
Remember if a JS warning was issued in ic_data.
Save a word in ic_data on 64-bit platforms.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//254723003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35457 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:45:14 +00:00
srdjan@google.com 0c2b0af123 Copy of Issue 231383002 after hard disk crash: First step in improving instance of test for a fixed set of value cids returning different results.
Review URL: https://codereview.chromium.org//258563004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35455 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:21:12 +00:00
turnidge@google.com 18a8d7fe4c Fixes bug where we would occasionally materialize a corrupted object.
On the slow path for a stack overflow check we manually spill the live
registers before our call to the runtime function.  We were updating
all uses of these spilled registers in the Environment object but this
was not enough - we also need to update any uses of these spilled
registers in MaterializeObjectInstrs which are hanging off of the
Environment.

This would fail when a deoptimization was triggered during a stack
overflow check and a materialized object happened to refer to
registers.

I've been chasing this for a while and I was able to get it to
reliably reproduce by using the --stacktrace_every=N and the
--stacktrace_filter flags, which were added for this purpose.

ALSO:

Set the top context to null on exceptions/errors.  This is needed for
the --verify-incoming-context flag.

Minor printing improvements.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//246303004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35443 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 20:24:27 +00:00
regis@google.com 98bcbb0dae Do not ignore side effects of a type test or type cast as expression, such
as bound errors in checked mode.
Added tests.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//246293008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35284 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-22 20:48:13 +00:00
fschneider@google.com 79a5307d5b VM: Implement closure calls as instance calls.
Conceptually f() becomes f.call() where the .call method performs the actual
closure call. The closure call itself is implemented without a stub.

The check if the object called is a closure becomes a class-id check
which can be hoisted out of loops.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//227723002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34917 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 10:56:00 +00:00
johnmccutchan@google.com 3834c9a869 Support for multiple register values
- 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
2014-04-08 16:13:43 +00:00
srdjan@google.com ec6a6d8837 Incremental tuning/cleanup of inlining: --print-inline-tree changed to --print-inlining-tree; print also methods that were not inlined.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//211873003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34451 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 21:24:35 +00:00
johnmccutchan@google.com e255df56ed Refactor to support multiple outputs in location summary
R=srdjan@google.com

Review URL: https://codereview.chromium.org//207063002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34250 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 14:40:30 +00:00
fschneider@google.com 4087d69662 VM: Fix infinite recursion in optimization of of string interpolation.
Don't compile-time fold string interpolation when compiling
the interpolation function itself. This would otherwise case
an infiniti recursion.

Also check he result of calling the interpolation function before
casting to a String.

BUG=dartbug.com/17461
R=iposva@google.com

Review URL: https://codereview.chromium.org//196353012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33651 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 14:28:07 +00:00
fschneider@google.com 9780267a08 Generate smaller unoptimized code for certain expressions.
Code for compound assignments, pre- and post-fix ++, --, cascades in
effect contexts is now smaller by 1 push/pop instructions.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//197283004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33641 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 09:07:40 +00:00
johnmccutchan@google.com 801c26beb4 Unboxed Float64x2 fields and some misc fixes
R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//195333002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33542 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 17:59:45 +00:00
fschneider@google.com 53abcebbf9 VM: Replace StoreVMField with StoreInstanceField.
This simplifies a lot of code in the optimizer and avoids the confusion
and errors due to mismatch input operands when using StoreVMField.

I added a separate constructor for LoadFieldInstr to avoid having
to explicily set the associated field there.

R=regis@google.com

Review URL: https://codereview.chromium.org//179443004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33059 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-26 12:12:40 +00:00
zra@google.com fd366da1cf Updates refactoring of CPU feature detection
with fix that uses cpuid for Intel/Linux.

R=asiva@google.com

Review URL: https://codereview.chromium.org//136303012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32980 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 19:28:30 +00:00
fschneider@google.com 974fdb6a9a Explicit conversions for Float32 array loads/stores.
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
2014-02-21 12:12:29 +00:00
johnmccutchan@google.com ed5894d0cf Unbox/Box Float64x2 and inline typed array loads and stores
R=fschneider@google.com

Review URL: https://codereview.chromium.org//172653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32869 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 20:41:54 +00:00
fschneider@google.com 13f2d115ef Simplify generated code for object allocation with type arguments.
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
2014-02-14 13:03:35 +00:00
zra@google.com 3693beeb6b Reverts refactoring of CPU feature detection for
assertion failure in Dartium.

R=asiva@google.com

Review URL: https://codereview.chromium.org//142663004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32560 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 16:05:43 +00:00
zra@google.com 6f2096face Refactors some CPU feature detection into new class CpuInfo, and uses new information in VM service.
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
2014-02-08 22:27:27 +00:00
srdjan@google.com 2c37517875 Disable hoisting CheckClass due to excessive deoptimization (issue 16285). Detect that a deoptimization was caused by hoisted check class instruction and disable hoisting of CheckClassInstr for that function. This is a short-term solution to fix excessive deoptimization causing slow start-ups.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//157833004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32460 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 00:02:22 +00:00
johnmccutchan@google.com e1ba48aea0 Extend StoreInstanceFieldInstr and LoadFieldInstr to support reusable Float32x4 boxes on IA32, X64, and ARM.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//150063004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32429 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 15:30:25 +00:00
srdjan@google.com ad4c354bfe Improve inlining decision: --inline_getters_setters_smaller_than (default 10). Don not inline getters that are too large.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//133073019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32384 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 21:21:31 +00:00
srdjan@google.com b390334f6c Fix bot breakage: math unary instruction has side effects (throws exception if argument is not a number) and therefore cannot be eliminated if there are no uses.
Review URL: https://codereview.chromium.org//156973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32382 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 20:55:16 +00:00
srdjan@google.com 3c36c374e9 Fix issue 16592: Do not attempt to merge operations that do not have uses, otherwise we add force uses to them (temporary array to hold two results) and the graph verification fails(no SSA temp but has uses).
R=iposva@google.com

Review URL: https://codereview.chromium.org//135553005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32381 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 19:55:53 +00:00
johnmccutchan@google.com 15090664ba Refactor unboxed fields code in preparation of reusable SIMD boxes.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//136753012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32199 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-31 16:45:23 +00:00
fschneider@google.com bb4869e3bb Inline recognized List factory in the flow graph optimizer.
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
2014-01-31 13:26:48 +00:00
hausner@google.com 0c434b3073 Rename kDummyTokenIndex to kNoSourcePos
Addresses comment to previous change list.

R=regis@google.com

Review URL: https://codereview.chromium.org//144343002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31969 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-21 23:46:26 +00:00
srdjan@google.com 7629f40adb Be more aggressive when inlining getters and setters (we assume they are typically simple, efficient functions). +15% on Box2D.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//143643002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31961 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-21 17:44:29 +00:00
fschneider@google.com 893b25e5b4 Revert r31601 (Use constants from the frame at OSR entry...).
Because this CL also changed the way spill slots are allocated for
catch entry blocks it caused invalid code for optimized try-catch
under certain conditions.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//141163009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31948 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-20 10:43:41 +00:00
lrn@google.com 3b3e87cabc Revert "Rename internal library dart:_collection-dev to dart:_internal."
Dartium needs updating too.

Committed: https://code.google.com/p/dart/source/detail?r=31827

R=floitsch@google.com

Review URL: https://codereview.chromium.org//133273011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31877 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 12:06:38 +00:00
lrn@google.com ead87f47e9 Revert "Rename internal library dart:_collection-dev to dart:_internal."
Dartium needs updating too.

Review URL: https://codereview.chromium.org//133273011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31827 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 12:27:44 +00:00
lrn@google.com 0098710559 Rename internal library dart:_collection-dev to dart:_internal.
BUG= http://dartbug.com/14140
R=floitsch@google.com

Review URL: https://codereview.chromium.org//133893007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31823 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 09:24:46 +00:00
fschneider@google.com c414fbf2ca Use constants from the frame at OSR entry.
The code for reserving stack slots for OSR entry values is shared with the
code for reserving stack slots for try/catch. It does not handle them
optimally (reserving slots above the desired ones and copying them down,
instead of directly reserving the desired one). This CL simplifies allocation
of spill slots for try-catch as well.

This is an rebased version of Kevin's original CL
(https://codereview.chromium.org/102173003/).
I removed an invalid assertion and removed more code that became unnecessary
with this change.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//125943002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31601 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-08 11:27:10 +00:00
hausner@google.com 363105d880 Add debugger steps in local variable assignments
This allows the debugger to single step and break on local
variable assignments in unoptimized code. Checks are only added if
the right hand side of the assignment has no safepoints where
the debugger would stop anyway.

Interestingly, generated code size is only 0.1% bigger, so the
cost is negligible.

Addresses issue 10403.

R=iposva@google.com

Review URL: https://codereview.chromium.org//125033007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31575 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-07 21:10:47 +00:00
srdjan@google.com 833c25e0f9 Compute range for Smi multiplication. Especially useful when working on canvas (Uint8ClampedList).
R=fschneider@google.com

Review URL: https://codereview.chromium.org//122573002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31504 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-06 21:22:14 +00:00
hausner@google.com c571528323 Make return statements single steppable
Replace the code smashing breakpoints at function returns with a call
to a runtime stub that checks whether the debugger is single stepping.
The call to the stub is only emitted in unoptimized code.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//106053011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31435 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-02 23:31:52 +00:00
fschneider@google.com 6abd6e326e Add mutable double boxes for fields.
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
2013-12-16 15:11:31 +00:00
srdjan@google.com a8f549dbc3 Merge sin(a), cos(a) into one instruction. On IA32 use x87 fsincos operation, on x64 call runtime routine whihc merges sin/cos intos sincos.
TODO: Implement for ARM and MIPS.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//92433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30827 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-03 22:00:27 +00:00
srdjan@google.com cf53988cf6 Use range information to omit checks in TRUNCDIV/MOD operations.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//81623003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30673 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-26 18:18:24 +00:00
fschneider@google.com 8b0b3fde4d Generalize if-conversion to arbitrary smi comparisons.
Until now only == and != comparisons were supported.

Further changes are:
 Remove flag FLAG_new_identity_spec: It is not needed anymore.
 Invoke Canonicalize another time before branch optimizations.
 Fixes support for TestSmiInstr with the branch-simplifier pass.

R=kmillikin@google.com

Review URL: https://codereview.chromium.org//78733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30622 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 12:57:21 +00:00
zra@google.com daf539e2f9 Fixes a couple problems with GC of unoptimized code.
1. Instead of making a pass before the Marking phase,
   this change does not visit code pointers in functions
   during marking. Then after marking, if the code has
   still not been marked, code pointers in functions
   are nulled out.
2. Since code pointers in functions may be nulled out,
   functions are no longer used as proxies for code in
   deoptimization info.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//70183010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30600 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-23 00:17:28 +00:00
srdjan@google.com 3165e204e3 Merge TRUNCDIV and MOD into one instruction. Icorporated feedback from CL https://codereview.chromium.org/68663003
R=fschneider@google.com

Review URL: https://codereview.chromium.org//79653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30536 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 17:56:54 +00:00
fschneider@google.com 05b8012333 Remove dead code from IfThenElse and StrictCompare in the compiler.
The code for these cases is either completely unused or can only be hit with
canonicalization and constant propagation turned off. Since this is not tested,
and does not bring any performance benefit for the default configuration it is
best to just remove it.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//62203018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30393 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 10:38:37 +00:00
regis@google.com db2cec593d Distinguish between malformed and malbounded types more efficiently using the
recently introduced LanguageError 'kind' field.

R=hausner@google.com

Review URL: https://codereview.chromium.org//75713002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30383 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-18 23:31:12 +00:00
fschneider@google.com b15bd6fe04 Cleanup of branch code generation (no change in functionality).
This CL is the first step in refactoring the way branches and comparisons
are generated.

1. Move helper functions from flow_graph_compiler_xyz.cc to
intermediate_language_xyz.cc.

2. Remove IL class ControlInstruction. It was only implemented by BranchInstr.
All functions provided are moved to BranchInstr.

3. When generating branch code for comparisons, pass the successor labels explicitly
instead of getting them from the branch. This will allow us to provide different labels
when materialize a bool value of a comparison.

4. Move some common code for IfThenElseInstr from the platform-specific files
into intermediate_language.cc and simplify it.

The goal is to enable if-conversion of arbitrary comparisons. Right now,
the code for == is hard-coded in IfThenElseInstr (and duplicated, too). This
means that e.g. "a < b ? 0 : 1" cannot be optimized.

As a result, IfThenElseInstr can be used to materialize the boolean  value of
a comparison. This way the complication of having ComparisonInstr both as a
normal instruction and as wrapped inside a BranchInstr can be simplified.
Comparisons would no longer appear as plain instructions in the IL, but only
wrapped inside either a Branch or an IfThenElse(true, false).

R=zra@google.com

Review URL: https://codereview.chromium.org//62133002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30042 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-07 11:47:04 +00:00
fschneider@google.com aa789a7b27 Merge (x & y) == 0 pattern to emit a single test instruction.
This is based on a previous uncommitted CL by vegorov@
(https://codereview.chromium.org/14251023/).

It is rebased and fixes a bug in the MIPS implementation: BranchOnCondition
requires the comparison result in fixed registers CMPRES1/CMPRES2.

Remove register alias TMP1 (=TMP) and CMPRES (=CMPRES1). It is confusing to
have them around and easy to forget that they are actually the same.

R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//59613005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29966 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 12:13:29 +00:00
fschneider@google.com fef2c347db Reland bug fix from r29800 for merging into branch.
TBR=

Review URL: https://codereview.chromium.org//59633002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29887 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 10:46:39 +00:00
fschneider@google.com 9dc8bb0a01 Revert a bug fix included in r29800 to re-land it for merging.
Review URL: https://codereview.chromium.org//59623002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29886 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 10:43:55 +00:00
johnmccutchan@google.com 29c01044bc This is the final breaking change in dart:typed_data needed for Dart 1.0. We need this change because the ECMAScript SIMD specification only includes Int32x4 and Int32x4List and our types must match.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//56023004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29849 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 21:56:59 +00:00
fschneider@google.com 9031c80c88 Change == into an instance call to allow polymorphic inlining of ==.
In unoptimized code equality is now just another instance call.

The optimizer replaces it with a specialized implementation based on static
 type information and type feedback.

Many of the manual optimizations of == in the optimizer are now just handled
 by the generic inliner, plus polymorphic inlining of == calls is now possible.
This also eliminates the need for a lot of duplicated code in the backend.

I adapted the inlining heuristics to compensate for the slightly larger
inital flow graph size.

Review URL: https://codereview.chromium.org//27307005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29800 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 11:32:52 +00:00