Commit Graph

321 Commits

Author SHA1 Message Date
srdjan@google.com 81d8099650 Redesign inlining interval computation.
Review URL: https://codereview.chromium.org//904763003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43622 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 23:11:05 +00:00
johnmccutchan@google.com 635ba4bbd9 Port flow_graph*, disassembler to ISL_Print
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43609 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 20:49:32 +00:00
vegorov@google.com e5f3e69eeb Add --print-flow-graph-filter to allow filtering debugging output.
Extend filtering pattern with % symbol: xyz% matches names that end at "...xyz".

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43598 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 16:26:46 +00:00
srdjan@google.com 12c5e2bbaf Cleanup: use const reference for ParsedFunction where possible.
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43226 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:41:09 +00:00
koda@google.com 99127744c6 Add Zone-based handle allocation interface and reduce use of Isolate-based interfaces.
Remove deprecated Isolate-based BitVector constructor.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43136 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 14:54:02 +00:00
vegorov@google.com cafe4db7de Tweak CanLoadFromObjectPool to return true even if obj.InVMHeap().
Previously it made sense to return false from this predicate because we would then load it directly as immediate.

However after r28067 we switched from movq to LoadImmediate. Now we end up putting obj.raw() into a constant pool with lowest bit masked off (to make it look like a smi) and then restoring this bit after load:

movq r10, [r15 + offs]
orq r10, 1

This orq is completely redundant - we should not clear off the least significant bit in the first place.

BUG=
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42877 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 17:57:27 +00:00
hausner@google.com ab3af6ec00 Introduce is_debuggable state bit on function objects
Simplify debugger logic. Any function can be marked as
non-debuggable when is is created. The debugger no longer
needs a heuristic which functions are debuggable.
Mostly used for synthetic, generated functions that
have no source code, e.g. async code, implicit getters and
setters, implicit constructors, forwarding constructors,
dispatcher functions.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42570 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-29 22:31:17 +00:00
fschneider@google.com 009eb5d33c Move ConstantPropagator from flow_graph_optimizer.cc/.h into separate files.
flow_graph_optimizer.cc is becoming unnecessarily large, so
I'm  moving self-contained optimization passes into
separate files.

In a separate CL I'll also move load/store optimization into
separate files.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42567 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-29 14:41:27 +00:00
srdjan@google.com 4c8545557a Add inlining ranges/intervals to code objects so that we can map a pc to the inlined stack. The mapping is not fast, used only for disassembly.
Copied from other CL: https://codereview.chromium.org/790213004/

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42522 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 20:03:27 +00:00
fschneider@google.com ac89119791 Fix dead phis elimination.
When initially marking live phis, only mark those
with real (i.e. non-phi) uses as live so that cycles
are properly eliminated.

Add a pass after allocation sinking since it may
create additional dead phis.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42245 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 14:28:38 +00:00
srdjan@google.com bad6a61899 Cleanups.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42069 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 18:48:12 +00:00
zerny@google.com 8e807c8550 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41983 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 09:32:43 +00:00
zerny@google.com 84a4135901 Revert "Integrate the Irregexp Regular Expression Engine."
This reverts commit https://code.google.com/p/dart/source/detail?r=41949

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41950 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:36:40 +00:00
zerny@google.com 43ac0c6f33 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41949 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:10:21 +00:00
fschneider@google.com d28319f4ae Undo changes to type propagation and canonicalization from my previous CL.
They triggered a bug with missing deoptimization environments in unboxing
of int32.

TBR=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41900 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 13:31:37 +00:00
fschneider@google.com 735e8fd6cd Reland and fix bug: Don't store redundant compile-type at values.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41898 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 12:04:05 +00:00
fschneider@google.com 624b650ae5 Revert r41843 because of checked mode test failures.
TBR=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41846 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 12:35:22 +00:00
fschneider@google.com 88f3c44db7 Don't store redundant compile-type at values.
If the computed reaching type is the same as the definition's type,
there is no need to store it.

Don't cache the type of the definition at the uses if the reaching
type is NULL.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41843 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 11:16:29 +00:00
fschneider@google.com 7bec3edaef Remove saving/restoring of the context at function entry.
This is not needed anymore after I changed the current context
to always reside in a local variable.

Further simplifications and cleanup in the debugger.

This also fixes a bad memory retention problem with
non-capturing closures.

BUG=dartbug.com/18886
TEST=tests/language/vm/closure_memory_retention_test.dart
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41433 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 07:35:51 +00:00
fschneider@google.com 876193b31a Make CTX allocatable by the register allocator.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.

