Commit Graph

656 Commits

Author SHA1 Message Date
Florian Schneider 166b3ddfe3 VM: Fix optimizer bug in smi-op widening.
Only consider operations that are used (have an SSA temp) for widening.

Operations without uses will be eliminated as dead code anyway later.

BUG=dartbug.com/24987
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1468433002 .
2015-11-23 09:47:45 +01:00
Srdjan Mitrovic a9961f8f0a Various cleanups
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1464593002 .
2015-11-19 13:15:01 -08:00
Srdjan Mitrovic bad39686a4 Revert "Enable deferred deoptimization always."
This reverts commit 94754bee29.

BUG=

Review URL: https://codereview.chromium.org/1462703002 .
2015-11-18 15:28:34 -08:00
Srdjan Mitrovic 94754bee29 Enable deferred deoptimization always.
Deferred deoptimization being moved ahead of entering field dependencies, attempt to use it for non-background-compilation as well. Previous failures not reproducible on Linux ia32 any longer.

BUG=

Review URL: https://codereview.chromium.org/1450973002 .
2015-11-18 14:30:48 -08:00
Florian Schneider dce89b9b5b VM: Speculative inlining in precompiled code.
Enable inlining of certain smi- and array-operations based on propagated
types and range analysis:

If bounds checks and class checks can not be eliminated, bail out of the
current optimization and retry without speculative inlining using the same
mechanism as we use for far jumps on MIPS.

Allow more speculative inlining attempts with up to n deopt ids black-listed.
For now set n=1 since precompilation time will be proportional to n.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1423063005 .
2015-11-18 14:56:06 +01:00
Srdjan Mitrovic 354fcb12cf Cleanups. More mutator thread asserts.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1448463004 .
2015-11-16 10:29:01 -08:00
Srdjan Mitrovic baf0ac7e63 Attempt to fix dart2js crashes
BUG=

Review URL: https://codereview.chromium.org/1436293002 .
2015-11-12 13:41:35 -08:00
Srdjan Mitrovic 4600d37dc1 Background compilation work:
- Defer deoptimization from optimizing compiler to code installation in mutator thread.
- Defer registration of field and leaf class dependency until code is installed in mutator thread.
- Cleanup.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1433243003 .
2015-11-12 11:25:58 -08:00
Lasse R.H. Nielsen ed0b187d58 Add data-URI support class to dart:core (next to Uri).
R=floitsch@google.com, fschneider@google.com

Committed: https://github.com/dart-lang/sdk/commit/bbc66c2c41e61d82d6b85fdd16e2b0f1204c2a33

Review URL: https://codereview.chromium.org/1381033002 .
2015-11-12 13:02:20 +01:00
Florian Schneider e75056ccb4 VM: Fix bug with CHA-based inlining in --noopt mode.
Use propagated cids (not abstract types) only to specialize instance calls.

BUG=dartbug.com/24789
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1419013006 .
2015-11-02 19:48:26 +01:00
Srdjan Mitrovic 772ee329c4 Make ICData changes thread safe (first compute array, then set it). Install code in the main thread instead of in the background compilation thread.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1410363005 .
2015-10-26 15:12:29 -07:00
Florian Schneider 36e63481e0 More general CHA-based inlining and devirtualization for precompiled code.
Generalize current approach used for implicit getters/setters to all instance calls.

Additionally use propagated type to resolve targets if no concrete cid
is known:

class A {
  void m() { }
  void n() => m();
}
class B extends A { }

Even though the receiver type in n() can be A or B (concrete cid unknown), we can still
call m() directly since it is not overridden.

Also, allow inlining of methods that were not compiled yet in precompiled code.

BUG=
R=rmacnak@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1410733006 .
2015-10-23 13:34:32 +02:00
Florian Schneider 76e3c5584e Remove redundant code from flow graph optimizer.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1419743004 .
2015-10-21 18:51:08 +02:00
Srdjan Mitrovic ecd7457bb3 In precompilation, finalize all classes eagerly. Use the stable class hierarchy for doing CHA based optimizations: inline implicit setters and getters.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1392893003 .
2015-10-14 13:18:10 -07:00
Srdjan Mitrovic 6f53350611 Move deopt_id and related helpers/definitions from Isolate to Thread
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1390153004 .
2015-10-13 10:08:14 -07:00
Florian Schneider 8adefa8e79 VM: Support phis with pair representations.
This enables unboxed int64 values in phis on 32-bit platforms (ia32, ARM, MIPS).

