Commit graph

47898 commits

Author SHA1 Message Date
Jens Johansen
80860e7fb7 [kernel] Stream kernel_reader
Mostly stream kernel_reader, i.e. the code that sets up the libraries,
classes, methods etc.

Mostly because it still takes a "Program" ast node, and looks at the
"Library" ast nodes to get their kernel offset in the binary.
Currently the scripts (containing breakable points etc) are also created
from the ast nodes.

The rest is now streamed.
This also means that more ast visitors could be deleted.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2931813002 .
2017-06-21 14:58:58 +02:00
Dmitry Stefantsov
8d583bde5b Revert "VM(RegExp): Allow OSR optimization of RegExp :matcher functions."
This reverts commit d87cc52c3e.

TBR=vegorov@google.com

Review-Url: https://codereview.chromium.org/2947143002 .
2017-06-21 14:17:21 +02:00
Jens Johansen
d03a0d798e Re-insert linebreak in dwarf_stack_trace_test
This file was auto-formatted 2 months ago.
This - among other things - removed a linebreak which shifted linenumbers
by one, but didn't update the expected linenumbers from a throw accordingly.
Somehow the testserver has claimed that this has passed until now.
I have no idea how that happened.

This CL re-introduces the linebreak by inserting a comment,
which (currently) forces dartfmt to have the wanted linebreak.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2945273002 .
2017-06-21 13:47:38 +02:00
Vyacheslav Egorov
d87cc52c3e 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.

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).

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

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2950783003 .
2017-06-21 13:46:48 +02:00
Jens Johansen
202306f39b [kernel] Fix loading of type argument in catch.
Catch simply gave NullConstant as arguments to _instanceOf,
now I've copied what the IsExpression does, and made
LoadInstantiatorTypeArguments actually work in this case
(by filling out the scopes_->this_variable value,
by actually visiting the catch guard in the scope builder
rather than skipping it).

Fixes #29553.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2938173002 .
2017-06-21 10:56:21 +02:00
Jens Johansen
ccf5c13127 [kernel] Update vm.status file for mac
4b9f8eb460 didn't update the status file properly.

BUG=

Review-Url: https://codereview.chromium.org/2945253002 .
2017-06-21 10:34:30 +02:00
Jens Johansen
29036d398b [kernel] Fix loss of supertype arguments.
Before this, if a generic class was instantiated with only dynamic,
TypeArgument::null would be used as the type argument, ignoring
types from the super.
Now it only returns TypeArguments::null if the class directly gives all
type arguments (and they are all dynamic).

Fixes #29537

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2941983002 .
2017-06-21 10:22:40 +02:00
Johnni Winther
0600f0ad9a Add closure_test for kernel based members
+ change id_equivalence_test to check kernel from .dill

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2951723002 .
2017-06-21 09:52:46 +02:00
Jens Johansen
4b9f8eb460 [kernel] Add TokenPosition to AllocateObject, fix some cc tests
- Add TokenPosition to AllocateObject
  meaning that kernel more often has a TokenPosition available.
  This might influence profiling, especially it influences some
  of the vm/cc/Profiler* tests.

- Update profiler_service to also be able to find the current token
  via kernel (as opposed to either returning NULL or crashing).
  This makes use of the source code included in the kernel file.

BUG=
R=kmillikin@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2944433003 .
2017-06-21 09:41:16 +02:00
Jens Johansen
be9a3043aa [kernel] Make fasta call a new constructor on FallThroughError
On a switch fall through error, Fasta currently generates
```
throw new core::FallThroughError::•();
```

which generates the error-message via the VM:
```
'null': Switch case fall-through at line null.
```

This introduces a new constructor taking a url and a linenumber,
which then can give a better error message.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2951453002 .
2017-06-21 08:40:59 +02:00
William Hesse
823e7c6b03 Revert "Merge branch 'co19roll'"
This reverts commit 42cc7d570c.

BUG=
TBR=sortie@google.com

Review-Url: https://codereview.chromium.org/2952573003 .
2017-06-21 07:15:25 +02:00
William Hesse
42cc7d570c Merge branch 'co19roll'
Update co19 status files with results from buildbot.

Update co19 to revision dec2b67aaab3bb7339b9764049707e71e601da3d

BUG=
R=sortie@google.com

Review-Url: https://codereview.chromium.org/2948763003 .
2017-06-21 06:34:55 +02:00
Terry Lucas
092cbd561d Support for IPV6 for observatory in Dartium.
R=rmacnak@google.com
BUG=62811100

