Commit Graph

46251 Commits

Author SHA1 Message Date
Zhivka Gucevska b00a85231e Parametrize over the additional agrument type for StatementVisitor1 and ExpressionVisitor1
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2835453002 .
2017-04-20 18:03:15 +02:00
Florian Loitsch 324dd07904 Fix typo.
Review-Url: https://codereview.chromium.org/2831913002 .
2017-04-20 16:12:34 +02:00
Zhivka Gucevska feb38e4c8b Implement expression evaluation in Coninuation Passing Style
This enables support for Return statements.

BUG=
R=dmitryas@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2806483003 .
2017-04-20 15:22:33 +02:00
Peter von der Ahé 8420947265 Update status file for debug mode.
Review-Url: https://codereview.chromium.org/2828273002 .
2017-04-20 13:15:12 +02:00
Paul Berry e3347e03f7 Use a non-null TypeInferrer even in non-strong mode.
This is necessary because some of the TypeInferrer's roles (e.g. type
promotion and determination of the types of constants) are still
needed in non-strong mode.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2829683008 .
2017-04-20 04:11:19 -07:00
Paul Berry e8e8359cdf Add local type inference logic for integer literals.
This CL introduces Fasta's first type inference rule, and hooks it up
to all the necessary testing infrastructure.  The rule is that a local
variable whose initializer is an integer literal should have an
inferred type of int.