On ia32 I measured SHA256 +14%, SHA1 +6%, MD5 +2%.

BUG=
R=johnmccutchan@google.com, regis@google.com

Review URL: https://codereview.chromium.org//1377113004 .
2015-10-08 11:43:55 +02:00
Srdjan Mitrovic 193eadbc10 Initial design for background compilation
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1386503002 .
2015-10-05 12:29:22 -07:00
Srdjan Mitrovic d867784de5 Cleanups and preemptively pass Heap::kOld whenever subtype testing in compiler
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1377453005 .
2015-09-29 11:05:54 -07:00
Srdjan Mitrovic 98340f7d9e Do not eagerly finalize when optimizing. Remove allocation of temporary strings in new space.
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1368173002 .
2015-09-25 14:30:48 -07:00
Daniel Andersson a1bc527306 Migrate logging infrastructure Isolate->Thread
This enables thread-safe logging (e.g., ISL_Print, which will soon be renamed to THR_Print), which is needed for concurrent
marking (DetachCode) and compilation.

Make finalization of GC marking tasks concurrent, now that it's thread-safe.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1314673008 .
2015-09-09 15:30:38 -07:00
John McCutchan a9be61a358 Static analysis fixes and debug prints for wedging test
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1302313003 .
2015-08-21 14:31:33 -07:00
Srdjan Mitrovic ce439a353c Trace CHA optimizations (where, when, why)
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1289933002 .
2015-08-13 13:47:34 -07:00
Srdjan Mitrovic 8cee9ac89d Change heuristic to determine which fields contain modifieable double boxes: do it if field was initialized with a double constant. Fix a parser bug
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1278003002 .
2015-08-07 09:16:02 -07:00
Daniel Andersson c089a152ac Migrate most uses of Isolate::current_zone to Thread::zone.
After https://codereview.chromium.org/1204303003/ is submitted, the last remaining uses can go.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1220193009 .
2015-07-08 09:59:32 -07:00
Srdjan Mitrovic 5711c13f69 Make frequent type checks (instanceof) faster by adding dedicated instanceof methods; improves dart2js startup
There is a possibility of adding intrinsics for all new instanceOf methods; my measurements did not show any benefits, therefore they were removed from this CL.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1222863003 .
2015-07-07 10:20:41 -07:00
Florian Schneider 5daa5646ef VM: Fix issue with optimizing compiler's range analysis.
Narrowing of ranges should only occur if the new range is actually
narrower than the old range. It can happen that a symbolic range
is worse than the already computed one. Ignore the new range in this
case.

BUG=dartbug.com/23693
R=vegorov@google.com

Review URL: https://codereview.chromium.org//1219623004.
2015-06-29 16:14:06 +02:00
Srdjan Mitrovic 80d98a583b Carefully restructure TryCreatICData and add guessing for getters and setters; helps --noopt a lot
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1207093002.
2015-06-24 15:32:33 -07:00
Srdjan Mitrovic 28594e455d Disable guessing 'other' cid; this prevents an issue in range analysis. It is not clear if guessing the 'other' cid optimization is the right thing to do as it may bring the flow graph in an unexpected state
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1203773002.
2015-06-23 13:23:02 -07:00
Srdjan Mitrovic aa8ea6da27 Enable TryCreateICData optimization, disable crashing test in status file
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1198333004.
2015-06-22 10:58:51 -07:00
Srdjan Mitrovic b498492194 Fix bingint crash, disable a test
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1194963004.
2015-06-19 15:18:06 -07:00
Srdjan Mitrovic 2c4605c199 Restore original version of FlowGraphOptimizer::TryCreateICData while investigating dart2js failure
BUG=

