Commit Graph

1278 Commits

Author SHA1 Message Date
Kevin Millikin f7b6f0cf1c Make the VM's dart:core and dart:async library patches clean.
Clean up the VM's dart:core and dart:async library patches so that
they are clean according to the patching rules implemented in the
analyzer.  Specifically:

  - If a member is patched in a patch file, it must be declared external
    in the SDK.

  - If a member is introduced in a patch file, it must be private.

  - A non-private superclass member cannot be overridden in a patch
    file.

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

Review-Url: https://codereview.chromium.org/2563633002 .
2016-12-15 10:10:09 +01:00
Matthias Hausner 2c0b605a96 Add optional message argument to assert statements in the VM.
Add flag --assert-message to control the feature.

BUG=#24215
R=regis@google.com

Review-Url: https://codereview.chromium.org/2574003003 .
2016-12-14 11:05:19 -08:00
John McCutchan f125cc7d0b Improve the casing of Stackmap and Stacktrace.
- [x] Stackmap -> StackMap
- [x] Stacktrace -> StackTrace

This makes us consistent with the Dart language (StackTrace) and
corrects the casing of StackMap.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2572563004 .
2016-12-12 14:51:30 -08:00
Matthias Hausner 156fdef01d Revert "Add optional message argument to assert statements in the VM."
This reverts commit 67e83dd79d.

BUG=

Review-Url: https://codereview.chromium.org/2558993005 .
2016-12-09 09:50:27 -08:00
Matthias Hausner 67e83dd79d Add optional message argument to assert statements in the VM.
Add flag --assert-message to control the feature.

Fixes issue #24215
BUG= http://dartbug.com/24215

This replaces Lasse’s CL  1307363005

