Commit Graph

255 Commits

Author SHA1 Message Date
asiva@google.com 64a261fbbd Changes to interpret the optimizable bit based on whether the function
is native or not.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31207 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-17 22:07:41 +00:00
srdjan@google.com d1485f3058 Some cleanups, fixes. Parts of the cid guessing CL that was revrted.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31085 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-11 22:25:38 +00:00
srdjan@google.com 92c6188860 Revert r31036, because of bit redness.
Review URL: https://codereview.chromium.org//101373006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31039 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-10 21:16:02 +00:00
srdjan@google.com 07775d340e For instance call representing numerical comparisons and binary operations (double and Smi supported for now) that were never visited before optimization occurs, we guess the cids if one of the argument cids is known, e.g. ‘a == 1’ we guess that a is also going to be 1 thus avoiding emitting an IC-call in optimized code and propagating the type accordingly.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31036 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-10 19:09:44 +00:00
fschneider@google.com cd54507fc2 Mark native functions when they are created.
Until now the parser marked native functions as native when parsing.

This may be too late for some functions. E.g. the native typed list
constructor may not be invoked because the intrinsic code is executed
instead (unless for example new-space allocation fails).

This causes missing type information when optimizing functions using
those recognized factory functions like Uint8List._new.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30846 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:32:43 +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
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
iposva@google.com 8d926653e1 - Ensure that classes are finalized before their description is
being generated for the observatory.
- Reset the state that a class is being currently parsed.
- Move the deployed polymer app to a location where it is not
  being overwritten by the tools.
- Do not rely on Dart SDK binaries being in your path.
- Check for errors when invoking dart2js as part of build.dart.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30533 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 17:26:22 +00:00
fschneider@google.com ce9573722c VM: Fix checked mode crash (issue 13831).
The AST for static getters differs between parsing the first time, and
subsequent parsings. This leads to a mismatch in deoptimization-ids
between the optimized and the unoptimized code.

This CL avoids creating different ASTs for the same static getters. To allow
better inlining of these getters, the initialization expression is wrapped in a
hidden static initializer-function. As a result the size of such getters is
constant and does not depend on the initializer expression.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29680 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 16:49:55 +00:00
fschneider@google.com 369a58132e Fix bugs in load elimination and type propagation.
Load elimination should consider the representation of loads/stores
when numbering places. Different representations result now in different
places so that there can't be mixed representations at phis after
load elimination.

Removed the flag --propagate-types because type propagation is required
for correctness of smi-check hoisting. Therefore, switching it off does not
 make sense anymore.

