Commit Graph

35 Commits

Author SHA1 Message Date
Vyacheslav Egorov dcfb7b9a4c [VM] Fix typing violations in string_patch.dart.
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I1a0a94ce19bb54cb4273d1508b6ed08b94c60307
Reviewed-on: https://dart-review.googlesource.com/14840
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-19 06:42:37 +00:00
Peter von der Ahé e8aef37eac Clean up patches so they can be compiled by Fasta.
Change-Id: Ie436375c78496366accf0ba82938e54cbe30b143
Reviewed-on: https://dart-review.googlesource.com/3001
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 14:05:50 +00:00
Zachary Anderson 9e7e66602f Compute the script Uri lazily
Previously, the string set up by the embedder was eagerly passed to
Uri.parse during Isolate startup. This is expensive both in time and
memory footprint. This CL causes Uri.parse() to be called only
when needed. This change will allow reducing the memory footprint
of Fuchsia's Dart content handler on hello world by ~1MB.

fixes #25603

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2988613002 .
2017-07-24 12:56:21 -07:00
Vyacheslav Egorov 7887c34a29 VM(RegExp): Allow OSR optimization of RegExp :matcher functions.
Previously these functions would only contain a single CheckStackOverflowInstr
in a backtracking block and that CheckStackOverflowInstr would have a zero
loop_depth - which means it would not be considered eligable for OSR.

This change:

* adds CheckStackOverflowInstr with non-zero loop_depth in two other places
  (Boyer-Moore lookahead skip loop and greedy loop) where loops arise in the
  generated IL;
* sets non-zero loop depth on the CheckStackOverflowInstr in the backtracking
  block;
* adds a flag on CheckStackOverflowInstr that allows optimizing compiler to
  optimize away those checks that were inserted solely to serve as OSR entries.
* ensures that IR generated by IRRegExpMacroAssembler is OSR compatible:
  * GraphEntryInstr has correct osr_id;
  * GraphEntry and normal entry have different block ids (B0 and B1 - instead of B0 and B0);
  * unreachable blocks are pruned and GraphEntry is rewired to point to OSR entry;
  * IRRegExpMacroAssembler::GrowStack should not assume that  stack_array_cell and :stack
    are always in sync, because :stack can come from OSR or deoptimization why stack_array_cell
    is a constant associated with a particular Code object.
* refactors the way the RegExp stack was growing: instead of having a special instruction
  just emit a call to a Dart function;
* refactors the way block pruning for OSR is done by consolidating duplicated code
  in a single function.

We allow the optimizing compiler to remove preemption checks from
non-backtracking loops in the regexp code because those loops
unlike backtracking have guaranteed O(input_length) time
complexity.

Performance Implications
------------------------

This change improves performance of regexps in cases where regexp spends a lot
of time in the first invocation (either due to backtracking or due to long non
matching prefix) by allowing VM to optimize the :matcher while :matcher is
running.

For example on regex-redux[1] benchmark it improves Dart performance by 3x
(from ~18s to ~6s on my Mac Book Pro).

CL history
----------

This relands commit d87cc52c3e.

Original code review: https://codereview.chromium.org/2950783003/

[1] https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexredux&lang=dart&id=2

R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2951053003 .
2017-06-23 12:51:53 +02:00
Régis Crelier a62107cfaf Check for a passed-in type argument vector in the prolog of generic functions.
Do this in unoptimized code only, when --reify-generic-functions is specified.
This is still work in progress, and support in optimizer, in inliner, in DBC,
in kernel to ir, and other areas, will follow.
Many small fixes and added todos.

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

Review-Url: https://codereview.chromium.org/2941643002 .
2017-06-21 09:02:16 -07:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Peter von der Ahé ae7319727a Fix more lint style issues in runtime patches.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2708663002 .
2017-02-20 14:17:14 +01:00
Kevin Millikin bbf5b89473 Move _fatal to dart:async
The function _fatal is only used in dart:async.  Change it from a public
function of dart:_internal, which can be invoked via mirrors, into a
private function of dart:async.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2684963004 .
2017-02-20 11:52:52 +01:00
Lasse R.H. Nielsen d26132d119 Move methods from internal.Lists that are not used, or only used once.
Remove the class (actually move it to the VM-only dart:_internal patch, because the VM code depends on recognizing the Lists.copy method).

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2685783009 .
2017-02-17 12:25:26 +01:00
Kevin Millikin fdb4c100e0 Move _fatal from dart:core to dart:_internal
_fatal was a private function in dart:core which was called from a
different library (dart:async).  It's not clear how it was supposed to
work or if it even did.  The uses in dart:async don't appear to be
covered by tests.

