Commit Graph

88 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen 0b58c4bd10 Change some constant declarations to lowerCase.
Retain the old values.

Reapply of https://dart-review.googlesource.com/c/sdk/+/20680 with fixes
for VM method fingerprints.

Change-Id: Ie14e7ccc3194d5561983348e6b6752728913ff4d
Reviewed-on: https://dart-review.googlesource.com/20664
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 12:59:14 +00:00
Lasse R.H. Nielsen e61fc07b58 Revert "Change some constant declarations to lowerCase."
This reverts commit c048cfb178.

Reason for revert: VM code fingerprints needs update.

Original change's description:
> Change some constant declarations to lowerCase.
> 
> Retain the old values.
> 
> Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
> Reviewed-on: https://dart-review.googlesource.com/11520
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Florian Loitsch <floitsch@google.com>

TBR=lrn@google.com,floitsch@google.com

Change-Id: I095e8198304ca4e59b39d30b0fdf0af4945e5231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 11:23:08 +00:00
Lasse R.H. Nielsen c048cfb178 Change some constant declarations to lowerCase.
Retain the old values.

Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
Reviewed-on: https://dart-review.googlesource.com/11520
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-14 11:13:04 +00:00
Peter von der Ahé 0023f99019 Changes to runtime patches so Fasta can understand them.
Change-Id: I7f8d6b110f2f0c90b131a2538240c1b81bfa1578
Reviewed-on: https://dart-review.googlesource.com/17162
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-01 15:16:04 +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
Régis Crelier db8b20107b Revert "Revert "Dart Core Lib change to support generic functions in class NoSuchMethodError.""
This reverts commit 8cf9ef22c4.

The expectations in Dart2js and Kernel tests have now been updated.

Change-Id: I9d65ff207490cfc783849b1b726db81cf56ecfc2
Reviewed-on: https://dart-review.googlesource.com/9124
Reviewed-by: Régis Crelier <regis@google.com>
2017-09-28 00:27:24 +00:00
Régis Crelier 8cf9ef22c4 Revert "Dart Core Lib change to support generic functions in class NoSuchMethodError."
This reverts commit db15f5d73b.

Dart2js and Kernel tests are comparing text that has changed because of
the core lib change.

Change-Id: I1d33716a3d6e6a077aa1f1a9ad7cc37825d31fa6
Reviewed-on: https://dart-review.googlesource.com/9082
Reviewed-by: Siva Chandra <sivachandra@google.com>
2017-09-27 21:08:20 +00:00
Régis Crelier db15f5d73b Dart Core Lib change to support generic functions in class NoSuchMethodError.
Change-Id: If7d1a8c07e4bee7ec68fede80a9d17cae0044d31
Reviewed-on: https://dart-review.googlesource.com/5329
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-09-27 17:57:41 +00: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
Jens Johansen 0a1583aa04 [kernel] Fix assert message.
This mimics the behaviour of the source-based pipeline,
i.e. instead of "manually" calling _AssertionError._create and giving
the correct parameters (wrong parameters, actually), use the helper
method _AssertionError.ThrowNew.

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

Review-Url: https://codereview.chromium.org/2940283002 .
2017-06-16 12:28:18 +02:00
Peter von der Ahé 14e9d0bd89 Prepare for improved error recovery from compile-time errors.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2931423002 .
2017-06-13 15:59:18 +02:00
Peter von der Ahé d6a766bb14 Improve NSM handling.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2927613002 .
2017-06-07 09:28:13 +02:00
Peter von der Ahé 5b94cfe33a Various infrastructure changes.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2917863003 .
2017-06-01 15:16:18 +02:00
Mike Fairhurst bffe47e678 First stab at #29153 range check in as-casts. Mostly working.
Having an issue forwarding Symbol::InTypeCheck into dart and back;
without it, the exceptions that are thrown are `TypeError`s and not
`CastError`s.

Certainly a bit longform to read, as well.

Committing for feedback/suggestions/help

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2805903004 .
2017-04-13 10:44:57 -07:00
Mike Fairhurst 761d21d414 Fix #14144 confusing error message misusing a callable object
New tests to make sure that:
* Error message calling a closure wrong is unchanged
* Error message calling a static function wrong is unchanged
* Error message calling a callable object wrong is unchanged
* Error message calling nonexist method is unchanged
* Error message calling nonexist method for a callable object is clearer

