Commit Graph

42 Commits

Author SHA1 Message Date
Kevin Moore bc03bd3805 Cleanup unused vars in VM patch files
Change-Id: Ibc548921113d979df5b0ed8eb7f6ad48a553fc86
Reviewed-on: https://dart-review.googlesource.com/c/84121
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-11-13 22:56:54 +00:00
Kevin Moore 475eaee3c2 Cleanup some dynamic/Object promotion confusion from 5226b5c307
And make tweaks to Uri and StreamController equality

Change-Id: I63f85f67209442684e50b7c2e0011531893f294e
Reviewed-on: https://dart-review.googlesource.com/c/82781
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-11-03 14:05:15 +00:00
Lasse R.H. Nielsen 5226b5c307 Remove some unnecessary dynamic invocations in the platform libraries.
Change-Id: Ia72033e37c4d8292eabd95aeff97e4cb29e81823
Reviewed-on: https://dart-review.googlesource.com/c/82204
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-02 11:32:03 +00:00
Lasse Reichstein Holst Nielsen 26121608a1 Make DateTime not assume arguments are instances of the same class.
The current DateTime class takes DateTime objects as arguments,
and then tries to access private members.
That does not work if someone else implements the DateTime interface.

Fixes #34962

BUG= http://dartbug.com/34962

Change-Id: I7191fe42f5b6efc1c7da5ed8e22b892b18f872f7
Reviewed-on: https://dart-review.googlesource.com/c/81828
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-10-31 07:29:48 +00:00
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
Florian Loitsch 88f58757b1 Fix datetime for daylight-saving transitions.
Change-Id: I0ec35937a76ada32991b79bcdac57912731db489
Reviewed-on: https://dart-review.googlesource.com/14380
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-17 08:26:21 +00:00
pq d184bcef2a Revert "Fix datetime for daylight-saving transitions."[TBR]
This reverts commit 95d3298ae7.

floitsch@ to revisit and re-apply tommorrow.

Bug:
Change-Id: I54b0851fdf4b931d1718f850ffe9d467495dc745
Reviewed-on: https://dart-review.googlesource.com/14080
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2017-10-16 17:20:09 +00:00
Florian Loitsch 95d3298ae7 Fix datetime for daylight-saving transitions.
This is a temporary fix, until https://dart-review.googlesource.com/c/sdk/+/9300 works for iOS.

Fixes #30550.
BUG= http://dartbug.com/30550

