Commit graph

12026 commits

Author SHA1 Message Date
Stephen Adams 50e557d176 Prevent inlining of js_library core.RegExp constructor
Inlining was achieving no beneficial effect.

- Enabled GVN of match start.
- Made string quote style uniform.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2437863002 .
2016-10-19 16:25:11 -07:00
Stephen Adams 3b5c154138 Don't gvn HForeignCode without source text
There are a few synthetic templates that are generated from trees instead of source text. I don't think any are marked for GVN, but this is a hazard so best fix it.

TBR=sigmund@google.com

BUG=

Review URL: https://codereview.chromium.org/2431103003 .
2016-10-19 14:46:54 -07:00
Brian Wilkerson b3f66b03a1 Provide an extensible form of ToSourceVisitor (issue 27169)
R=matan@lurey.org

Review URL: https://codereview.chromium.org/2429243003 .
2016-10-19 14:31:21 -07:00
Paul Berry 84ec7f01c0 Make visibleLength/visibleOffset informative.
These summary fields are related to source offsets, so they are
affected by minute changes to the source code that don't affect its
API; therefore they should be marked as "@informative" so that they
don't appear in API summaries.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2432183003 .
2016-10-19 14:24:42 -07:00
Paul Berry 4729ba0055 In DeclarationResolver, handle generic function-typed parameters.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2441483002 .
2016-10-19 14:21:52 -07:00
Konstantin Shcheglov bf43e4b43e Validate local resolution scope, and compute initial name scope.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2439583003 .
2016-10-19 14:08:46 -07:00
Paul Berry 148af481ff Fix DeclarationResolver handling of annotations containing closures.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2436733004 .
2016-10-19 13:23:11 -07:00
Paul Berry d631a142a4 Create a README and pubspec for the front_end package.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2436733003 .
2016-10-19 12:14:38 -07:00
Paul Berry 4054d93fc9 Handle default formal parameters in LocalElementBuilder
Fixes #27615.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2437793002 .
2016-10-19 11:17:43 -07:00
Konstantin Shcheglov 38e2b55fff Implement 'local' mode in TypeResolverVisitor.
If we start resolution not from CompilationUnit, we need to put type
parameters into scopes. This is not implemented yet.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2432273003 .
2016-10-19 09:47:40 -07:00
Stephen Adams 5a646b7827 Property extraction getters (tear-offs) are effect-free
This mostly allows better scheduling of the surrounding instructions.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2430683003 .
2016-10-18 20:13:26 -07:00
Konstantin Shcheglov b64e116422 Add TypeResolverMode and implement 'api' in TypeResolverVisitor.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2428233002 .
2016-10-18 19:31:14 -07:00
Brian Wilkerson d378dfcff8 Fix error codes (issue 27608)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2430873002 .
2016-10-18 17:30:04 -07:00
Jacob Richman 4f6ce11bc8 Emulate compiling a source file in the context of an existing library. Add --debugger-compile flag that performs permissive dynamic calls on private members. Polish web_command.dart adding the ability to evaluate code in the context of an existing library.
BUG=
R=brianwilkerson@google.com, jmesserly@google.com

Review URL: https://codereview.chromium.org/2423313002 .
2016-10-18 16:34:48 -07:00
Nicholas Shahan 3f67c24cb8 Revert "Fix library name insert and access inconsistency on windows"
This reverts commit d8505ee264.

It was found to cause issues in the web file system when one file
was found to be within a root path.

R=jacobr@google.com

Review URL: https://codereview.chromium.org/2432603002 .
2016-10-18 16:25:03 -07:00
Jennifer Messerly 7b5e6be4a8 fix #27284, allow FutureUnionType to be preserved during generic inference
R=leafp@google.com

Review URL: https://codereview.chromium.org/2425143002 .
2016-10-18 15:55:27 -07:00
Konstantin Shcheglov 412cceb7d0 Add tests showing using LocalElementBuilder separately, for variable or body.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2428773004 .
2016-10-18 14:38:06 -07:00
Paul Berry 8fca9ba968 First cut at a file system abstraction for the front end.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2426773004 .
2016-10-18 14:10:14 -07:00
Konstantin Shcheglov 19702989a8 Get rid of _inFunction in ApiElementBuilder.
This visitor does not enter into function bodies.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2430513004 .
2016-10-18 14:03:42 -07:00
Paul Berry 8c42e56964 Add "not intended to be implemented/extended" warnings to pkg/front_end.
This ensures that we may safely add methods to the classes in this
package without causing a breaking change.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2431733002 .
2016-10-18 13:31:40 -07:00
Konstantin Shcheglov 529ebf7be2 Add (shared) tests for ApiElementBuilder and ElementBuilder.
Also copy API-only tests from the old CL.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2431783002 .
2016-10-18 12:28:09 -07:00
Brian Wilkerson 0464279ec1 More correction messages
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2428733005 .
2016-10-18 12:22:17 -07:00
Konstantin Shcheglov 13d2420a3d Extract ElementBuilder tests into a separate file.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2430723002 .
2016-10-18 10:22:45 -07:00
Konstantin Shcheglov e1f8a0a103 Begin separating API and local element builders.
I will write separate tests for them and do some more clean up in
separate CLs.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2425853003 .
2016-10-18 08:22:30 -07:00
Johnni Winther b262be749e Optimize needNoSuchMethodHandling computation
This greatly improves the number of lookups needed to establish the relation.
For the two most prolific tests we have:

html/element_test: 44939 -> 6557
html/mirrors_js_typed_interop_test (mirrors+jsinterop!): 1638455 -> 171326

R=sigmund@google.com

Committed: a8b2bfb5eb

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

