Commit Graph

43 Commits

Author SHA1 Message Date
Vijay Menon dd16c377fb Enable more async code on node
This is primarily for easier testing/repro on node which has "global",
but not "self".

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2558133002 .
2016-12-07 10:52:04 -08:00
Bob Nystrom aa749dbd8d Sprinkle some types on the SDK like the static typing fairy.
When I'm looking at the dynamic call profiles of an internal app test,
I see a bunch coming from the SDK itself. In fact, the top five most
common dynamic call sites are in the SDK.

This fixes four of them. (The fifth is in runUnary() in Zone, and I
don't think can be made typed yet.)

R=vsm@google.com

Review URL: https://codereview.chromium.org/2542723003 .
2016-11-30 17:04:54 -08:00
Alan Knight 667fc8dbe9 Make the dart:developer library available in DDC so debugger statement works
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/2534263002 .
2016-11-29 16:13:45 -08:00
Vijay Menon 88c5dd5745 Better mirrors support for mixins and private fields
This is generally motivated by pageloader usage.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org/2535273002 .
2016-11-29 14:00:01 -08:00
Bob Nystrom 20e402c43d Fix type errors in math.min() and math.max().
Really, this works around them, but the workaround is all round better
code.

Remove the Dart implementations of min() and max() and just forward to
the JS ones. In DDC, all numbers are double, so the type checks to
handle them specifically aren't meaningful. Also, we don't need the
other special case checks in there to help dart2js optimize them.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2386493003 .
2016-09-30 13:18:07 -07:00
Bob Nystrom 8c7dd5cd04 Cast InternalMap to Map.
It's a tag interface that doesn't declare that it implements Map but all
classes that implement it also implement Map, so just do a cast.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2304323002 .
2016-09-08 16:23:45 -07:00
Stephen Adams aea2fa1291 Update Symbol.hashCode
New dart2js version avoids inefficient String.hashCode

TBR=vsm@google.com

Review URL: https://codereview.chromium.org/2040963005 .
2016-06-06 12:34:59 -07:00
Stephen Adams 73479a600c Throw TypeError instead of CastError for type coercions.
Added 'tag' type StrongModeError, implemented by all errors that are
specific to strong mode semantics.

Failed casts throw CastError(Implementation) or StrongModeCastError.
Failed type assertions and reified coercions throw TypeError or
StrongModeTypeError.

Triaged some tests. Some pass due to now throwing a TypeError, many
pass for unknown reasons.

R=leafp@google.com

Review URL: https://codereview.chromium.org/2026133002 .
2016-06-01 10:18:17 -07:00
Stephen Adams 0235eba4b9 Updates to collection_patch.dart
BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/1987043002 .
2016-05-18 15:10:40 -07:00
Stephen Adams 69337e11d4 Minimal patch to collections to use correct LinkedHashMap for map literals.
TBR=leafp@google.com

Review URL: https://codereview.chromium.org/1982953002 .
2016-05-16 20:26:49 -07:00
Vijay Menon 88870d0194 Migrate dart2js stubs for dart:io
Modifies tests to use our SDK.  Didn't prune io dependences to make
sure the stubs above work.  :-)

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1976103003 .
2016-05-16 08:23:41 -07:00
Bob Nystrom 4a51a187d3 Upgrade to the latest dart:convert.
This fixes html_escape_test as well as codec1_test.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1978963002 .
2016-05-13 16:33:35 -07:00
Harry Terkelsen 382996f41c update dart:math
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1967773005 .
2016-05-12 09:03:11 -07:00
Stephen Adams 098508c533 Update _charCodeApply, makeFixedStringUnmodifiable
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1969683002 .
2016-05-10 18:44:33 -07:00
Stephen Adams a2ebf2ada1 Speed up String.fromCharCodes a bit
About 4x speedup of convert/ascii_test.dart by removing dsend in inner loop.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1968783002 .
2016-05-10 17:30:19 -07:00
Harry Terkelsen 32fd2f8215 update Map
R=sra@google.com

Review URL: https://codereview.chromium.org/1963723003 .
2016-05-10 16:19:19 -07:00
John Messerly a7f812b676 fix #552, Object members on native types
We initially hard coded a few of these. That worked until native_typed_data and html were added. Those two libraries have a lot of native types.

This also fixes TypeRep to extend dart:core Object, and fixes the dart:_runtime so we can write Dart classes. Cleans up a few of the JS builtins as well.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1962823002 .
2016-05-10 11:35:38 -07:00
Bob Nystrom e535970604 Update dart:convert and dart:core Uri.
I started trying to get the convert tests all cleaned up and passing
but realized I was going down a rathole. So, for now, all of the slow
or failing ones are just skipped.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1965563003 .
2016-05-10 10:25:38 -07:00
Stephen Adams a5d1626299 Update date_time.
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1952133007 .
2016-05-06 17:52:21 -07:00
Stephen Adams 090110fb65 Update native_typed_data
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1956993003 .
2016-05-06 17:26:25 -07:00
Stephen Adams 7bd37f015f Upgrade StringBuffer, identical
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1957633002 .
2016-05-05 21:11:09 -07:00
Stephen Adams bf4e10e356 Update String.fromCharCodes from sdk
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1952223006 .
2016-05-05 20:52:27 -07:00
Bob Nystrom a191ce0384 Update dart:async to match the Dart repo.
R=vsm@google.com