Review-Url: https://codereview.chromium.org/2944303003 .
2017-06-20 19:32:01 -07:00
Ryan Macnak
1905d2bbe2 Consider Contexts to be user objects for purposes of Obervatory's dominator analysis.
User data in may be reachable only through a closure's environment, represented as a Context object. Note we still don't consider Functions to be user objects here, and so avoid blaming the size of compiled code against any user object.

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2947673002 .
2017-06-20 16:59:29 -07:00
Alan Knight
12e93cc41e Revert "Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658."
This reverts commit 9755a98b00.

BUG=

Review-Url: https://codereview.chromium.org/2949943002 .
2017-06-20 15:25:55 -07:00
Ryan Macnak
dd996fc4be [fuchsia] Make symbols in the Dart VM visible, so they are available to the profiler.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2946123002 .
2017-06-20 15:21:07 -07:00
Paul Berry
e981c6fdbc Add tests of null-aware constructs in void contexts.
Fasta desugares some expressions differently in void contexts, so to
be on the safe side, we should test that null-aware invocations and
property accesses work in both void and non-void contexts.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2948843002 .
2017-06-20 15:12:01 -07:00
Paul Berry
5dd84a802e Only set types of conditional expressions in strong mode.
In spec mode the types aren't meaningful anyway (due to the fact that
the spec mode type system is unsound), and they don't match the
behavior of Rasta (causing bot failures).

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2953503002 .
2017-06-20 14:59:29 -07:00
Ben Konyi
9755a98b00 Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658.
BUG=
R=zra@google.com

Example:
Foo {
  final int x = 10;
  Foo(this.x); // Error
  Foo.named() : x = 42; // Error
}
Review-Url: https://codereview.chromium.org/2947043002 .
2017-06-20 14:40:36 -07:00
Zachary Anderson
8bf8623eb4 [infra] Uses github mirror for protobuf and tuple.
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2946923002 .
2017-06-20 12:35:24 -07:00
Siva Chandra
b9bf4fcc48 Remove vmservice_patch.dart.
The code in the patch is now inlined into the vmservice library.
This is being done because, the vmservice related libraries are
now compiled directly from source instead of from the "patched_sdk".
So, what is being compiled now does not have the vmservice_patch
applied. By removing the patch, we are removing the need to
artificially patch the vmservice library and making the
vmservice_io.dill complete.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2946773002 .
2017-06-20 12:24:16 -07:00
Paul Berry
d514347a44 Add type inference for null-aware method invocations.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2950923002 .
2017-06-20 12:16:34 -07:00
Mike Fairhurst
47c9dcad97 Update plugin whitelist to accomodate angular plugin rename
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2947953002 .
2017-06-20 12:01:51 -07:00
Paul Berry
eadfe2816b Record static types in the desugaring of null-aware property gets.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2946943002 .
2017-06-20 11:29:50 -07:00
Brian Wilkerson
5582824e3c Rename the plugin location key and directory name
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2952583003 .
2017-06-20 11:06:39 -07:00
Paul Berry
d0f8a47f33 Rename "field" -> "accessor" in several type inference methods.
No functional change.  This just adjusts nomenclature to reflect the
fact that much of the type inference logic for dealing with fields
also applies to getters/setters.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2948773002 .
2017-06-20 10:34:27 -07:00
Jennifer Messerly
070f31a899 optimize null safe ops by using DDC's let abstraction
We were already using it for most other things (increment ops, op assign, ??, cascades, etc)

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2944413002 .
2017-06-20 10:31:30 -07:00
Dan Rubel
d0910ce078 translate fasta parser error to analyzer error
* translate fasta parser BuiltInIdentifierAsType error to analyzer error
* remove unused error listener field

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2944383002 .
2017-06-20 13:18:48 -04:00
Dan Rubel
966d1a4701 integrating fasta parser
* start integrating fasta parser into analyzer
* extract new Scanner.fasta factory

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2948473002 .
2017-06-20 12:24:13 -04:00
Terry Lucas
97d188418a Update to latest WebKit changes:
- Fix DevConsole crash with JS see Issue https://github.com/dart-lang/sdk/issues/29873
     CL https://codereview.chromium.org/2941143002
- Fix debugging in WebStorm, NULL returned for JS objects see Issue https://github.com/dart-lang/sdk/issues/29854
     CL https://codereview.chromium.org/2945063002

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2952643002 .
2017-06-20 09:08:00 -07:00
Erik Corry
dfb67ecbf8 VM-codegen: Clean up the way we emit code for comparison instructions.
Removes some redundancy in the Emit* methods in intermediate_language_*.cc for
the 6 architectures we support.

