Commit Graph

120 Commits

Author SHA1 Message Date
fschneider@google.com 40013fe1c0 Simplify compilation of relational operators.
Instead of having a separate IL instructions relational comparisons
are built as normal instance calls initially. When optimized, we replace
the instance call with a smi/double/mint comparison instruction.

This enables generic inlining of relational operator calls and simplifies
code generation, too.

Merging comparisons with branches is done in the optimizing compiler's
branch simplification phase.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27058 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 14:02:53 +00:00
fschneider@google.com 1a3ef7b16b Allow inlining of methods that have an intrinsic translation.
This works because I changed the compiler so that it always emit
the full unoptimized code for all intrinsic methods in a previous CL
As a result deoptimization works for those methods like for normal
methods.

Also, code for some recognized getter methods is moved to the flow
graph builder, so that there is no need for special handling in
the flow graph optimizer. This part of the change is
should be performance-neutral.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26867 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 12:32:05 +00:00
fschneider@google.com ba0f59d1bc Polymorphic inlining for some recognized methods in the optimizing compiler.
The optimizing compiler currently recognizes a certain frequent native methods
like array length or string length and provides an inlined implementation.
Inlining does currently not work for polymorphic call sites of these methods.  
This CL enables also polymorphic inlining in the case of .length getters for
arrays and strings.

1. The method is recognized at flow graph build time. The builder creates
 the body of the method for both compilers (non-optimizing and optimizing).
 Native methods that are not recognized, are translated as before using a NativeCall
 IL instruction.

2. The flow graph inliner handles recognized methods in the same manner as normal methods.
Until now intrinsic and recognized method could not be inlined. This CL enables it.

3. There is no need for an intrinsic assembly implementation because recognized methods
have an IL implementation that does not call into the C++ runtime. I left the intrinsics
in for now, but they can be removed if there is not noticable performance benefit anymore.

4. The inlining heuristics are tweaked in a way that enables more aggressive inlining
of recognized methods: +1 level of inlining depths, call sites of recognized methods are
not counted in the inlining heuristic.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26429 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 12:58:08 +00:00
srdjan@google.com 053d885d02 Optimize equuality operation for two Boolean arguments.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25636 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 20:44:25 +00:00
srdjan@google.com 14a3cb0cfd Make sure that ICData always contains valid data (non-null values).
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25535 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 20:17:04 +00:00
srdjan@google.com 3d6b2fc18e Allow equality operation on mixed double/smi arguments.
Fix a bug in relational operations in 64 bit mode: if ICData specifies double and Smi as possible arguments, we generate code for double and unbox or convert to double the inputs. These works only if smi can fit into the double. Current solution for 64-bit architecture is to disallow two smi-s as input to a polymorphic comparison instruction (equality, relational).

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25522 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 16:48:46 +00:00
johnmccutchan@google.com 53ddd08b84 Allow SIMD types to be used on mips
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25481 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 17:31:19 +00:00
fschneider@google.com 3208230580 Revert r23330 and r23136 because of a bug with loop invariant code motion.
This CL temporarily remove deoptimzation history which was put in to prevent
repeated deoptimization caused by loop invariant code motion. It caused
illegal code motion under certain conditions.

BUG=https://code.google.com/p/dart/issues/detail?id=11245
TEST=tests/language/licm3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23989 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:52:33 +00:00
fschneider@google.com 732163dfcd Make constant propagation to fold x == x and re-run type propagation for better range analysis.
1. When comparing numbers, or strict-comparing objects, this can be folded into
true/false.  Since this often occurs after inlining and store-to-load forwarding,
constant propagation is repeated after these phases. The pattern looks like:

o.x = o.y;
if (o.x == o.y) { ... }

2. Load elimination may introduce new phis that may have smi-type. In order to
get range information for these phis, I added a second phase of type propagation after
load elimination.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23901 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 10:27:13 +00:00
vegorov@google.com 59da9de8c7 Ensure that all phis inserted by load optimizer have consistent representation.
Revert r23619.

