Commit Graph

68 Commits

Author SHA1 Message Date
Johnni Winther 5afe65e891 Remove Compiler.commonElements
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2935663002 .
2017-06-14 10:18:42 +02:00
Johnni Winther ab688ab590 Make elements/names.dart its own library
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2860753005 .
2017-05-08 11:00:32 +02:00
Sigmund Cherem 94e3e33602 dart2js: patch file support cleanup
- removes hacky support for patching based on the emitter
 - adds generics to js_array to match the current sdk

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2836733002 .
2017-04-21 15:51:18 -07:00
Emily Fortuna 7697137485 Merge CommonElements and BackendHelpers!
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2814453005 .
2017-04-11 14:32:54 -07:00
Emily Fortuna 4156ca6a2b Eliminate multi-callback structure for LibraryLoader.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2760923004 .
2017-03-24 12:20:46 -07:00
Johnni Winther 4b9297caad Create ResolutionEnqueuer after library loading.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2735763002 .
2017-03-15 13:46:48 +01:00
Johnni Winther 69b47ea010 Add NativeDataResolver
- to further align the NativeData computation towards separating builders from data.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2732793002 .
2017-03-15 11:54:48 +01:00
Johnni Winther f7ec06f210 Add NativeClassData/NativeClassDataBuilder
- for information computed during loading (pre-resolution)

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2727253007 .
2017-03-15 11:24:13 +01:00
Johnni Winther 6d3bf72448 Split NativeData
- into NativeData, NativeDataBuilder and NativeDataImpl
+ add JavaScriptBackendTarget to move all .isNative queries to NativeData (more implementation should be moved here)

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2721403006 .
2017-03-14 16:54:18 +01:00
danrubel 42f6586f36 rename fasta.Token.value --> lexeme
This renames the fasta.Token.value field to .lexeme so that
it will not collide with an already existing analyzer.Token accessor.

R=ahe@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2738313002 .
2017-03-12 13:16:14 -04:00
Johnni Winther 1567a4c21b Handle Native("...") annotations in KernelBehaviorBuilder.
Closes #28157

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2681123004 .
2017-02-10 10:49:19 +01:00
Peter von der Ahé d0d27c1c38 Use parser and scanner from package:front_end.
Originally reviewed as:

    Review-Url: https://codereview.chromium.org/2650413002 .
    Review-Url: https://codereview.chromium.org/2652203002 .
    Review-Url: https://codereview.chromium.org/2655843002 .
    Review-Url: https://codereview.chromium.org/2654433009 .
    Review-Url: https://codereview.chromium.org/2647343003 .
    Review-Url: https://codereview.chromium.org/2652663005 .
    Review-Url: https://codereview.chromium.org/2650813002 .
    Review-Url: https://codereview.chromium.org/2650803002 .
    Review-Url: https://codereview.chromium.org/2651843004 .
    Review-Url: https://codereview.chromium.org/2649923002 .
    Review-Url: https://codereview.chromium.org/2651563003 .
    Review-Url: https://codereview.chromium.org/2649123002 .
    Review-Url: https://codereview.chromium.org/2644843006 .
    Review-Url: https://codereview.chromium.org/2647043002 .
    Review-Url: https://codereview.chromium.org/2642903003 .
    Review-Url: https://codereview.chromium.org/2645513002 .
    Review-Url: https://codereview.chromium.org/2642663003 .
    Review-Url: https://codereview.chromium.org/2642713002 .
    Review-Url: https://codereview.chromium.org/2635473002 .
    Review-Url: https://codereview.chromium.org/2624373003 .
    Review-Url: https://codereview.chromium.org/2627723006 .
    Review-Url: https://codereview.chromium.org/2627093007 .
    Review-Url: https://codereview.chromium.org/2629543008 .
    Review-Url: https://codereview.chromium.org/2629543007 .
    Review-Url: https://codereview.chromium.org/2631503002 .
    Review-Url: https://codereview.chromium.org/2621153006 .
2017-02-01 10:29:25 +01:00
Johnni Winther 58048f694e Use elements/types in constants/values
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2620023002 .
2017-01-12 12:22:15 +01:00
Johnni Winther 51e3c01e3e Prefix resolution_types with Resolution.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2603263002 .
2017-01-05 13:10:20 +01:00
Johnni Winther 56cdde298d Move dart_types to elements/resolution_types
- to prepare for a new dart_types super-hierarchy based on entities.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2606253002 .
2017-01-04 10:07:15 +01:00
Johnni Winther 6281614c45 Merge CoreTypes and CoreClasses into CommonElements.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2595493002 .
2016-12-21 10:10:23 +01:00
Johnni Winther 44bdc75827 Support patched generic methods.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2535213003 .
2016-11-30 09:20:42 +01:00
Erik Ernst 7809d25b92 Remove the ability in dart2js to turn off syntax-only generic methods.
This CL removes all the checks for 'enableGenericMethodSyntax' in the
implementation, which takes away the ability to turn this feature off
and simplifies the code.

