Commit Graph

4835 Commits

Author SHA1 Message Date
Stephen Adams 2c313f8125 Redo "dart2js: --fast-startup: use alias for 'this'"
Doesn't currently work since we can't use js.Names and regular parameters/variables in the same JavaScript scope.

Long term - we should fix this (https://github.com/dart-lang/sdk/issues/29455)

Short term, we could generate variable strings that are named after the fields and disambiguate them manually.

BUG=

Review-Url: https://codereview.chromium.org/2837243002 .
2017-04-26 20:51:19 -07:00
Stephen Adams 391feb15ca Use sourceElement when eliminating Phis
The generated code is more readable since it has more names from the
original program. In a very small number of cases the number of locals
increases.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2839223003 .
2017-04-26 17:21:22 -07:00
Stephen Adams b17e54277b dart2js: Move always-taken branch code to dominate join
Makes a lot of small improvements to Angular code by improving the code generated for inlined versions of looseIdentical.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2842863003 .
2017-04-26 13:55:30 -07:00
Dan Rubel 3b790e5311 new TokenType and Keyword API
This adds two new methods and adapts most of the old references
to use these new API. Once all call sites have been updated,
the old API can be removed.

This is part one of https://codereview.chromium.org/2842643004/

* replace type == TokenType.KEYWORD with type.isKeyword
* change Keyword.syntax --> Keyword.lexeme

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

Review-Url: https://codereview.chromium.org/2842213003 .
2017-04-26 15:53:58 -04:00
Johnni Winther b8627544ba Add more factory methods to FrontEndStrategy.
This prepares for running closed_world2_test through the normal Compiler
pipeline.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2836323002 .
2017-04-26 09:56:16 +02:00
Johnni Winther 31bf8196d6 Handle instantiation of native classes in closed_world2_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2836993003 .
2017-04-26 09:50:23 +02:00
Johnni Winther 86fbb962cf Include superclasses of classes only needed for rti
Closes #29441

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2842653003 .
2017-04-26 09:21:29 +02:00
Dan Rubel 684065855f merge PrecedenceInfo into TokenType and update all refs
* replace PrecedenceInfo *_INFO with TokenType.*
* remove outdated PrecedenceInfo tests
* delete unused precedence_info.dart

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2832403002 .
2017-04-25 08:51:52 -04:00
Johnni Winther b54ecf32cc Handle member closurization in closed_world2_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2836053002 .
2017-04-25 10:29:44 +02:00
Johnni Winther 80de14f634 Remove Frontend interface
This was no longer used.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2843453002 .
2017-04-25 10:13:44 +02:00
Johnni Winther 83e971b315 Add FrontEndStrategy, ResolutionFrontEndStrategy and KernelFrontEndStrategy
This is a step towards making the compiler agnostic of how the element
model is created. This enables us to build support for the kernel based
front end in parallel with the existing resolver based front end.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2841583002 .
2017-04-25 10:07:18 +02:00
Stephen Adams 7dbd34d9a4 dart2js: --fast-startup: cache prototypes in local in tear-off setup
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2831493003 .
2017-04-24 20:39:10 -07:00
Stephen Adams 840f655b88 Revert "dart2js: --fast-startup: use alias for 'this'"
Need to solve a clash between field name and local name in unminified code when the field is named '_'.

BUG=

Review-Url: https://codereview.chromium.org/2840613004 .
2017-04-24 18:02:24 -07:00
Stephen Adams deb986acce dart2js: --fast-startup: use alias for 'this'
Cache `this` in a local if doing so makes the minified code smaller.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2829533002 .
2017-04-24 17:53:43 -07:00
Sigmund Cherem 98547dc579 supress hint when using "show dynamic". This is a temporary fix to hide a hint
while we resolve issue #29125

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

Review-Url: https://codereview.chromium.org/2829003003 .
2017-04-24 12:41:15 -07:00
Johnni Winther 98b41dd1fc Rename KernelWorldBuilder to KernelElementBuilder
- and make K*Env classes private

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2829033002 .
2017-04-24 17:29:06 +02:00
Erik Corry 2fb5d08102 Spelling a
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2841543002 .
2017-04-24 14:53:51 +02:00
Johnni Winther 82ea1dafc9 Check equivalence of closed world based on kernel elements.
An equivalent closed world can now be computed for the Hello
World program based purely on kernel-based elements.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2829223003 .
2017-04-24 11:33:17 +02:00
Johnni Winther 33343c0f9c Correctly handle setters in KernelWorldBuilder
+ check resolution enqueuer equivalence

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2831903002 .
2017-04-24 11:09:13 +02:00
Johnni Winther 0390e9f0af Implement subtype relation for kernel based elements.
+ check BackendUsage equivalence

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2827283002 .
2017-04-24 10:53:05 +02:00
Johnni Winther 8a9c0417af Extract DartTypeVisitor and subclasses from resolution_types.
This makes most of the subtype related visitors reusable by kernel based elements.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2829683007 .
2017-04-24 09:01:22 +02:00
Johnni Winther 1c0684ceab Compute NativeBasicData for KernelWorldBuilder
This computes the native classes using metadata from the KernelWorldBuilder.
This will be merge with the AnnotationProcessor from https://codereview.chromium.org/2824123003/

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2824423002 .
2017-04-24 08:56:33 +02:00
Johnni Winther 39be6c2d72 Remove JavaScriptBackend from ClosedWorldBase
Also extract more extract more methods from ClosedWorldImpl into
ClosedWorldBase.

This is a step towards creating a closed world object from kernel based
elements. This CL adds the first mock of that object.

R=sigmund@google.com

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

Reverted:
https://github.com/dart-lang/sdk/commit/6c75646b3e3dded2622a0098210d1700af35461c

Review-Url: https://codereview.chromium.org/2826673002 .
2017-04-24 08:45:12 +02:00
Dan Rubel 54d131ebd9 merge fasta.PrecedenceInfo into analyzer.TokenType
* move precedence consts into analyzer token.dart
* move PrecedenceInfo.all to TokenType.all
* replace references to PrecedenceInfo with TokenType
* merge fasta.PrecedenceInfo into analyzer.TokenType

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

Review-Url: https://codereview.chromium.org/2837473002 .
2017-04-23 09:13:24 -04:00
Stephen Adams 43c7f9fbf4 Redo "dart2js: use ResolutionInterfaceType in SSA builders"
BUG=

Review-Url: https://codereview.chromium.org/2838453002 .
2017-04-21 20:29:35 -07:00
Stephen Adams 040ff9cee6 Revert "dart2js: use ResolutionInterfaceType in SSA builders"
TBR=sigmund@google.com

Review-Url: https://codereview.chromium.org/2838443002 .
2017-04-21 19:36:47 -07:00
Stephen Adams e95bea306e dart2js: use ResolutionInterfaceType in SSA builders
BUG=

Review-Url: https://codereview.chromium.org/2829373002 .
2017-04-21 17:19:19 -07: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
Erik Corry 4b9bba55b4 Stoppp using trippple consonants
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833073002 .
2017-04-21 17:50:13 +02:00
Paul Berry 77d26a330c Add top level type inference logic for integer literals.
This CL hooks up enough infrastructure for doing simple top level type
inference of variables whose initializer is an int.

Additional type inference rules will be added in follow-up CLs.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2828253003 .
2017-04-21 04:38:18 -07:00
Johnni Winther ab195dac63 Remove backend dependency from TypeTestRegistry
- and move RuntimeTypesChecks to TypeTestRegistry.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2826083002 .
2017-04-20 09:32:51 +02:00
Emily Fortuna 6c25a58dab Make backend.setAnnotations (mostly) handle LibraryEntities.
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2824123003 .
2017-04-19 15:36:33 -07:00
Stephen Adams 6c75646b3e Revert "Remove JavaScriptBackend from ClosedWorldBase"
TBR=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2828873002 .
2017-04-19 12:55:14 -07:00
Johnni Winther ee4b776108 Remove JavaScriptBackend from ClosedWorldBase
Also extract more extract more methods from ClosedWorldImpl into
ClosedWorldBase.

This is a step towards creating a closed world object from kernel based
elements. This CL adds the first mock of that object.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2826673002 .
2017-04-19 11:14:02 +02:00
Johnni Winther 407645660c Remove Compiler and JavaScriptBackend from program_builder and collector.
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2824823004 .
2017-04-19 10:44:57 +02:00
Johnni Winther 230c1745cd Remove Compiler and JavaScriptBackend from class_stub_generator
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2820143004 .
2017-04-19 10:40:11 +02:00
Johnni Winther 23684c221e Remove Compiler and JavaScriptBackend from field_visitor.
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2823003003 .
2017-04-19 10:30:55 +02:00
Stephen Adams 2955ecc794 Increase tracing limit
Increasing from 16 to 32 has a lot of nice small improvements and does
not seem to affect compile time (within benchmark noise).

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2826623002 .
2017-04-18 15:00:20 -07:00
Johnni Winther 86b468a466 Remove Compiler and JavaScriptBackend from parameter_stub_generator
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2810223002 .
2017-04-18 10:43:52 +02:00
Johnni Winther d7f28df9e8 Remove Compiler and JavaScriptBackend from main_call_stub_generator and runtime_type_generator
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2815513007 .
2017-04-18 10:39:04 +02:00
Johnni Winther db048990bc Remove Compiler and JavaScriptBackend from interceptor_stub_generator.
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2818463002 .
2017-04-18 10:33:58 +02:00
Johnni Winther 635f2fc491 Less direct use of JavaScriptBackend in ProgramBuilder
This is a step towards passing data object directly instead of accessing
data on JavaScriptBackend. This is needed to support an element switch
between resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2810183002 .
2017-04-18 10:25:15 +02:00
Johnni Winther e484e652e2 Remove Compiler/JavaScriptBackend from metadata_collector
- and Compiler from type_test_registry.

The CodeEmitterTask was removed from the TypeRepresentationGenerator to
break a dependency cycle between the two. An Emitter is now provided as
an argument to TypeRepresentationGenerator methods instead.

This is a step towards passing data object to the codegen/emitter
instead of pulling data directly from Compiler/JavaScriptBackend. This
is needed to support an element model switch between codegen and
resolution.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2809203003 .
2017-04-18 09:58:27 +02:00
Johnni Winther 9cff58233f Extract ClosedWorldRefiner implementation from ClosedWorldImpl to ClosedWorldBase
- to make it reusable for kernel based elements.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2814973003 .
2017-04-18 09:45:00 +02:00
Johnni Winther a65d195f72 Compute isSubtype and isSubclass using ClassSet/ClassHierarchyNode
This makes ClosedWorld.isSubtype and ClosedWorld.isSubclass reusable
for kernel based elements.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2815513006 .
2017-04-18 09:34:32 +02:00
Johnni Winther 5ccf530f62 Extract OrderedTypeSetBuilderBase from OrderedTypeSetBuilder
- to make it reusable for kernel based elements.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2808763005 .
2017-04-18 09:29:39 +02:00
Stephen Adams 0c83262a1e Use shorter names for some standard properties on closures.
BUG= https://github.com/dart-lang/sdk/issues/25003
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2820953002 .
2017-04-17 18:51:18 -07:00
Stephen Adams 835f06a488 dart2js: fast startup: cache common superclass in inheritance
- group classes by common superclass
- cache superclass in local to reduce property accesses

Shrinks minified large app by 0.2%

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2813743003 .
2017-04-17 14:57:50 -07:00
Stephen Adams cdba92a563 dart2js: --fast-startup: share defaultValues property for closures with no default values
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2820573005 .
2017-04-17 10:27:17 -07:00
Stephen Adams b0599b2647 dart2js: eliminate useless conditionals
1. Simplify HPhi nodes that merge refinements of the same value.

2. Replace the condition of HIf with a constant when the HIf does nothing (no controlled statements or phis).

Together with existing optimizations, this can optimize `s?.toString()` to `s` when `s` is known to be a nullable String.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2823543002 .
2017-04-14 14:34:05 -07:00