R=srdjan@google.com
BUG=dart:11048

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23634 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 15:37:23 +00:00
fschneider@google.com c1a33f3ea6 Add deoptimization history to optimized functions.
Each function that is optimized or inlined into an optimized
functions keeps an array of deoptimization ids.

This history is used to avoid repeated deoptimization caused by
speculative hoisting of check instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23136 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:03:40 +00:00
srdjan@google.com 816053cb7c Improve constant propagation for Mint and Smi.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23020 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 15:20:55 +00:00
srdjan@google.com 7797d39362 Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to test for exact type in VM's libraries.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22695 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 18:16:44 +00:00
johnmccutchan@google.com cd7c5236a2 Inline Uint32x4 operations
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22649 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 20:22:06 +00:00
fschneider@google.com 8ad125f607 Optimize functions containing try-catch.
This is a first step towards fully optimizing try-catch-finally.

At a catch entry, all local variables and parameters are
expected at a fixed stack location. There is a list of
initial definitions at the catch entry block, similar to
the initial definitions at graph entry.

Inside every try-block there is a special prologue code before each
call (instruction that may throw) inside the try-block. This prologue
is similar to a parallel move instruction: It moves all locals+parameters
to the locations expected by the catch-entry block. The stack frame
is extended with the corresponding number of fixed slots right below
the normal spill slots.

Every function containing try-catch has additional compiler-
generated local variables to pass the context, the exception and
the stack trace.

Variable liveness analysis is adapted to treat locals inside try{} blocks
specially: Every call has an implicit LoadLocal of every local variable.
This CL uses a safe approximiation of liveness which can be optimized further.

Current restrictions which are planned for future CLs:
 * No inlining inside try-blocks.
 * No inlining of functions containing try-catch.
 * No try-finally yet.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22615 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 10:33:24 +00:00
srdjan@google.com 0acfcf21e7 A load static of an initialized static final field can be converted to its value, as long as it is in old space or Smi, and can therefore be a literal node.
Add special objects to mark non_constant and unknown_constant in constant propagator so that there is no confusion with sentinels used in the graph.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22600 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-10 21:33:14 +00:00
vegorov@google.com 2565ca222f Implement a variation of scalar replacement for non-escaping allocations.
AllocationSinking pass discovers non-escaping allocations that have no input uses other than uses in the stores into its own fields.

Every environment use of such allocation is replaced by a state snapshot (MaterializeObject instruction) that describes the state of each initialized field in the object. State snapshots are computed through an additional round of load-forwarding.

Once snapshots are computed allocations are removed from the graph.

MaterializeObject instructions are not compiled into native code but produce deoptimization instructions instead that describe how object should be materialized at deoptimization.

Deoptimization instructions now follow the following format:

[mat obj #1]...[mat obj #N][ret addr][... mat arguments ...][... real frames ...]

- the prefix describes each object to materialize on deopt via kMaterializeObject instruction;
- actual values that are needed for materialization are emited as a part of bottom-most stack frame. This is done to simplify implementation: they need to be discoverable by a GC during materialization phase. At the end of deoptimization they will be removed from the stack;
- normal stack slots can refer to materialized objects via kMaterializedObjectRef instruction.

Additionally this change contains fixes in load-forwarding that are needed to guarantee that all artificial LoadField instructions inserted during AllocationSinking are correctly replaced with actual values.

Limitations of the current implementation:

- can't eliminate allocations that flow into phis but otherwise don't actually escape;
- can't sink allocations out of loops;
- allocation with type arguments are not handled.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22485 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 23:40:42 +00:00
kmillikin@google.com 5868a6bffa Use the constant pool for all constants, not just null.
Remove constants from the instruction stream in optimized code at SSA
construction time.  Modify the range analysis pass to analyze values in the
constant pool.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22458 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 12:50:37 +00:00
kmillikin@google.com 7e31a88a0a Initial support for polymorphic inlining.
Consider each polymorphic variant separately for inlining in frequency
order.  Share inlined bodies for shared targets.

Insert an SSA redefinition of the receiver in each inlined variant to
prevent hoisting.  Hoisting code specialized to the receiver (e.g.,
direct access to internal fields of typed data arrays) out of the
inlined body is not safe.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22434 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 17:22:18 +00:00
vegorov@google.com f005802733 Improve load forwarding:
- stores/loads that access different fields can't alias each other;
- if result of the AllocateObject does not escape then stores/loads to it does not alias stores/loads to other objects.

Other:
- rename LoadFieldInstr's value to instance to better convey meaning and match StoreInstanceFieldInstr;
- slightly bump inlining_size_threshold;
- canonicalize UnboxDouble(BoxDouble(v)) and BoxDouble(UnboxDouble(v)) patterns;

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22340 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 21:20:49 +00:00
johnmccutchan@google.com aa1d4b4062 Inline remaining Float32x4 operations.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22277 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:40:24 +00:00
vegorov@google.com 34d41f9c80 Track side-effect free paths in the graph to allow CSE and LICM for instructions that depend on some side-effects.
Right now only a single side-effect is important for CSE/LICM purposes: externalization.

But abstractions are in place to introduce others if needed.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22180 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 14:25:16 +00:00
johnmccutchan@google.com 08c99e80e6 Inline Float32x4 Getters
Review URL: https://codereview.chromium.org//13872020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21897 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 17:52:10 +00:00
vegorov@google.com 1162595313 Convert EqualityCompare to StrictCompare if reciever is either null or guaranteed to have default equality operator.
R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21696 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 19:52:26 +00:00
vegorov@google.com 11edd87390 Convert diamond shaped control flow into a single conditional instruction.
Adds a IfConverter pass that right now recognizes two simple patterns cond ? 0 : 2^n and cond ? x : x+-1 that can be generated without branches on ia32 and x64 using setcc instruction.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21207 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 15:09:46 +00:00
srdjan@google.com cbe8bd9a3a Restore r20998 with a bug fix: add field to guarded_fields_ when it contains relevant cid. Was missing most cases and did not check for unique adds.
Review URL: https://codereview.chromium.org//13726023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21008 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 23:26:53 +00:00
srdjan@google.com e7f1ae5383 Revert r20998.
Review URL: https://codereview.chromium.org//13739002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21001 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 21:44:17 +00:00
srdjan@google.com 44938de19c Fix guarded_cid handling: add field to list of guarded_field at LoadField creation time.
Review URL: https://codereview.chromium.org//13529021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20998 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 21:01:30 +00:00
fschneider@google.com 5e0ac1419e Use range analysis to improve constant propagation.
This CL runs a second round of constant propagation after range
analysis to eliminate additional unreachable code. Range analysis
is changed to mark branches as constant if the constraints they
generate are unsatisfiable.

The second pass of constant propagation only visits branches and
removes unreachable code, but does not do full constant propagation.

This proves useful when inlining array view operations where the
following pattern occurs:

for (i = 0; i < length; i++) {
  if (i < 0 || i >= length) {
    throw 123;
  }
  foo();
}

In this example the if-statement will be eliminated completely.

Also, fix a bug in range analyis where constraints of already
constrained values were missing.
Review URL: https://codereview.chromium.org//13469013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20914 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 12:42:17 +00:00
srdjan@google.com 60e57ecfe1 Optimizes 'as' operation in similar way as 'instanceof': collect type feedback in unoptimized mode and try to convert it to a simple classcheck in optimized code.
Review URL: https://codereview.chromium.org//13190014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20783 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 15:30:14 +00:00
vegorov@google.com 1c9d22d75c Collect type feedback for fields.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20235 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 20:15:10 +00:00
fschneider@google.com 86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
fschneider@google.com d0959080ab Inline ByteArray setters like setUint8 in the optimizer.
Review URL: https://codereview.chromium.org//12378039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19781 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 12:16:54 +00:00
kmillikin@google.com ef0580c26a Implement a branch optimization pass.
Branch optimization pushes some branches that test the value of a phi
to the predecessor blocks.  This can avoid materializing a boolean
object solely for the purposes of branching on its boolean value.

The optimization is performed after inlinining which creates
opportunities, and before constant propagation, because it exposes
opportunities for unreachable code elimination.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19682 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 11:14:08 +00:00
kmillikin@google.com 45a6441346 Add functions for setting an environment and rebinding a use.
Add functions for setting or clearing an instruction's environment, which
initialize the environment uses.  Add a function for changing a use's
definition.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19036 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 11:50:28 +00:00
lrn@google.com 3c0ac360e7 Remove deprecated string features.
Make String.codeUnits return a List.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18960 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 10:48:09 +00:00
srdjan@google.com 19995faa3a Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the result.
Review URL: https://codereview.chromium.org//12218181

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18859 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 22:24:42 +00:00
kmillikin@google.com c3e1db1af7 Fix broken use lists in branch instructions.
BranchInstr::ReplaceWith is used in two different places that have different
expectations about the use lists of their argument.  Split it into two
separate functions.

R=fschneider@google.com
BUG=dart:8657

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18826 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 12:51:01 +00:00
fschneider@google.com 8fa3140676 Inline ByteArray._setIndexed in the flow graph optimizer.
Review URL: https://codereview.chromium.org//12317011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18818 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:35:19 +00:00
kmillikin@google.com 622efda5fb Convert some compiler passes to preserve valid def-use chains.
Change the ApplyICData, ApplyClassIds, Canonicalize, and
SelectRepresentations passes to preserve valid use lists.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18676 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 12:09:01 +00:00
vegorov@google.com baa0347253 Reapply r18377 it was reverted due to the unrelated bug it surfaced.
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.

Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18456 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 17:16:35 +00:00
vegorov@google.com 487c73e01f Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields."
This reverts commit r12365.

Reason: failure on vm-mac-debug (debug_ia32 standalone/io/file_fuzz_test).

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18378 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:36:21 +00:00
vegorov@google.com f8d9a90b2c Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18377 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:06:47 +00:00
fschneider@google.com 7fc8f72c25 Inline getters of byte array view in the optimized flow graph.
This CL provides inline IL code for the getters _getInt8, _getInt16, etc.
to speed up [] and byte array views.

The code uses the existing LoadIndexed instructions by passing a index
scale factor explicitly: For normal arrays loads, the scale factor is equal
to the element size. For byte array access, the scale factor is always 1.

I'm adding inlined setters in a separate CL.
Review URL: https://codereview.chromium.org//12218008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18173 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 15:18:57 +00:00
kmillikin@google.com a518a0a36f Add a use list iterator that allows mutation of current.
Add Value::Iterator that supports removing the current use from the
underlying use list, including deleting it or moving it to another use
list.  Use it in range analysis and representation selection.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18055 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 17:04:02 +00:00
vegorov@google.com 932a05420a Reland r17365.
Introduce InvokeMathCFunction that can be used to directly invoke mathematical
function provided by runtime.

Use it to unconditionally inline _Double.pow.

Use it to inline floor, ceil, round, truncate, round when SSE4.1 is not
available.

Perform representation selection phase after constant propagation to minimize
boxing.

Add support for enter instruction in the x64 disassembler.

Add test for optimized pow and fix compilation on windows.

R=fschneider@google.com
BUG=dart:8002

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17393 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 12:18:31 +00:00
vegorov@google.com ab91977173 Revert "Introduce InvokeMathCFunction that can be used to directly invoke mathematical function provided by runtime."
This reverts commit r17365.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17367 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 17:16:16 +00:00
vegorov@google.com a20c8d28b8 Introduce InvokeMathCFunction that can be used to directly invoke mathematical function provided by runtime.
Use it to unconditionally inline _Double.pow.

Use it to inline floor, ceil, round, truncate, round when SSE4.1 is not available.

Perform representation selection phase after constant propagation to minimize boxing.

Add support for enter instruction in the x64 disassembler.

R=fschneider@google.com
BUG=dart:8002

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17365 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 16:59:37 +00:00
fschneider@google.com 657c4944c3 Remove StringCharCodeAtInstr and handle it as part of LoadIndexed.
Review URL: https://codereview.chromium.org//11970038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17274 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:03:40 +00:00
vegorov@google.com a77fc9701c When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00