Review URL: https://codereview.chromium.org/1953153002 .
2016-05-05 15:03:10 -07:00
Bob Nystrom 44db042cd8 Redo how Type objects are exposed from DDC.
- Instead of using the raw runtime type that DDC uses for its type
  checks, use a WrappedType that correctly implements Type's interface.
- Compile class literals to wrap the type in a WrappedType.
- Make Object.runtimeType() do the same thing.

Fixes #488. Fixes #511.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1944483002 .
2016-05-03 14:24:08 -07:00
Stephen Adams 6485751d8c Implement Map.unmodifiable
This is a temporary solution.
When we have an implementation of const maps, we should switch to that.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1946663002 .
2016-05-03 12:02:20 -07:00
Vijay Menon 6d8dc11397 Suppress extra cast
If I rebuild the SDK, I see a cast from List to List<E> on the next line without this.  With the change, we just infer List<E> in the first place.

R=sra@google.com

Review URL: https://codereview.chromium.org/1945793002 .
2016-05-03 10:30:17 -07:00
Stephen Adams 1aa00bc447 List.unmodifiable
Most operations don't check, that will happen as more code is updated
to a more recent sdk.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1939093003 .
2016-05-03 09:34:44 -07:00
Jacob Richman eef7f81d0a Land fix to StackTrace.current performance already landed in dart2js.
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1927813002 .
2016-04-28 09:28:25 -07:00
Vijay Menon ce985ef38d Support StackTrace.current
This was recently added to the Dart SDK.  Breaking Angular in DDC via stack_trace package.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1720473002 .
2016-02-19 14:25:21 -08:00
Vijay Menon e907ebb106 Fixes #408
This is a bug on JSON.decode.  This should match the hand fix in #404.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1579223002 .
2016-01-12 14:17:40 -08:00
John Messerly 28f1e80cd6 fix some errors in our SDK, mostly around numbers, see issue #103
also improved codegen of JSNumber's methods

R=leafp@google.com

Review URL: https://codereview.chromium.org/1348453004 .
2015-09-18 17:10:02 -07:00
John Messerly c2e65df22c fixes #168, dart:js implementation with a test
R=vsm@google.com

Review URL: https://codereview.chromium.org/1200233004.
2015-06-25 13:18:52 -07:00
Leaf Petersen 695ae10131 Delete dart2js specific private library code.
This trims out a large chunk of the more obviously dart2js specific stuff from js_helper.dart and its dependencies.

BUG=
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1152333009
2015-06-05 09:52:18 -07:00
John Messerly 6c3cdd707d fixes #40, extension methods for primitive types
fixes #138, extension methods for Iterable/List injected as needed, regardless of how the methods started

fixes #142, extension methods and dynamic dispatch

small change that fixes #139, recognize that '.length' doesn't need an extension method

Also restores JSArray, moved the methods out of List, which is back to just being an interface.

NOTE: this removes the capability of types that mix native JS members and some Dart extension members, instead it now *hides* all JS members for these native types. We'll want to bring that feature back to support dart:html, so it's just a simplification for now. Should be easy to add that capability when we pull in dart:html for reals.

R=leafp@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1153003003
2015-06-04 14:58:18 -07:00
Vijay Menon 3377d2b7c5 Angular workarounds
- Workaround for symbolized methods (e.g., core.$map)
- dload/dput workarounds
- NSM workaround
- generic method type check workarounds

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1131143002
2015-05-14 12:47:32 -07:00
Leaf Petersen bf567bb94b Typing fixes to eliminate casts/dcalls
Tightens up some typing issues (mostly in the collections) to eliminate some casts and dynamic calls.  Also adds inference through parenthesized expressions.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1122313002
2015-05-05 16:47:19 -07:00
Leaf Petersen 071e6d0d46 SDK fixes
This fixes all of the static errors from generating the SDK except those in the _interceptors library, and a set of errors associated with checks of the form (v is E) for generic type parameter E.  Most of the fixes consist of adding missing generic parameters, or making overrides consistent.  There are a few fixes to resolve issues around code that moved implicitly between hidden implementation classes and their public API classes, and some other miscellaneous fixes.

All of my changes are in the tool/input_sdk directory - the rest of the diff is generated code.

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1112403004
2015-05-05 10:58:33 -07:00
John Messerly 36373f06f2 add checks needed for covariant generics, and fixes #154, List<E> now has the right runtime type.
R=leafp@google.com

Review URL: https://codereview.chromium.org/1117793002
2015-05-01 14:11:52 -07:00
Vijay Menon 0d49f0175a Generate static calls for Object fields and methods
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1100633006
2015-04-23 14:23:39 -07:00
Jacob Richman 2a1e4985d4 fuse List and js Array together and a few other misc fixes.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1071393007
2015-04-22 17:23:31 -07:00
John Messerly af584262c5 fix list initializers
also removes the int.parse hack, adds a special case to dindex instead.

R=jacobr@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1093353004
2015-04-21 11:25:03 -07:00
John Messerly e1c8e996b7 Replace dart_core.js with actual compiled SDK
Almost no calls are going to work at this point, but core.js can load
now and there is enough in place to continue to load sunflower.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1020043002
2015-03-20 09:41:00 -07:00
John Messerly 807d3b3b22 reorganize SDK inputs
it's all under input_sdk now:
  lib -> the lib folder
  private -> the dart:_* libs
  patch -> the files with @patch

I imagine we'll try and focus changes on the last two
2015-03-02 16:00:53 -08:00