This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00
koda@google.com 60b12996ec Track references to allocation stubs via static_calls_table, instead of keeping two referencers alive.
(Verbatim copy of srdjan's https://codereview.chromium.org/609893002/ )

TBR=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40738 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 20:17:53 +00:00
asiva@google.com 0d5f816a4c Skip compilation of signature classes.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40273 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 20:25:19 +00:00
fschneider@google.com da0fb6bbe2 More intrinsics in IR.
R=srdjan@google.com, vegorov@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40088 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 13:34:58 +00:00
zra@google.com c686b2c624 Finishes removing intptr_t from raw object fields.
Also removes {Read,Write}IntptrValue from the snapshot reader and writer.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40048 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 19:51:22 +00:00
asiva@google.com ac6b6f8fe4 Use PassiveObject were possible.
Review URL: https://codereview.chromium.org//512933002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39687 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 00:22:16 +00:00
vegorov@google.com 9f9e250e92 Support Int32 representation for selected binary operations.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39595 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 14:49:19 +00:00
srdjan@google.com 85af0719ef Faster IC stubs by specializing them for two-argument Smi operations (implemented only a few for now)
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39471 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 20:08:40 +00:00
hausner@google.com 0bbf6c5b16 Runtime support for evaluation of static field initializer expressions
Eliminates the generation of field initializer functions by the parser.
Adds a runtime call that creates a one-shot function to evaluate the
initializer of a static field. The runtime function gets called from
the implicit static getter function for the field.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39387 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:53:44 +00:00
fschneider@google.com 54a7410866 Fix bug with CHA dependencies by recording a set of classes for registering code.
CHA is not only used with the receiver class, but also with other classes
when doing type propagation. The optimized code has to be registered with
all classes that are affected by CHA so that deoptimization occurs whenever
the set of subclasses changes for these classes.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39194 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 12:43:03 +00:00
vegorov@google.com 77c26187f2 Support allocation sinking for compound objects.
- Improve escape/alias analysis:
-- Storing an object into a field of another object does not mean that this object escapes (or has aliases) as long as that object does not have any loads from the same place;
-- Places like X.f and Y.f don't alias if X and Y are two different allocation instructions even if X and Y themselves potentially have aliases;
-- Improve precision of alias analysis for indexed properties;

- Support dematerialization and rematerialization of objects that are referenced by other dematerialized objects.
-- Use fix-point algorithm to collect candidates for allocation sinking;
-- Support aborting unsuccessful allocation sinking.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38404 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 18:35:08 +00:00
asiva@google.com 00a7fd87c2 Use Object::null_object() instead of Object::ZoneHandle() when a null object
handle is desired. This is more efficient as it does not result in allocation
of a ZoneHandle and access to Isolate::Current().

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38044 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 22:15:20 +00:00
johnmccutchan@google.com 3eb3bc3fa9 Extend Range analysis to 64-bit range and mint operations
- Convert many private static functions into public static methods on Range or RangeBoundary classes.
- Simplify ConstraintInstr::InferRange to just use RangeBoundary::Min and RangeBoundary::Max calls.
- Extend RangeBoundary to 64-bits.
- Include mints in RangeAnalysis.
- Introduce generic Range::BinaryOp.
- Require ranges passed to Range::BinaryOp are finite.
- Clamp ranges attached to BinarySmiOpInstr and BinaryMintOpInstr.
- InferRange for BinaryMintOp and UnboxInteger instructions.
- Correctly set mint constant ranges.
- Add many tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37521 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 21:13:26 +00:00
regis@google.com 8cf0d1034e Ensure that a javascript compatibility warning results in a
JavascriptCompatibilityError being thrown in all cases when --warning_as_error
is specified.
Prior to this change, some javascript compatibility warnings resulted in a
compile time error.
Change expectations accordingly in tests.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37515 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 20:57:41 +00:00
regis@google.com 32f3e11d99 Cleanup of error and warning reporting.
R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37468 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 22:30:34 +00:00
srdjan@google.com 58fd318f4c Cleanup: use a ZoneGrowableArray instead of Array for ICData map.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37400 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 15:52:05 +00:00
srdjan@google.com 8f2dc961d0 Save ICData of unoptimized code in the function, thus preserving it across repated unoptimized compilations.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37378 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 22:24:05 +00:00
iposva@google.com e601c56e31 - Revert to use DEBUG_ASSERT again.
Review URL: https://codereview.chromium.org//334443003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37234 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-11 17:17:04 +00:00
iposva@google.com 00b1eb8d53 - DEBUG_ASSERT -> ASSERT where appropriate.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37233 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-11 16:58:14 +00:00
fschneider@google.com 8c426e0935 Update use lists after eliminating redundant phis.
BUG=dartbug.com/19320
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37225 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-11 10:23:48 +00:00
srdjan@google.com 3480ac4a0e Fix deferred library code disabling for inlined functions.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37107 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-06 22:14:40 +00:00
srdjan@google.com ce2d52f111 Pass isolates explicitly.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36740 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 14:24:53 +00:00
srdjan@google.com 2b06c73841 Remove unused code, improve speed of Parser::CurrentToken (improvement seen in measurements and profile).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36710 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 21:12:24 +00:00
iposva@google.com b4b4889406 - Refined https://codereview.chromium.org/293963008/
Make compilation VM more fine grained

- Use the isolate where appropriate.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36451 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 21:04:03 +00:00
fschneider@google.com 927d43caf2 More general dead phi elimination.
This CL adds an explicit pass to eliminate dead phis. Until now, we
only removed redundant phis that occurred after load elimination locally.

Also, constant propagation may result in dead / or redundant phis which
are removed by this phase.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36094 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-13 09:48:46 +00:00
regis@google.com dec11d8b7b Add support for javascript incompatibility warnings (work in progress).
For now, warnings are only issued when applicable for type tests, type casts,
and toString.
Fix newly reported lint errors.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36001 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 22:42:10 +00:00
fschneider@google.com 16e03db724 Implement simple dead store elimination.
This optimization is the dual to load elimination. It uses
the same infrastructure for handling aliasing. Since dead
store elimination is a backward data-flow analysis it inherits
from LivenessAnalysis.

Instead of eliminating upward exposed loads, it eliminates
downward exposed stores.

First local intra-block analysis is done in ComputeInitialSets.
Afte the fixed point iteration EliminateDeadStores performs the
global optimization on downward exposed stores in each block.

Only fully dead stores are eliminated. No partially dead
stores yet.

Example:

1: o.x = null;
2: if (cond) {
3:   o.x = 1;
4: } else {
5:   o.x = 2;
6: }

The store in line 1 is fully dead and will be removed. Note that
any deoptimization in "cond" will make the store only partially
dead and it won't be removed yet.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35909 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 14:26:16 +00:00
fschneider@google.com 07fcee05c8 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=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35669 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 23:17:24 +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
iposva@google.com 0d236b7402 - Rationalize the way we use comments.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35349 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 01:57:47 +00:00