Reverted: 5397c5427e
2016-10-18 16:06:03 +02:00
Johnni Winther 37afcd5197 Change TypeInference to handle super calls as direct invocations.
This also makes calls of known target registered as static uses and thus
removes the need for misusing type masks to select super methods.

Closes #25716

R=sigmund@google.com

Committed: 70159b7418

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

Reverted: 5397c5427e
2016-10-18 14:02:55 +02:00
Erik Ernst b5d2b38aa3 Relaxes treatment of method type parameter in as expressions.
This CL changes the semantics of `dart2js --generic-method-syntax`
generated code for `e as T` where `T` is a method type parameter.

The old behavior was to raise a `TypeError` at runtime when such an
expression was evaluated. The new behavior is to consider `T` as an
alias for `dynamic`, i.e., `e as T` will then always succeed.

Addresses part of issue 27460, omits a part that is not yet agreed upon.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2388843002 .
2016-10-18 11:11:44 +02:00
Johnni Winther 5397c5427e Revert "Change TypeInference to handle super calls as direct invocations." and "Optimize needNoSuchMethodHandling computation"
This reverts commit 70159b7418.
This reverts commit a8b2bfb5eb.

Review URL: https://codereview.chromium.org/2425933002 .
2016-10-18 11:00:42 +02:00
Johnni Winther a8b2bfb5eb Optimize needNoSuchMethodHandling computation
This greatly improves the number of lookups needed to establish the relation.
For the two most prolific tests we have:

html/element_test: 44939 -> 6557
html/mirrors_js_typed_interop_test (mirrors+jsinterop!): 1638455 -> 171326

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2428543002 .
2016-10-18 10:52:12 +02:00
Johnni Winther 70159b7418 Change TypeInference to handle super calls as direct invocations.
This also makes calls of known target registered as static uses and thus
removes the need for misusing type masks to select super methods.

Closes #25716

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2423953002 .
2016-10-18 09:46:28 +02:00
Vijay Menon a032a4c952 Revert "Fix file name handling on windows"
This appears to break on bazel.

BUG=
R=nshahan@google.com

Review URL: https://codereview.chromium.org/2422403002 .
2016-10-17 15:27:48 -07:00
Konstantin Shcheglov fabb9dbf18 Remove _functionTypesToFix from ElementBuilder.
We might have needed it in the past, but now
'new FunctionTypeImpl(element)' does not use the enclosing element, at
least until we start calling its methods, which happens after we finish
building the element model.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2422333002 .
2016-10-17 14:26:38 -07:00
Brian Wilkerson 99ce88f8bc (TBR) Fix more failing tests
Review URL: https://codereview.chromium.org/2426723002 .
2016-10-17 12:57:56 -07:00
Paul Berry 0753607dea Initial API for the Dart front_end package.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2417043003 .
2016-10-17 12:36:08 -07:00
Brian Wilkerson 3121296942 (TBR) Fix failing tests
Review URL: https://codereview.chromium.org/2426703002 .
2016-10-17 11:55:31 -07:00
Brian Wilkerson 724ac40b8d Improve error messages and add many corrections
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2426583003 .
2016-10-17 10:40:43 -07:00
Brian Wilkerson cbd7a2908e Fixes for tests on windows
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2420413004 .
2016-10-17 09:39:25 -07:00
Johnni Winther 74b74a13f7 Decouple TypeMask from ClassElement
- by typing FlatTypeMask.base with Entity
- moving needsNoSuchMethodHandling to ClosedWorld
- and testing needsNoSuchMethodHandling

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2420073002 .
2016-10-17 09:47:20 +02:00
Brian Wilkerson 4f6f05273e Add more summary support to ContextBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2416243003 .
2016-10-15 08:40:04 -07:00
Stephen Adams 790b9d9cb1 Enable GVN on HForeignNew
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2422003002 .
2016-10-14 17:34:07 -07:00
Sigmund Cherem 997581ccec Fix custom elements in startup emitter
R=sra@google.com

Review URL: https://codereview.chromium.org/2424553002 .
2016-10-14 16:58:47 -07:00
Sigmund Cherem ee42a0a0aa Add js-interop support to the fast-startup emitter
BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2420173002 .
2016-10-14 14:22:11 -07:00
Bob Nystrom 60a966605d Remove uses of unittest in the HTML tests where possible.
This finishes going through the dev_compiler HTML tests and switches
out unittest for minitest wherever possible.

In the process, it gets another 10 tests strong mode clean, and gets
several more passing, and more not skipped. With this CL, we're running
another 50 more HTML tests (though some are expected to fail, mostly
because of #27578).

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

Review URL: https://codereview.chromium.org/2419863002 .
2016-10-14 13:44:19 -07:00
Brian Wilkerson 4942f5304a Guard against a hypothetical null pointer dereference
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2421473007 .
2016-10-14 12:31:11 -07:00
Vijay Menon 852ef37f71 Some mirrors fixes
R=leafp@google.com

Review URL: https://codereview.chromium.org/2415053004 .
2016-10-14 12:19:24 -07:00
Brian Wilkerson 3155b1e08c Remove unused method and field from DartSdkManager
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2415413003 .
2016-10-14 09:53:44 -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
Stephen Adams 476ffbda5e Revert "Build CFG for various JS() foreign methods"
TBR=het@google.com
BUG=

Review URL: https://codereview.chromium.org/2411793007 .
2016-10-13 19:02:41 -07:00
Stephen Adams a897bc3832 Build CFG for various JS() foreign methods
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2404123002 .
2016-10-13 17:11:35 -07:00
Konstantin Shcheglov 4c065c8443 Allow new public names in patches for the dart:_internal library.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2413403002 .
2016-10-13 14:52:22 -07:00