This is a reapplication of https://codereview.chromium.org/2937933002/ -
see the comments there.  It fixes a bug in the way the TestCids
instruction was emitted on DBC.

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2947633002 .
2017-06-20 17:41:12 +02:00
Kevin Millikin
9d495064f7 Improve --print-ast printing of LetNode.
I was trying to debug an issue noticed that printing of LetNode is
kind of useless.  It didn't print the variables though they had
references, which seems confusing, and it writes all the initializers
and body nodes at the same nesting level which makes it impossible to
see where one ends and the other begins.

BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2946903002 .
2017-06-20 16:49:10 +02:00
Brian Wilkerson
24996fbfe7 Add support to pass the location of the analysis options file to plugins
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2947743002 .
2017-06-20 07:41:03 -07:00
Paul Berry
1594006758 Print static types of conditional expressions.
I want to start testing that Fasta sets the static types of
conditional expressions correctly, so I need Fasta's expectations
files to include them.

This CL just adds the static types to the printing logic in
ast_to_text.dart and updates expectations so that the tests continue
to pass.  I will make behavioral changes to Fasta in future CLs.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2949753002 .
2017-06-20 07:33:54 -07:00
Brian Wilkerson
5976c78a79 Handle unresolved constructor (issue 29925)
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2944083002 .
2017-06-20 06:16:23 -07:00
Paul Berry
be01632bc0 Fix type inference of getters that "override" setters and vice versa.
Normally getters and setters are considered distinct and unrelated by
the type inference algorithm.  However, if a getter has no declared
type and doesn't override anything, then we fall back on inferring its
type from an inherited setter, and vice versa.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2946733003 .
2017-06-20 05:34:31 -07:00
Jens Johansen
5472eb7831 [kernel] Don't emit field initializers in a redirecting constructor
BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2940323002 .
2017-06-20 13:54:25 +02:00
William Hesse
ea2167bbac Make debian package builder more robust in uninstall step
BUG=
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2950783002 .
2017-06-20 13:34:54 +02:00
Lasse R.H. Nielsen
52691c6937 Add informal specification for optional-new/const, constructor tearoffs.
R=floitsch@google.com

Status: under discussion
Review-Url: https://codereview.chromium.org/2929753003 .
2017-06-20 13:21:36 +02:00
Jens Johansen
c649557584 [kernel] Check type for list literals
BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2949493002 .
2017-06-20 13:04:08 +02:00
Johnni Winther
e41d0a63c2 Compute KernelClosureRepresentationInfo.variableIsUsedInTryOrSync
This handles one of the current inequivalences on hello world from dill.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2938203003 .
2017-06-20 12:45:51 +02:00
Johnni Winther
4a31a0be47 Add closure_test
- currently only for AST-based elements; IR-based to come

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2950493002 .
2017-06-20 12:27:19 +02:00
Jens Johansen
0462a5a991 [kernel] Cleanup kernel code.
This deletes some visitors and the can_stream field in the Ast.
This should be seen as a cleanup for now-unused code now that we're streaming.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2931803002 .
2017-06-20 09:49:57 +02:00
Jens Johansen
2a7a410c93 [kernel] Streaming refactorings.
Refactorings.
Mostly about only reading FunctionNode one place by introducing a
helper class that will read and skip what it is told.
For 'nested' things inside the function node (e.g. the body),
the caller for the helper still needs to handle it if it shouldn't
just be skipped.
'Non-nested' things (e.g. integers) are saved and can be fetched
by the caller.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2921613003 .
2017-06-20 09:22:52 +02:00
Emily Fortuna
8ba4f78dd3 Revert "Reapply "Minor adjustment to usage of the ClosureClassRepresentation interface.""
This reverts commit d9c6ae3438.

BUG=

Review-Url: https://codereview.chromium.org/2944163003 .
2017-06-19 17:49:21 -07:00
Emily Fortuna
d9c6ae3438 Reapply "Minor adjustment to usage of the ClosureClassRepresentation interface."
This reverts commit 0ee0717cc3.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2944073003 .
2017-06-19 17:39:20 -07:00
Ben Konyi
a4a227e375 Revert "Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658."
This reverts commit b5cff3f68f.

TBR=zra@google.com

Review-Url: https://codereview.chromium.org/2944223002 .
2017-06-19 17:23:01 -07:00
Emily Fortuna
0ee0717cc3 Revert "Minor adjustment to usage of the ClosureClassRepresentation interface."
This reverts commit 85f37133f9.

BUG=

Review-Url: https://codereview.chromium.org/2946843002 .
2017-06-19 17:11:17 -07:00
Emily Fortuna
85f37133f9 Minor adjustment to usage of the ClosureClassRepresentation interface.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2947763002 .
2017-06-19 16:42:37 -07:00
Ben Konyi
0555d5e176 More status file updates to fix bot failures caused by parser change.
BUG=

Review-Url: https://codereview.chromium.org/2943413002 .
2017-06-19 16:24:30 -07:00