The new tests involving calling a closure wrong exposed a bug in the
inliner, it assumed (due to lack of ic data, it seems) that all closures
have the right number of arguments. Left that assertion/behavior, but
put a guard around closures specifically (since static and method calls
don't have that bug, due to I think better ic data).

Welcoming myself to the world of VMs.

BUG=
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2785623004 .
2017-03-31 15:09:02 -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é ab45caba0f Fix errors in VM patch files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2717573003 .
2017-02-27 08:55:17 +01:00
John McCutchan 1660cab84d Skip the type test for expressions which have already evaluated to true or false.
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2667353003 .
2017-02-02 11:58:29 -08:00
Kevin Millikin 50348f5f22 Fixes to patch files necessary to use the analyzer
The analyzer has a stricter patch parser than the VM.  Patch files
cannot change signatures of patched members.  Specifically, they cannot
change:

  - the return type
  - a parameter's name
  - a parameter to an initializing formal
  - an optional parameter's default value

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2612043002 .
2017-01-05 12:23:51 +01:00
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
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
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
Florian Schneider 2a40a14c7a Improve noSuchMethod error message for type objects.
This CL improves the message when trying to invoke 'call' on _Type objects. This often happens
when 'new' is forgotten ("C()" instead of "new C()")

Fixes #27651.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2507493003 .
2016-11-15 15:20:17 -08:00
Vyacheslav Egorov eb8c24e133 Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451623006 .
2016-10-27 10:09:22 +02:00
Vyacheslav Egorov 12968edb9c Revert "Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork.""
This reverts commit 4e7a31262e.

Windows bots are broken now.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451893004 .
2016-10-26 17:07:18 +02:00
Vyacheslav Egorov 4e7a31262e Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This relands commit 2fed1c3905 with fixes to ensure that analyzer summaries are correctly created and XARM build does not try to use target binaries on the host.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2453773002 .
2016-10-26 16:48:28 +02:00
Vyacheslav Egorov cf7ff42e60 Revert "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This reverts commit 2fed1c3905.

SDK builds are failing

TBR=zra@google.com

Review URL: https://codereview.chromium.org/2455593002 .
2016-10-26 13:06:27 +02:00
Vyacheslav Egorov 2fed1c3905 Merge more Kernel infrastructure from kernel_sdk SDK fork.
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
  Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
  not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.

- bring test script modifications that allow to test Kernel pipeline

BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2434123003 .
2016-10-26 13:02:54 +02:00
John McCutchan 7fd9df4d91 Improvements to NoSuchMethodError.toString
This makes the following improvements:

* Always show the call that was made, with arguments.
* ...and show the actual arguments in more cases.
* Be less confusing in the case of a call on the null receiver.
* Be less redundant in the output.
* Report when a constructor is called with the wrong number of arguments.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2405353002 .
2016-10-12 09:52:51 -07:00
Matthias Hausner 3e0d13bc28 Make compile-time errors catchable
If an error happens during the compilation of a function body, an Error is thrown which can be intercepted, and ensures that finally blocks are executed before the isolate is terminated.

The language spec is vague about compilation errors. A doc describing the intentions behind this CL is at
https://docs.google.com/document/d/1_MWOgwJadLCQSBps0zD6Rj5dG4iP1UBuiDvTMH-WMzI/edit#

Example:
     1	void bad() {
     2	    return 5
     3	}
     4
     5	void main(args) {
     6	    bad();
     7	}

Before this CL:
$ dart ~/tmp/e.dart
'file:///Users/hausner/tmp/e.dart': error: line 2 pos 11: semicolon expected
  return 5
          ^
$

After this change:
$ dart ~/tmp/e.dart
Unhandled exception:
'file:///Users/hausner/tmp/e.dart': error: line 2 pos 11: semicolon expected
  return 5
          ^

#0      main (file:///Users/hausner/tmp/e.dart:6:3)
#1      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#2      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
$

Notice that the stack trace points to the call site of bad(), not the text location of the syntax error. That's not a bug. The location of the syntax error is given in the error message.

BUG= https://github.com/dart-lang/sdk/issues/23684
R=asiva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org/2044753002 .
2016-09-16 10:10:38 -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 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 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 98033d4132 Simplify generated code for assert()
Move the assert condition check and throwing the error into
the Dart library. This eliminates one call to library code.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2073623002 .
2016-06-16 10:44:30 -07:00
Lasse R.H. Nielsen c56411d576 Make VM accept function values in assert statements.
Fix for issue #18454.

BUG= http://dartbug.com/18454

Review URL: https://codereview.chromium.org/2064663002 .
2016-06-15 10:08:39 +02:00
Ivan Posva 3884fd4e4b - Allow for loading dart:html and friends into the standalone
dart_bootstrap binary to evaluate startup and compilation
  performance.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1916793003 .
2016-05-03 20:33:14 -07:00
Regis Crelier ba69c8a898 Enumerate URIs of all types in type errors in order to help the user diagnose
the error (it was previously only printed for types with identical names).
Cleanup and simplify construction of type errors.

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

Review URL: https://codereview.chromium.org/1778133002 .
2016-03-09 15:16:47 -08:00
Regis Crelier bb649318e4 Remove support for Javascript warnings in the VM.
This cl is a clone of cl https://codereview.chromium.org/1683363002/ deleted by
accident. Already LGTM'ed.

Review URL: https://codereview.chromium.org/1690903003 .
2016-02-11 09:16:06 -08:00
Srdjan Mitrovic d503d2f0ed Added full deferred loading semantic to precompiled/--noopt/eager-loading code (some corner cases, e.g., compile-time errors for constants, still missing)
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1211273011 .
2015-07-09 10:56:55 -07:00
rmacnak@google.com 327b85d956 Move symbol demangling to dart:_internal to remove dart:core dependency on dart:mirrors.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45405 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 17:49:58 +00:00
hausner@google.com 392db8d312 Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

This is the same change as r42145, with added co19 status updates.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42170 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 18:51:48 +00:00
hausner@google.com 4cfdf02012 Revert r42145 to fix co19 tests
Review URL: https://codereview.chromium.org//772513003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42148 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 21:05:38 +00:00
hausner@google.com ad837a0d9f Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

Fixes issue 21279.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42145 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 20:36:37 +00:00
lrn@google.com e8ca26953e Reduce foot-print of Error.safeToString on strings.
Use existing JSON encoding instead of a custom encoding.
This allows dart2js to use the system JSON stringifier directly.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41704 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 06:47:17 +00:00