Only variables occurring at top level within a method are inferred (we
don't yet recurse inside sub-blocks).

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

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2828693003 .
2017-04-20 03:36:19 -07:00
Peter von der Ahé 9356e3cd61 Check const constructors.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2799973003 .
2017-04-20 10:55:58 +02:00
Paul Berry b5c6053deb Add explicit return types to work around #29398.
In a future CL I need to add an import to this file, and for reasons I
haven't been able to track down, doing so causes type inference
failures.  This CL works around the problem by making the affected
types explicit.

Once the bug is fixed, I hope to be able to revert this.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2833563004 .
2017-04-20 01:29:49 -07:00
Peter von der Ahé e2eee219ac Complain about incorrect this/super constructor initializers.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2800083002 .
2017-04-20 10:04:12 +02: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
Peter von der Ahé cf6b2736ec Wrap VariableDeclarations in Blocks as specified by Kernel.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2801283002 .
2017-04-20 09:31:36 +02:00
Konstantin Shcheglov a73c8d0de1 MethodElementImpl.getReifiedType() should always create new parameter elements.
If we don't, and we transplant any of them into a new detached instance
of synthetic FunctionElementImpl, they are not able to access later
enclosingUnit in order to resynthesize their type.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829843002 .
2017-04-19 16:36:34 -07:00
Vijay Menon 8a64625d81 Regenerate DDC artifacts
TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2830983002 .
2017-04-19 16:26:22 -07:00
Zachary Anderson 135b1907ee [Fuchsia] Grab the number of malloc'd bytes from jemalloc
This allows us to report the "native heap memory" value in
the Observatory for VMs running on Fuchsia.

This change also renames the flag --enable-malloc-hooks to
--profiler-native-memory to better reflect what the flag
does. (In the future we may also want to rename
--profiler to --profiler-cpu.)

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2829833003 .
2017-04-19 15:51:02 -07:00
Mike Fairhurst 746fd35307 Now that contextRoot is within the is check, don't need contextRoot at all
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2828103002 .
2017-04-19 15:45:20 -07:00
Sigmund Cherem b57ca9fb55 Fix front-end tests: the original code is correct, this is a workaround for issue #29393
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834533002 .
2017-04-19 15:37:03 -07: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
Brian Wilkerson ba3ed4ba37 Initial support for getting fixes from plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2830863002 .
2017-04-19 15:00:00 -07:00
Steve Messick 0829174516 Complete for-each and switch statements
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2826283002 .
2017-04-19 14:44:41 -07:00
Konstantin Shcheglov 7faf4bac93 Add FileSystemState.knownFilesSetChanges stream.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2826243002 .
2017-04-19 13:23:34 -07:00
Brian Wilkerson 653f9defb1 Prepare to publish another alpha
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834493003 .
2017-04-19 13:01:40 -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
Brian Wilkerson a3102bf441 Add support for reporting plugin data to instrumentation
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834453002 .
2017-04-19 11:01:24 -07:00
Ryan Macnak 8b96a31c7f Move runtime functions to the more logical runtime_entry.cc.
Make --trace-runtime-calls respect the isolate filter.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2827873002 .
2017-04-19 10:22:04 -07:00
Konstantin Shcheglov 0ce4611fd9 Move 'general function type' unit tests into mixins to run them with Fasta.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829693002 .
2017-04-19 10:11:21 -07:00
Régis Crelier f0622c0567 Allow signature functions to be allocated in new space.
Types generated via instantiation during run time type tests are allocated in
new space and it makes sense (in the case of function types) to also allocate
instantiated signatures in new space.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2821233005 .
2017-04-19 10:10:44 -07:00
Konstantin Shcheglov 91d6dcf9fb We cannot use relative URIs to reference files outside of a package.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2830733002 .
2017-04-19 10:09:14 -07:00
Ryan Macnak 17e43f284b Tree shaker:
- Don't remove entries from a library's dictionary while iterating over it.
 - Remove library prefixes from library dictionaries.
 - Compact library dictionaries after removing entries.
 - Track snapshot references in debug mode and give a backtrace when unencountering an unexpected object.
 - Verify removed libraries are not included in the snapshot by marking their top-level classes.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2823873003 .
2017-04-19 10:03:43 -07:00
Zachary Anderson b6bb2978e1 [Fuchsia] Build only the parts of the SDK that are needed
In particular, dart2js, dartdoc, and ddc aren't used.

R=johnmccutchan@google.com, pylaligand@google.com

Review-Url: https://codereview.chromium.org/2826793002 .
2017-04-19 09:00:14 -07:00
Sigmund Cherem 60964ab735 Fix 29264: remove access to the network on source-map unit test
BUG=
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2824083002 .
2017-04-19 08:47:36 -07:00
Jacob Richman 6ac3a24a2e Run formatter on the analyzer.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2826693004 .
2017-04-19 08:24:09 -07:00
Jacob Richman c890c487fe Format all files under the sdk/lib directory.
BUG=
R=floitsch@google.com, terry@google.com

Review-Url: https://codereview.chromium.org/2822303002 .
2017-04-19 08:16:20 -07:00
Jacob Richman b33097b9b4 Format samples and samples-dev directories.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2828603002 .
2017-04-19 07:30:17 -07:00
Jacob Richman ed2d79a872 Tweak corelib files so dartfmt can do a better job. Use // comments to force line wrapping for long array literals to be more reasonable. Switched some /* comments to // comments Fixed cases where comments were not indented correctly when running the formatter was considered.
BUG=
R=floitsch@google.com, lrn@google.com, rnystrom@google.com

Review-Url: https://codereview.chromium.org/2754923002 .
2017-04-19 07:28:26 -07:00
Florian Loitsch 74686b9f66 Update status file for dartk (for function_type tests)
Review-Url: https://codereview.chromium.org/2827023002 .
2017-04-19 16:19:41 +02:00
Florian Loitsch 1c355af468 Add generated function_type tests.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2707033004 .
2017-04-19 15:56:47 +02:00
Peter von der Ahé 6bd0085ec1 Throw isn't a constant expression.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2801873008 .
2017-04-19 15:55:05 +02:00
Paul Berry a682c6a97e Introduce a testing framework for use with fasta type inference.
The framework will allow test source files to be annotated with
comments indicating where types are expected to be inferred, for
example:

    var /*@type=dart.core::int*/ x = 1;

Other features of the testing framework:

- Normally only those expectations explicitly listed will be checked.
  The special comment "/*@testedFeatures=inference*/" at the top of
  the file turns on extra checking which will cause the test to fail
  if any unexpected type inference occurs.

- Should be easy to extend to support other features, such as checking
  that the proper errors and warnings are generated at the proper
  locations.

- If the test is run with "-DupdateExpectations=true", the
  expectations will be updated in place.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2824393002 .
2017-04-19 06:54:08 -07:00
Peter von der Ahé 0ceb30a5e0 Make zero-termination optional.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2827543006 .
2017-04-19 15:29:00 +02:00
Erik Corry 0856863355 Fall back to megamorphic stub when dispatching calls to rare classes.
Previously we were converting very polymorphic calls that always end up
in the same implementation into a check-class instruction and a (usually
inlined) direct call.  This works well in artificial benchmarks like
the Megamorphic suite, but tends to cause repeated deopts on large real
programs like dart2js, where new classes arrive after a while, triggering
the check-class instruction to deopt.  After a few deopts, the function
is no longer eligible for optimization, resulting in huge slowdowns.

Instead with this change we can switch to the normal machinery for polymorphic
calls with more than one target.  This has the advantage that we use a
megamorphic stub call to catch rare classes, rather than deopting.
Dart2js is speeded up by a few percent on average and avoids the big
performance potholes described in https://github.com/dart-lang/sdk/issues/29302

Also reverts a less effective workaround for 29302.

R=vegorov@google.com
BUG=29302

Review-Url: https://codereview.chromium.org/2829603002 .
2017-04-19 15:25:24 +02:00
Peter von der Ahé e534a45cec Handle bad rethrows.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2802203002 .
2017-04-19 15:17:10 +02:00
Peter von der Ahé f1a6b12341 Parse escapes in analyzer machine output and handle Windows file names.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2823293003 .
2017-04-19 14:36:09 +02:00
Peter von der Ahé 73159e7f56 Skip all fasta tests when build directory may be missing.
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2831573002 .
2017-04-19 14:31:59 +02:00
Peter von der Ahé ba0e07846f Produce a compile-time error if there's no main method.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2801853006 .
2017-04-19 14:28:10 +02:00
Erik Corry 23c0caf4dc Revert "New Lint quick-fix: prefer_collection_literals (#29378)"
This reverts commit 6a56c86c81.
This a gardener revert to fix buildbot redness.

R=karlklose@google.com, loitsch@google.com
TBR=casanueva@google.com
BUG=

Review-Url: https://codereview.chromium.org/2827863003 .
2017-04-19 12:49:07 +02:00
Johnni Winther 7c58301eaf Hardwire kernel/visitor_test
- to the set of tests moved from pkg/kernel/testcases to
pkg/fasta/testcases in https://codereview.chromium.org/2825063002

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2830583003 .
2017-04-19 11:43:44 +02: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
Peter von der Ahé 2d9956a93d Move kernel baseline tests to front_end.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2825063002 .
2017-04-19 10:57:58 +02:00
Paul Berry 84ef5ed2da Add the ability to select a subset of tests using "...".
For example, the following command:

    pkg/front_end/tool/fasta testing compile/type...

Now runs all tests in the "compile" suite whose name begins with
"type".

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2824373002 .
2017-04-19 01:45:34 -07: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