Move it to dart:_internal which exists exactly for sharing things
between the dart: libraries.

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2684033006 .
2017-02-09 12:46:51 +01:00
Ryan Macnak 6137d020b9 AOT: Use a cid range check when possible to implement type tests.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2314133003 .
2016-09-08 15:25:08 -07:00
Ryan Macnak ea6159fb08 Don't cache the cid of CodeUnits.
It is not a predefined class, so its cid may change during precompilation.

Review URL: https://codereview.chromium.org/2279323003 .
2016-08-29 09:21:06 -07:00
Matthias Hausner e11ca24053 Use metadata annotation @patch for patch classes
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.

The deprecated syntax is still supported, but a warning is printed when detected.

BUG=

Review URL: https://codereview.chromium.org/2220883004 .
2016-08-09 09:48:03 -07:00
Ivan Posva 28412d153e - Fix Isolate.spawn when running from snapshot.
- Avoid access to Isolate.resolvePackageUri when not needed. Fixes Dartium based test.

TBR

Review URL: https://codereview.chromium.org/1591573004 .
2016-01-14 23:24:07 -08:00
Ivan Posva 6d066c7e53 Add package config support to dart:isolate
- Add "static Future<Uri> get packageRoot;",
  "static Future<Uri> get packageConfig;" and
  "static Future<Uri> resolvePackageUri(Uri packageUri)" to Isolate class.
- Added "Uri packageRoot, Uri packageConfig, bool automaticPackageResolution: false" parameters to spawnUri.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1553233002 .
2016-01-12 18:19:04 -08:00
Ivan Posva b6781b656a - Implement Platform.packageRoot and Platform.packageConfig based
on the new specification.

BUG=
R=lrn@google.com

Review URL: https://codereview.chromium.org/1529063006 .
2015-12-17 07:48:41 -08:00
Ryan Macnak 9387fead15 Use a monotonic clock in the implementation of Timer.
Ask the embedder for the current time, since it is the embedder who later compares the deadline with current time when deciding when to send a wake up message.

BUG=http://dartbug.com/25055
BUG=http://dartbug.com/25216
R=iposva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1519563003 .
2015-12-11 12:39:56 -08:00
Ivan Posva ba6c0ace3e - Add getters for the current packageRoot or packageMap to the Isolate class.
- Simplify loading in builtin.dart.

BUG=
R=asiva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1334353002 .
2015-10-03 06:53:13 -07:00
Ivan Posva f63db4960c - Implement resource loading via the Resource class.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1264413002 .
2015-08-04 15:39:14 -07:00
Lasse R.H. Nielsen f8ce36df55 Add Resource class. Currently unimplemented.
R=herhut@google.com, iposva@google.com

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

Review URL: https://codereview.chromium.org//1181663002.
2015-06-26 11:42:02 +02:00
Lasse R.H. Nielsen 78a3db3128 Revert "Add Resource class. Currently unimplemented."
This reverts commit 2890a7a2a9.

Causes a dart2js test error and a significant amount of analyzer
warnings.

Review URL: https://codereview.chromium.org//1193273003.
2015-06-22 16:43:44 +02:00
Lasse R.H. Nielsen 2890a7a2a9 Add Resource class. Currently unimplemented.
R=herhut@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//1181663002.
2015-06-22 15:05:14 +02:00
srdjan@google.com 6a524865a1 Remove public int.is64Bit.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45407 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 18:53:05 +00:00
lrn@google.com f139d0e93b Add List.unmodifiable constructor.
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45334 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:48:22 +00:00
lrn@google.com 62adbb7ab0 Let Uint16List.setRange detect a String.codeUnits object, and copy directly from the string.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43327 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 09:46:04 +00:00
iposva@google.com ad008bf8ba - Move timer implementation closer to the rest of message handling.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43225 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:39:35 +00:00
iposva@google.com 2104fd6165 Fix http://dartbug.com/21834
- Ensure that microtasks fire after every timer event, instead
  of being bunched together once all pending timers fired.
- Do not wait for timer message to be delivered. Trigger timers
  as soon as they are ready from within the message handling
  loop.
- Notify timers in the order of wakeup time regardless of
  specified timeout value. (AKA Do not allow Timer.run to
  overtake new Timer() scheduled operations.)

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42673 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 22:21:59 +00:00
lrn@google.com 0dbb989cb8 Add internal operation that converts a growable list to a fixed list.
The conversion breaks the original list, but doesn't copy data.
Currently only used in List.from(Iterable).

BUG= http://dartbug.com/9458
R=floitsch@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32896 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 13:15:16 +00:00
lrn@google.com 3b3e87cabc Revert "Rename internal library dart:_collection-dev to dart:_internal."
Dartium needs updating too.

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

R=floitsch@google.com

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

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

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

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31823 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 09:24:46 +00:00