patch from issue 1307363005 at patchset 140001 (http://crrev.com/1307363005#ps140001)

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2564623003 .
2016-12-09 09:25:58 -08:00
Regis Crelier 6da1083953 Disallow deprecated typedef syntax for mixin apps in the VM (fixes #14410).
Update status files (will reassign issue #14410 to dart2js, since it still
accepts the syntax).

R=floitsch@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2556433004 .
2016-12-07 07:34:09 -08:00
Regis Crelier ab6bc6dbfd Fix delayed resolution of function result types (fixes #27760).
Resolution is delayed to properly handle generic results of generic functions.
Resolution has to be done in the library declaring the function and not in the
library declaring a mixin application mixing in the function.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2549443005 .
2016-12-02 15:22:01 -08:00
Matthias Hausner b48435197a Turn on initializing formal access
Change default value of --initializing_formal_access to true.

BUG=27892
R=regis@google.com

Review URL: https://codereview.chromium.org/2540453002 .
2016-11-28 13:15:15 -08:00
Kevin Millikin c0bfda8a08 Remove an unnecessary (empty) scope, streamline the function parsing code.
The scope containing function expressions is always empty.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2013233003 .
2016-11-25 10:24:17 +01:00
Regis Crelier 640b5ca80a Enable syntax-only generic methods in the VM by default.
R=hausner@google.com

Review URL: https://codereview.chromium.org/2486943003 .
2016-11-21 12:33:40 -08:00
Vyacheslav Egorov 23fd1a184b VM: Support bootstrapping core libraries from Kernel binaries instead of source.
BUG=http://dartbug.com/27590
R=asiva@google.com

Review URL: https://codereview.chromium.org/2485993002 .
2016-11-16 13:56:20 +01:00
John McCutchan f0f32a0e29 Map deleted enum values to a sentinel value.
Fixes #27802

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

Review URL: https://codereview.chromium.org/2498863002 .
2016-11-15 14:15:36 -08:00
Siva Annamalai e25cdc78e4 Changes for https://github.com/dart-lang/sdk/issues/27742 mark tear-offs using the x#id syntax as deprecated.
BUG=#27742
R=hausner@google.com

Review URL: https://codereview.chromium.org/2491983003 .
2016-11-11 12:09:01 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson e29da6037b Small cleanups and linter fixes.
Review URL: https://codereview.chromium.org/2455983002 .
2016-10-27 05:02:20 -07:00
Regis Crelier 3342380ff8 Avoid parsing formal type parameters a second time from inside an async body,
as default values may not be resolved correctly and may conflict with already
parsed formal parameters (fixes #27659).
Added regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2452623002 .
2016-10-25 08:11:37 -07:00
Matthias Hausner f73ea62c99 Add check for constness in constructor redirection
Const constructor can only redirect to another const constructor.

BUG=#27617
R=regis@google.com

Review URL: https://codereview.chromium.org/2439593003 .
2016-10-19 15:15:02 -07:00
John McCutchan 8061bd5a8a Add local variable declaration token position to service protocol
- [x] Add three public fields to the "BoundVariable" service type: declarationTokenPos, visibleStartTokenPos, and visibleEndTokenPos. (naming suggestions welcome!)
- [x] Extend LocalVarDescriptors to hold the declaration token position (it already had the scope visibility boundaries).
- [x] Extend ContextScope to hold the declaration token position.
- [x] Add a unit test which verifies this works for local variables, function parameters, and closure captured variables.

Fixes https://github.com/dart-lang/sdk/issues/25569

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2419013004 .
2016-10-17 11:18:24 -07:00
Vyacheslav Egorov f67ce21068 VM support for running Kernel binaries.
BUG=
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org/2411823003 .
2016-10-15 22:48:46 +02:00
Florian Schneider a0380ffaf6 Fix assertion failure with deferred prefixes.
When running with --load-deferred-eagerly, we don't need to collect
functions for invalidation, but instead insert runtime checks  if
the prefix if loadLibrary was called loaded or not.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2415743004 .
2016-10-14 10:20:46 -07:00
Lasse R.H. Nielsen efb9a12811 Add = as default-value separator for named parameters.
Fixes issue #27559.

BUG= http://dartbug.com/27559
R=asiva@google.com, eernst@google.com, floitsch@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2411633002 .
2016-10-14 11:25:25 +02:00
Jacob Richman 72503ff98d Extend ignore_patch_signature_mismatch used by dartium to ignore type parameters with different bounds
BUG=https://github.com/dart-lang/sdk/issues/27568
R=asiva@google.com

Review URL: https://codereview.chromium.org/2405193004 .
2016-10-12 17:25:55 -07:00
Florian Schneider d99229026e Fix issues with argument evaluation order and noSuchMethod errors.
Fix tests to conform to spec bahavior.

Update dart2js test status.

BUG=#27572
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2416513003 .
2016-10-12 17:04:55 -07:00
Regis Crelier ba2c6e397c Remove redundant code in parser.
R=zra@google.com

Review URL: https://codereview.chromium.org/2411303003 .
2016-10-12 10:10:21 -07:00
Matthias Hausner 43e338d437 Treat generic method parameters as dynamic in all contexts in the VM (fixes #27460)
Review URL: https://codereview.chromium.org/2383993002 .
2016-10-03 09:11:34 -07:00
Regis Crelier b91d74172a Make sure unresolved function type parameter bounds do not end up in snapshot.
Read and write parent_level field of function type parameters in snapshots.
Update TypeParameter::ToCString() to handle function type parameters.
Address Siva's comments in previous cl.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2359543003 .
2016-09-20 13:18:01 -07:00
Regis Crelier 11562f6874 Support generic method syntax (fixes #25869).
Function type parameters are parsed and resolved, but mapped to malformed types
(i.e. dynamic) until full support is implemented.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2349593003 .
2016-09-19 15:17:33 -07:00
Matthias Hausner 3e60d48842 Fix parsing of generic closure formal parameter
BUG=#27299
R=regis@google.com

Review URL: https://codereview.chromium.org/2341493002 .
2016-09-13 15:11:10 -07:00
Matthias Hausner 3829c00e10 Improve compile time constant evaluation
Eliminate the need to invoke an execute-once function to compute
type literals and implicit closures. This reduces the number of
execute-once invocations from 6000 to 60 when compiling all of
the greentea sources, about 1MB of generated code. Sadly, no
significant runtime gain was observed.

Also simplify the caching of computed compile-time constants.

Reinstate the compiler stat counter for number of constants cached.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2338463003 .
2016-09-12 16:23:00 -07:00
Matthias Hausner c15bac4812 Ensure that constant field initializers are canonicalized
In const constructors, field initializer values that are known
to be compile-time constants should be evaluated and canonicalized
at compile time.

BUG=#27164
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2300113002 .
2016-09-01 13:23:20 -07:00
Matthias Hausner e1e4a950ad Remove legacy patch class syntax in VM
This should now work since the last remaining uses of legacy
patch syntax in Dartium are gone.

This reverts commit 04b8a627d6.

BUG=

Review URL: https://codereview.chromium.org/2292213002 .
2016-08-30 10:54:52 -07:00
Matthias Hausner 04b8a627d6 Backing out change that removed legacy patch syntax
Dartium test html/async_spawnuri_test is failing when legacy
patch class syntax parsing is removed.

Once dartium is fixed, this change can be re-applied.

TBR=terry

Review URL: https://codereview.chromium.org/2274663004 .
2016-08-24 16:48:50 -07:00
Lasse R.H. Nielsen 99439a336a See: https://docs.google.com/document/d/1iEuLbDMgbB657R5aFj9EfnT6B0obzQk93Of7CfWKc00/edit#heading=h.9ixvz54wwawi
Implement assert in initializer list in VM.

R=hausner@google.com

Review URL: https://codereview.chromium.org/2002923002 .
2016-08-24 12:43:26 +02:00
Matthias Hausner 4d4ebafad3 Implement parsing support for generic functions
Take two. (This version adds status file entries for checked
tests.)

Type parameters and arguments are parsed but ignored. Proper
handling of the parameters will be added subsequently.

The feature must be enabled with --generic-method-syntax.

Compiling all of dart2js consumes about 2.2% more tokens with
this change, due to the necessary lookahead to distinguish
generic functions from generic types.

===== with this change =========

Number of tokens:        1056691
Source length:           5850143 characters
Number of source tokens: 936226

Total tokens consumed:   3628934  <<<<<
Classes parsed:          2457
  Tokens consumed:       977999
Functions parsed:        49607
  Tokens consumed:       2430638

===== without this change ======

Number of tokens:        1056691
Source length:           5850143 characters
Number of source tokens: 936226

Total tokens consumed:   3547765 <<<<<
Classes parsed:          2457
  Tokens consumed:       942536
Functions parsed:        49607
  Tokens consumed:       2371357

(This reverts commit a1edb1766fd16b1268f3506feb7c9856b32bedfc.)

BUG= 25869

Review URL: https://codereview.chromium.org/2269693002 .
2016-08-22 10:58:55 -07:00
Matthias Hausner a1edb1766f Revert "Implement parsing support for generic functions"
This reverts commit 19af852471.

Checked tests failed. Will work on this on Monday.

TBR=asiva

Review URL: https://codereview.chromium.org/2267473002 .
2016-08-19 16:40:03 -07:00
Matthias Hausner 19af852471 Implement parsing support for generic functions
Type parameters and arguments are parsed but ignored. Proper
handling of the parameters will be added subsequently.

The feature must be enabled with --generic-method-syntax.

Compiling all of dart2js consumes about 2.2% more tokens with
this change, due to the necessary lookahead to distinguish
generic functions from generic types.

===== with this change =========

Number of tokens:        1056691
Source length:           5850143 characters
Number of source tokens: 936226

Total tokens consumed:   3628934  <<<<<
Classes parsed:          2457
  Tokens consumed:       977999
Functions parsed:        49607
  Tokens consumed:       2430638

===== without this change ======

Number of tokens:        1056691
Source length:           5850143 characters
Number of source tokens: 936226

Total tokens consumed:   3547765 <<<<<
Classes parsed:          2457
  Tokens consumed:       942536
Functions parsed:        49607
  Tokens consumed:       2371357

BUG=25869
R=asiva@google.com

Review URL: https://codereview.chromium.org/2260693002 .
2016-08-19 16:21:00 -07:00
Matthias Hausner 3f93791991 Class fields cannot be declared to be of type void
Add a test case and detect void fields.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2248943002 .
2016-08-15 17:14:58 -07:00
Matthias Hausner cf6a6e6e63 Remove legacy patch class syntax in VM
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2247073002 .
2016-08-15 15:23:49 -07:00
Ryan Macnak e09f2f940e Reload: Don't crash when a tearoff adds arguments and is called with too few.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2241603004 .
2016-08-12 13:06:35 -07:00
Matthias Hausner 1a6d1eca32 Implement @patch annotation for patch class members
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.

Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2230383003 .
2016-08-10 12:54:57 -07:00
Matthias Hausner f56654e882 Put patch syntax warning behind a flag
Fixes Dartium tests, which choke on the additional output introduced
by the warning.

TBR=vegorov

Review URL: https://codereview.chromium.org/2233493002 .
2016-08-09 13:01:12 -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
Matthias Hausner 643fdb9dc8 Implement the language change that makes initializing formal parameters visible in the initializer list, but not in the constructor's body.
The feature is enabled with the flag --initializing-formal-access.

BUG=26655, 26656
R=regis@google.com

Review URL: https://codereview.chromium.org/2051213005 .
2016-08-04 11:24:25 -07:00
Ryan Macnak 5f4a685cd7 Reload: Have dangling extracted properties raise NoSuchMethod.
Closes #26995

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2204593011 .
2016-08-04 09:54:40 -07:00
Matthias Hausner 478e0db389 Eliminate remaining case of ambiguous context level info
When generating the scopes in an await-for loop, make sure the scope
of the loop block is a proper sub-range of the block surrounding
the loop.

This eliminates the last case where the compiler generated context
info of the same range, but with contradicting context level info.

BUG=26941
R=regis@google.com

Review URL: https://codereview.chromium.org/2201203002 .
2016-08-02 14:44:29 -07:00
Regis Crelier f3ad2b77cc Set correct token position range for statement block containing moveNext call of
for-in loops (second attempt at fixing #26941).

R=hausner@google.com

Review URL: https://codereview.chromium.org/2193113002 .
2016-07-29 13:29:09 -07:00
Vyacheslav Egorov 239bb524d2 Remove unnecessary capturing code from the Parser::CreateImplicitClosureNode.
BUG=
R=hausner@google.com, regis@google.com

Review URL: https://codereview.chromium.org/2164323002 .
2016-07-29 13:31:28 +02:00
Regis Crelier 48060a653f Reverting bad fix of issue #26941.
Review URL: https://codereview.chromium.org/2179903009 .
2016-07-28 12:39:49 -07:00
Regis Crelier 47cf4c1877 Set correct token position in moveNext call of for-in loops (fixes #26941).
R=hausner@google.com

Review URL: https://codereview.chromium.org/2188763003 .
2016-07-27 18:15:20 -07:00
Ryan Macnak d37ea681f5 RELOAD: Check if an implicit closure needs rebinding at compile time and adjust closure equality.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2187433006 .
2016-07-27 16:51:11 -07:00