As a result, `ParserOptions` is now empty; we may want to remove it,
but this CL does not do that.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2521073003 .
2016-11-23 12:16:30 +01:00
Sigmund Cherem b16d5ca237 Introduce "CommonElements"
Moves common elements that the compiler refers to into a standalone class "CommonElements". Along the way I:

  - made computation of these elements lazy: it's only done when needed. This meant also changing some checks of the form `x == someCommonElement` into `isSomeCommonElement(x)` so that we don't forcefully resolve elements if we haven't seen them.

  - I tried also to remove elements that were only used to know whether something happened. Instead we model that directly with a boolean.

Next steps after this:
 - move CommonElements under common/elements.dart
 - merge CoreClasses + CommonElements
 - introduce TargetElements: elements that the backend refers to that we need to know about during resolution/analysis. I expect most of it to be already in BackendHelpers.
 - get rid of onLibraryScanned/onLibrariesLoaded

R=het@google.com

Review URL: https://codereview.chromium.org/2265473004 .
2016-08-22 14:53:26 -07:00
Johnni Winther 5f3cf6f932 Serialize metadata
R=het@google.com

Committed: https://github.com/dart-lang/sdk/commit/f8e3f223476b461d4c9fcf89b691441f73532bf4

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

Reverted: https://github.com/dart-lang/sdk/commit/368d4d54d3634cfbbbfcf63bce8d024dd7b9a4ae
2016-06-16 12:13:17 +02:00
Johnni Winther 368d4d54d3 Revert "Remove Registry from registerMetadataConstant" and "Serialize metadata"
This reverts commit ed1777e4b2.
This reverts commit f8e3f22347.

Review URL: https://codereview.chromium.org/2070493003 .
2016-06-16 10:11:51 +02:00
Johnni Winther f8e3f22347 Serialize metadata
R=het@google.com

Review URL: https://codereview.chromium.org/2060183002 .
2016-06-16 09:45:12 +02:00
Sigmund Cherem b741e3f0df Make CompilerTask independent of compiler.
Now this base class only has logic for measuring time.

R=het@google.com, johnniwinther@google.com

Review URL: https://codereview.chromium.org/2000323006 .
2016-05-25 09:11:08 -07:00
Harry Terkelsen ce37fbcb3d Refactor Parsing to remove compiler dependency
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1892183002 .
2016-04-15 13:03:02 -07:00
Harry Terkelsen 01e839c732 dart2js cleanup: remove unused imports and variables
BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1880323002 .
2016-04-13 09:11:39 -07:00
Harry Terkelsen acf33e480c dart2js: use IdGenerator for all id generation
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1881293002 .
2016-04-13 09:02:06 -07:00
Harry Terkelsen 9f8427d041 Begin refactoring compiler out of diet parser and scanner
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1867243004 .
2016-04-08 14:11:19 -07:00
Harry Terkelsen 29cf477139 dartfmt pkg/compiler
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1859343004 .
2016-04-07 10:00:53 -07:00
Erik Ernst 586c43ac7e Repeats and fixes the changes landed & reverted as CL 1789553003.
When landed, CL 1789553003 turned out to cause bot failures because
some libraries outside the compiler are importing compiler libraries
which have been updated. For instance, the tests in 'compiler/dart2js'
depend on several internal elements of the 'dart2js' compiler.

This CL updates these external dependents to work with the modified
library structure and class APIs of the compiler. A small adjustment
was applied to 'dart2js_incremental' as well.

No further dependents are believed to exist: Grepping in sdk for
relevant imports does not reveal any further imports of any of the
libraries in the compiler where the "interface" has changed, and
external clients are not supported (that is, imports in arbitrary
github repositories may or may not break if they use the compiler
internals, but we do not support this type of dependency so we won't
do anything to protect them against that type of breakage).

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1864433004 .
2016-04-05 17:26:07 +02:00
Erik Ernst 355888457a Revert "Introduces ParserOptions."
This reverts commit d4c9a499d5.

Review URL: https://codereview.chromium.org/1859543002 .
2016-04-04 15:16:13 +02:00
Erik Ernst d4c9a499d5 Introduces ParserOptions.
In preparation for support for generic methods (with an associated
command line option), this CL introduces a `ParserOptions` class and
uses that to pass the existing option `enableConditionalDirectives` to
all parsers. With that, the addition of an `enableGenericMethodSyntax`
option will be concise and well localized.

It is necessary to keep a `ParserOptions` object in `Parsing`, because
that's the only convenient channel for providing the options to the new
`Parser` and `ClassElementParser` created from the top-level function
`parse` in 'partial_elements.dart', and a from
`PartialClassElement.parseNode`, respectively.