Change-Id: Id8ef8508510d577023e32402d8ea6f257f2f16d1
Reviewed-on: https://dart-review.googlesource.com/14044
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-10-16 15:00:06 +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
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
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
Regis Crelier 48dc790398 Fix core lib DateTime in the VM (fixes #19923).
Symptom of the problem:
Set your Linux workstation (or Mac or MIPS board) to the Europe/London timezone
and the corelib/date_time test will fail, claiming that 1/1/1970 was a Wednesday
(it was actually a Thursday, trust me, I was already born).

Problem:
The implementation of DateTime in the VM relies on Unix time_t, the number of
seconds since the Epoch (1/1/1970 UTC). When asked for the weekday of a given
time, our implementation limits itself to a 32-bit positive range of time_t.
If the time falls outside of this range, the implementation picks an equivalent
time in the valid range with the same weekday, also in leap year or not, etc...
The issue is that DateTime is using the underlying OS in an inconsistent manner.
Let's take the example above: 1/1/1970 in the Europe/London timezone.
First, the number of seconds since the Epoch in UTC is calculated, here 0.
Then, the timezone offset at the given time is calculated using the underlying
OS. In this case, an historical deviation is taken into account. Indeed, London
stayed on British Summer Time between 27 October 1968 and 31 October 1971. See
https://en.wikipedia.org/wiki/British_Summer_Time#Periods_of_deviation for
details.
Our resulting time is therefore negative (one hour difference with UTC).
When asked about the weekday of this time, the implementation notices that the
time is not in the positive range and picks an "equivalent" time in the future.
It then asks the underlying OS about the timezone offset for this time, which
is 0 (usually no daylight saving time in January in London). Unfortunately,
this time is not really equivalent, because it ignores the original historical
deviation. The result is wrongly equivalent to 12/31/1969 23:00 in London, i.e.
a Wednesday, and not a Thursday as expected.

Solution:
We should use the underlying OS in a consistent way, by simply allowing the
value of time_t passed to the underlying OS to be negative, which is legal.

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

Review URL: https://codereview.chromium.org/1845483002 .
2016-03-30 10:09:58 -07:00
Florian Loitsch 6c84c42e67 Add microsecond support to DateTime.
R=iposva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org/1493033003 .
2015-12-09 00:46:46 +01:00
Florian Schneider b19d518ede VM: Use const instead of final for constants in runtime libraries.
It does not make a difference for optimized code (final does not help in
optimized code either btw), but allows using those constants directly in
unoptimized code.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1284873002 .
2015-08-12 09:40:22 +02:00
lrn@google.com cc0151bf2e Optimize DateTime constructor slightly.
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42656 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 13:09:47 +00:00
ajohnsen@google.com ee4ff079f5 Speed up DateTime members, by caching the results.
The result is stored in a list of ints. This turned out to be the most efficient way to store it, compared to packing in ints.

BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35303 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 06:17:39 +00:00
regis@google.com 9eb12ad303 Implement updated method overriding rules in the vm (issue 11495).
Introduce --error-on-bad-override flag and use it when generating snapshots.
Fix signature checking when patching methods.
Fix errors in patch files.
Fix receiver type of constructors.
Fix finalization of mixin application typedefs.
Update tests and status files.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26027 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-12 20:28:52 +00:00
asiva@google.com 4577abd566 Third step towards loading core library scripts directly from the sources
- Read the patch source files using the source mapping array generated for
  patch files instead of relying on a generated buffer containing the sources.

- Modify the gyp files to ensure that all patch libraries are read directly
  from the sources. Remove the source buffer generation step in the gypi
  files for all patch files.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22436 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 18:16:25 +00:00
floitsch@google.com 1743496bc2 Rename DAYS_IN_WEEK to DAYS_PER_WEEK. Add MONTHS_PER_YEAR.
BUG= http://dartbug.com/9812

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21434 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 11:29:10 +00:00
floitsch@google.com 0a26d0e20b Rename DateTime constants to full names.
BUG= http://dartbug.com/9441

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21189 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 09:23:26 +00:00
floitsch@google.com cead1d41f1 ceil/floor/truncate/round return integers.
This CL supercedes https://codereview.chromium.org/11748016/

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19810 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 18:54:37 +00:00
floitsch@google.com fb7b9e3c5c Rename Date to DateTime.
BUG=http://dartbug.com/1424

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17549 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 12:16:37 +00:00
floitsch@google.com 8e6f238f86 a === b -> identical(a, b)
Replace === null with == null.

BUG=http://dartbug.com/6380

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14794 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 17:19:58 +00:00
ajohnsen@google.com 8b6565ceea Move DateImplementation from coreimpl to core, making it private.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13980 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 17:34:36 +00:00
regis@google.com adb534674c Change core lib, dart2js, and more for new optional parameters syntax and semantics (new semantics is not enforced yet).
Review URL: https://codereview.chromium.org//11090016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13684 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 16:03:47 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +00:00
kasperl@google.com 997e534c28 Change Duration to take proper named optional parameters.
R=bak@google.com,lrn@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10905255

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12314 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 11:17:31 +00:00
kasperl@google.com 9beb871852 Get rid of a lot of () for getters.
R=bak@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10919146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12017 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 11:50:07 +00:00
dominich@google.com 494e5b228e Updated VM and JS versions of Date to allow underflow and overflow.
Added many tests to check everything is working as expected.

BUG=2771

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

Review URL: https://chromiumcodereview.appspot.com//10832166

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11522 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 15:09:14 +00:00
dominich@google.com 6d70844f1b Revert "Updated VM and JS versions of Date to allow underflow and overflow."
This reverts commit r11453.

TBR=floitsch@google.com

Review URL: https://chromiumcodereview.appspot.com//10894009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11456 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 15:48:29 +00:00
dominich@google.com 957192e887 Updated VM and JS versions of Date to allow underflow and overflow.
Added many tests to check everything is working as expected.

BUG=2771

Review URL: https://chromiumcodereview.appspot.com//10832166

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11453 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 15:31:43 +00:00
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
ager@google.com 37ae98110a Reapply "Sharing of sources for corelib date implementation between VM
and dart2js".

BUG=

Review URL: https://chromiumcodereview.appspot.com//10834353

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10799 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 08:00:02 +00:00
ager@google.com 2d1b1727ef Revert "Sharing of sources for corelib date implementation between VM and"
Revert "Fix create_sdk."

Revert "Fix bad merge. 'unified' directory is gone."

We need to update dartc to not check that final fields are initialized
for 'external' constructors (it does not have the body and
initializers for those).

R=ajohnsen@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10857029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10797 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 07:40:09 +00:00
ager@google.com d9cb56df86 Sharing of sources for corelib date implementation between VM and
dart2js.

R=iposva@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10836237

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10794 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 07:11:23 +00:00