Review URL: https://codereview.chromium.org//1192873003.
2015-06-19 13:08:13 -07:00
Srdjan Mitrovic 5ce63657af Some cleanup and be more conservative when guessing cids: use only current leaf classes; otherwise we may get the cid of e.g., _StringBase, which confuses the VM since an object of that cid is never instantiated.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1186113011.
2015-06-19 10:16:11 -07:00
Srdjan Mitrovic 2a1f91914e Disable TryCreateICData until a crash in object.cc has been investigated.
BUG=

Review URL: https://codereview.chromium.org//1182323012.
2015-06-18 15:27:45 -07:00
Srdjan Mitrovic 6ec0903eb1 Fix broken debug build: prevent adding the same cid twice.
BUG=

Review URL: https://codereview.chromium.org//1174263005.
2015-06-18 13:11:45 -07:00
Srdjan Mitrovic cde9099e31 Noopt work: populate empty ICData of getters and setters with function's own class if that getter/setter exists in the class.
Significant performance improvements in DeltaBlue and Richards. No difference in dart2js except the size of Instructions went up by 12%.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1190123002.
2015-06-18 10:56:23 -07:00
Srdjan Mitrovic acadc9017c Inline instanceOf and 'as' operations; fix a bug in code emission
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1175803003.
2015-06-10 13:17:51 -07:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
Srdjan Mitrovic b611952ead Prevent excessive deoptimization when optimistically assuming Smi in typed data stores.
Moved ICData ahead of class Function, since class Function needs type ICData::DeoptReasonID.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1149403005
2015-06-01 11:42:42 -07:00
Srdjan Mitrovic d7d0d92ec3 Do not eagerly add guarded leaf classes with CHA; do not add them for private names.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1158673004
2015-05-29 08:57:34 -07:00
Srdjan Mitrovic ed73a3d151 With --noopt run unoptimized code through optimizer, more optimizations can be done later.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1149713002
2015-05-28 10:05:46 -07:00
Srdjan Mitrovic 91651f8805 Remove value check from ICData checks/house-keeping
BUG=
R=johnmccutchan@google.com, vegorov@google.com

Review URL: https://codereview.chromium.org//1153963002
2015-05-27 13:17:28 -07:00
srdjan@google.com 3ac643115f Remove unneeded flag declaratiosn (enable_type_checks, enable_asserts).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45647 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 16:48:43 +00:00
zra@google.com b253b7c2ba A few fixes for ARMv5TE.
This CL:
- Adds SupportsHardwareDivision() to FlowGraphCompiler.
  In FlowGraphOptimizer, if SupportsHardwareDivision()
  is false, Smi and Mint division operations are not
  inlined.
- Reduces the supported addressing modes for ldrd, strd.
  For ARMv6 and up, the address only needs to be 4-byte
  aligned, for ARMv5TE and below the address must be
  8-byte aligned. So, on ARMv5TE, we can split these
  each into two instructions, which is easier to do if
  the addressing modes are restricted to base + offset,
  which is all we were using anyway.
- Uses the smull instruction on ARMv5TE and ARMv6. I don't
  remember why it was disabled, and the docs say
  it is supported. Verified working on ARMv5TE hardware.
- Fixes a bug in OSR frame entry caused by the
  difference between the PC read offset in store vs.
  other instructions.
- Fixes assembler tests that have a float return for
  targets without vfp.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44788 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 20:46:52 +00:00
koda@google.com 02240f100e Move CHA state keeping from Isolate to Thread.
This prepares for the Isolate/Thread split, and also enables us to remove the GrowableArray(Isolate*) interface.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44549 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-18 00:29:26 +00:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
srdjan@google.com f062e0894f Mitigate windows crash & failure by disabling merging of sin & cos.
Review URL: https://codereview.chromium.org//937193005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43895 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 21:58:23 +00:00
srdjan@google.com b67d23747f - Fix sin-cos merge, add a flag to turn it on/off. Using fsincos is much slower than calling out to runtime.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43891 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 20:19:16 +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
zra@google.com 1299ad1485 Allows turning on checked mode on a per-isolate basis
using the embedding API.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
srdjan@google.com 110a74f954 Cleanups: parsed_function()->function() => function()
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43213 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:09:31 +00:00