BUG=https://code.google.com/p/dart/issues/detail?id=6663, https://code.google.com/p/dart/issues/detail?id=14271
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28931 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 13:59:56 +00:00
regis@google.com 5d79a9ab02 Allow an interface to be (mal)bounded (fix issue 14118).
Regression test is pending, but not checked in yet
(see https://codereview.chromium.org/27378002/).

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28684 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 21:24:44 +00:00
iposva@google.com 3423572926 - Harden coverage generation, by not attempting to compile
un-compilable functions.
- Only register closure functions in the class when they
  have been properly setup.
- Make sure to compile closure functions when calling CompileAll.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28282 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 20:50:16 +00:00
kmillikin@google.com e375053d2f Pattern match on generated code to find edge counters.
In unoptimized code, use platform-specific pattern matching on generated
code to find edge counter arrays.  Previously we searched pointer offsets,
but that does not work on platforms that encode the edge counters as indexes
into an object pool (i.e., x64, ARM, MIPS).

BUG=
R=fschneider@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28085 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 10:22:47 +00:00
hausner@google.com fcb84c8dc9 Fix expression evaluation in library context
- Use correct source for patch functions when class
  finalizer reports error
- Reinstate support for class in Dart_EvaluateExpr

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 18:49:32 +00:00
fschneider@google.com e9f0b93eb1 Revert r28050 due to crashes with --optimization-counter-threshold=5.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28052 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 14:29:44 +00:00
fschneider@google.com acb389dbf9 Optimize conditional branches that have same true/false targets.
Branches that have the same true/false target, or where both
target blocks reach the same common join block via empty blocks
can be replaced by a goto to the common join block.

In code like this

var a = unknown();
var b = null;
if (a == null || b == null) {
  ...
}

it eliminates the test (a == null) if b is known to be null. Until now,
the compiler could only eliminate the test for b, if a was known.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28050 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 12:41:28 +00:00
fschneider@google.com b7afb65a10 Clean up handling of guarded fields in the flow graph builder.
FlowGraphBuilder has a zone-allocated list of fields and passes it
on to the FlowGraph.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27699 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 12:14:06 +00:00
fschneider@google.com 1072bc1c60 Reland: Fix bug in field type tracking and polymorphic inlining.
Original CL: https://codereview.chromium.org/24096018/

This fixes the bug by changing FlowGraphBuilder to a zone object
because it is needed by the inliner later in the pipeline.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27695 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 10:35:01 +00:00
asiva@google.com 53a1ec9456 Revert
https://code.google.com/p/dart/source/detail?r=27655
as it is causing dartium build breakage.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27675 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 20:32:16 +00:00
fschneider@google.com 7dea1d8a2c Fix bug in field type tracking and polymorphic inlining.
When inlining implicit getters via the polymorphic inliner
(and not through the flow graph optimizer) the fields loaded
must be added to the list of guarded fields that trigger
deoptimization when a store violated the field type guard.

Also, this CL avoids adding fields to the list from inlining
candidates that do not get inlined after all. Previously, the
optimizer pass on the callee graph would add guarded fields
even if the final graph does not get inlined.

TEST=tests/language/vm/optimized_guarded_field_test.dart
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27655 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-19 11:21:11 +00:00
kmillikin@google.com 94ca56a774 Fix a bug in block reordering/block compaction.
The compiler assumes (a) the graph entry is followed in the block order by
its normal entry, and (b) the normal entry block is non-empty.  There is not
necessarily true, so stop assuming it.

BUG=https://code.google.com/p/dart/issues/detail?id=13101
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27377 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 12:32:58 +00:00
kmillikin@google.com 1d0cde6f24 Fix the flag --reorder-basic-blocks so it works to disable reordering.
Temporarily set the flag to false by default to avoid a bad interaction
between block reordering and empty block compaction (dartbug.com/13101).

BUG=https://code.google.com/p/dart/issues/detail?id=13101
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27292 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 14:54:45 +00:00
regis@google.com c0036588b9 Move the assertion checking the number of arguments passed to a runtime entry
from the entry to the macro.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26829 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 00:08:02 +00:00
kmillikin@google.com 00f20f3ffc Collect edge count profiling data and reorder basic blocks.
In unoptimized code, collect edge counts for all edges.  Use the counts
to reorder basic blocks in optimized code.  Basic blocks are reordered
by using Pettis and Hansen's "Profile Guided Code Positioning" bottom-up
algorithm.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26773 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 09:17:07 +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
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
zra@google.com 5c3c549300 Allows compiler bailout to handle errors of any type.
R=asiva@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25974 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 19:51:11 +00:00
zra@google.com 46dd77407f Changes the flag for using far branches from static to volatile.
R=fschneider@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25967 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 17:23:30 +00:00
zra@google.com fa2ad38a31 Enables per-function far-branches for ARM and MIPS.
R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25723 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 20:51:46 +00:00
fschneider@google.com e6b8a47f6d Disable allocation sinking in the presence of try-catch.
Allocation sinking does not handle the case of optimized try-catch yet.

I added a TODO to support it at a later point.

BUG=https://code.google.com/p/dart/issues/detail?id=11873
TEST=tests/language/try_catch_optimized2_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25146 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 14:13:38 +00:00
regis@google.com 191d2673c8 Use proper internal name for implicit static final getters.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25053 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:29:59 +00:00
srdjan@google.com f415b31685 Add --deoptimization_counter_inlining_threshold=10 that stops inlining in a method that has reached it.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24519 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 15:26:16 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
kmillikin@google.com 665ffe3164 Ensure we perform the same checks for all optimizing compilations.
Ensure that we perform the same checks for on-stack replacement (OSR)
as for normal optimizing compilation.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24132 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 11:06:18 +00:00
kmillikin@google.com 3e78b2ad4a Reapply "Initial implementation of on-stack replacement (OSR)."
This reapplies SVN r24024 with a bugfix.

After OSR compilation, restore the pre-OSR code (which might be already
optimized) rather than the unoptimized code (which might have its entry
patched).  When the optimized code entry is patched it is only safe to call
it as a static call, not as an instance call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24088 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 11:05:15 +00:00
kmillikin@google.com d6f3eccdf2 Revert "Initial implementation of on-stack replacement (OSR)."
This reverts commit 24024.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24025 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:30:53 +00:00
kmillikin@google.com 0b39927d30 Initial implementation of on-stack replacement (OSR).
Add profiling support to select OSR candidates and launch the compiler
for OSR, followed by entry to the function at the OSR entry point.

Implemented only on IA32 and X64.  The initial implementation can be
improved in various ways --- specifically: tuning of profiling
parameters and incorporation of feedback about the actual values seen
at OSR entry.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24024 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:10:55 +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 07966b62da Fix two bugs in the Dart VM's super-noSuchMethod invocation.
1. The result value of an expression 
"super.someMissingSetter = val" was incorrect in case of a noSuchMethod call.

To fix this I refactored the BuildStaticNoSuchMethod function. It now no longer
creates AST nodes and visits them, because the last argument may be needed saved
as a result value.

2. The evaluation order of "super[e1] = e2" was wrong in case of a noSuchMethod call.

BUG=dart:8917, dart:10965
TEST=tests/language/super_operator_index7_test.dart, tests/language/super_operator_index8_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23553 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 17:09:09 +00:00
fschneider@google.com 9a6657cd4d Eliminate temporary locals for some expressions
This CL affects a subset of expressions that use temporary locals: constructor
calls, array literals and and instance getter postfix-ops.

For expressions that are de-sugared in the parser I added LetNode.
It creates a scoped temporary local bound to an initializing expression.

For expressions where we need a temporary local at graph-building time,
I added a helper class TempLocalScope to easily create a single temporary
local in the graph builder since this is a frequently recurring pattern.

This simplifies code in the parser and the graph builder and also fixes a
bug with indexed-super invocation and NoSuchMethod.

BUG=dart:8918
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23401 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 12:19:21 +00:00
srdjan@google.com d1adfc37a3 Fix issue 3874: non-deterministic AST generation caused by exceptions being thrown during parsing (StackOverFlow). Mark functions that throw and exception as non-optimizable.
Fix flow graph printing (optimized vs non-optimized).

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23350 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 13:07:46 +00:00
fschneider@google.com fdcae8a772 Add a helper function for allocation of deoptimization history.
This CL addresses DBC comments from my previous CL (https://codereview.chromium.org/15779006/)

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23330 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:11: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
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
kmillikin@google.com 1248115680 Remove the IC data array from the isolate.
Thread it as an argument rather than storing it in a global variable.  This
means the programmer does not have to implement a shadow stack to save and
restore the data array, and there is no special handling needed for GC.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22982 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 06:21:57 +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