The `ParserOptions` class is located in 'parser.dart'; from the current
import structure the most natural choice might be to put it in
'element_listener.dart', but considering the nature of that file it
seems less natural: What does `ParserOptions` have to do with element
listeners? So I put it in 'parser.dart', even though this causes a few
additional import statements.

R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1789553003 .
2016-04-04 14:45:20 +02:00
Sigmund Cherem bada3cac9d Split loader from the rest of the compiler. This adds several abstractions to
make the decoupling easier. Some of the new abstractions should be revisited,
but it's a step forward :).

R=het@google.com

Review URL: https://codereview.chromium.org/1819053002 .
2016-03-23 16:02:33 -07:00
Johnni Winther 5d97c6176f Support serialization of WorldImpact
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1809533004 .
2016-03-18 09:05:27 +01:00
Florian Loitsch af4983c6b2 dart2js: add support for configuration-specific imports.
R=johnniwinther@google.com, rnystrom@google.com

Committed: https://github.com/dart-lang/sdk/commit/64edfaf21af3153f32e1229dd97c9b3d40cbfb2b
Reverted: https://github.com/dart-lang/sdk/commit/f38b810d334900317ee6c919b45ebd0c673fdb02

Review URL: https://codereview.chromium.org/1388523002 .
2015-12-11 06:17:15 +01:00
Florian Loitsch f38b810d33 Revert "dart2js: add support for configuration-specific imports."
This reverts commit 64edfaf21a.

Review URL: https://codereview.chromium.org/1517013003 .
2015-12-11 00:49:38 +01:00
Florian Loitsch 64edfaf21a dart2js: add support for configuration-specific imports.
R=johnniwinther@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/1388523002 .
2015-12-11 00:25:01 +01:00
Johnni Winther 9628541c10 Move remaining helpers to BackendHelpers
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1413213004.
2015-10-28 13:23:57 +01:00
Johnni Winther 3310969882 Require that injected members are private.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1421723002.
2015-10-23 14:41:50 +02:00
Johnni Winther e38285c424 Move native and js interop properties from the element model to the JS backend
Main changes:
  Moved native/jsinterop members from
    elements/elements.dart, (interface)
    elements/modelx.dart, (implementation)
    native/native.dart (implementation)
  to
    common/backend_api.dart (interface)
    js_backend/backend.dart (implementation)

  Removed LibraryElement.canUseNative and added BackendApi.canUseNative to
    common/backend_api.dart
  to encapsulate the maybeEnableNative function in
    native/native.dart

  Added ScannerOptions to
    parser/element_listener.dart
  as a required argument of ElementListener
  and added Parsing.getScannerOptionsFor to
    common/resolution.dart (interface)
    compiler.dart (implementation)
  to allow the `native` pseudo keyword in
    native/scanner.dart

The remaining changes are side-effects of the changes above.

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

Review URL: https://codereview.chromium.org/1408043002.
2015-10-22 11:41:38 +02:00
Jacob Richman be1fcb9441 Switch Js to JS
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1410403003 .
2015-10-19 17:32:10 -07:00
Jacob Richman cd2752431e Support user generated custom native JS classes.
BUG=
R=jmesserly@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318043005 .
2015-10-13 13:15:28 -07:00
Johnni Winther 1414d9b27e Use common.dart to re-export commonly used entities.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1394063004.
2015-10-12 09:34:02 +02:00
Johnni Winther 76b7203c19 Extract DiagnosticReporter implementation from Compiler.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1383483006.
2015-10-06 10:24:44 +02:00
Johnni Winther d25224c212 Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1383503002.
2015-10-01 11:39:38 +02:00
Johnni Winther 1590970ccc Report info messages together with their error, warning, or hint.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1363993004.
2015-09-24 15:08:29 +02:00
Johnni Winther 8855bc8161 Support metadata on patches.
Closes #24291

R=karlklose@google.com

Review URL: https://codereview.chromium.org//1302333006.
2015-09-09 13:04:51 +02:00
Johnni Winther d6db26f912 Split parser/listener.dart, parser/class_element_listener.dart and tokens/token.dart into smaller libraries
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1311783012.
2015-09-02 15:55:19 +02:00
Johnni Winther ee54b9e3cd Move parser and token related libraries into their own subfolder.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1313073007.
2015-09-02 12:07:00 +02:00
Johnni Winther f5a7be0c17 Split scannerlib.dart into several libraries.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1315483006.
2015-09-01 15:39:31 +02:00
Johnni Winther 930bc75c0d Move diagnostic_listener.dart and messages.dart to the diagnostics folder
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1286143003.
2015-08-12 12:05:36 +02:00