- 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 .
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 .
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 .
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 .
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 .
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.