Commit graph

13573 commits

Author SHA1 Message Date
Florian Loitsch 9672d69a06 Mark pause_on_unhandled_async_exceptions_test as flaky with optimization_counter_threshold. with optimization_counter_threshold.
Change-Id: Ic9895b8638bf218dab63f42b6d8cc11d37f93dfa
Reviewed-on: https://dart-review.googlesource.com/58782
Reviewed-by: Florian Loitsch <floitsch@google.com>
2018-06-06 17:09:08 +00:00
Adam Barth 6dd945599e [fuchsia] Move FDIO headers
These headers are now at this location.

Change-Id: I61bbe005093e241d9d7ca4435e3d7bbd6f9d27b8
Reviewed-on: https://dart-review.googlesource.com/58701
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
2018-06-06 16:47:05 +00:00
Florian Loitsch 2b36f923d9 Fix status file.
Change-Id: Ica224de62d1db05715c6fd1ac609759118e2cce0
Reviewed-on: https://dart-review.googlesource.com/58722
Reviewed-by: Florian Loitsch <floitsch@google.com>
2018-06-06 15:11:27 +00:00
Florian Loitsch 398ba13e4a Reapply "Make --sync-async the default for the VM."
Change-Id: I6e4da0da6c3f635d84380b384ae17fbb55587895
Reviewed-on: https://dart-review.googlesource.com/58721
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2018-06-06 14:32:13 +00:00
Martin Kustermann a4af44b470 [VM] Do not invoke any functions during AOT compilation
In Dart 2.0 AOT compilations we give dart_bootstrap/gen_snapshot the
fully linked Kernel IR file (*.dill file) with evaluated constants.

This CL will make the 2.0 AOT compiler

   * only accept .dill files as input
   * no longer invoke various functions during startup
   * no longer start the VM service
   * hit unreachable in DartEntry::InvokeFunction()

Issue https://github.com/dart-lang/sdk/issues/33185

Change-Id: Iaba44386633856774a0c29be043780b9b262df0f
Reviewed-on: https://dart-review.googlesource.com/56520
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-06-06 10:56:10 +00:00
Ryan Macnak b375d69800 [observatory] When the VM is forwarding events to the Android or Fuchsia system tracers, link to the document describing how to use them.
Change-Id: I940b2d5b47a54661c5d25e6d52e714b8819d79a6
Reviewed-on: https://dart-review.googlesource.com/58601
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-05 21:55:56 +00:00
Ryan Macnak edb1642709 [vm] Repair interpreter build.
Change-Id: I194b705523cec3ebb1c3edba6546561c337b28c9
Reviewed-on: https://dart-review.googlesource.com/58600
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-05 21:44:26 +00:00
Ryan Macnak 787a43ec78 [vm] Fix some missing private name mangling in the kernel reader.
Bug: https://github.com/dart-lang/sdk/issues/32345
Bug: https://github.com/dart-lang/sdk/issues/33326
Bug: https://github.com/dart-lang/sdk/issues/33345
Change-Id: I89fb8f0332ef6f9f40de59c219af2a7c23e5943f
Reviewed-on: https://dart-review.googlesource.com/58400
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-06-05 20:14:46 +00:00
Doug Evans cc1a817faa Use ZX_THREAD_STATE_BASIC on state output of ZX_INFO_THREAD.
Change-Id: I0429ad208cddb0cb21db293fd798cb872f71b305
Reviewed-on: https://dart-review.googlesource.com/58560
Reviewed-by: Zach Anderson <zra@google.com>
2018-06-05 19:53:21 +00:00
Paul Berry b66dd3d456 Stop using generic comment syntax in observatory.
In most cases the correct fix is to simply drop the generic comment
syntax (e.g. replace "List/*<Map>*/" with "List").  We can't use the
more precise type because the runtime type is actually more general
(e.g. when processing an object that came from the JSON parser, all
lists have runtime type List<dynamic>, even if their elements happen
to be uniform).  But we can introduce more precise types when handling
substructures.

Exception: all JSON-derived maps have type Map<String, dynamic> (since
JSON maps always have string keys), so we can use a more precise type
when dealing with JSON maps.
Change-Id: I48c9dbdda97c11530978212146f74db7b43f5197
Reviewed-on: https://dart-review.googlesource.com/58320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-05 18:29:26 +00:00
Vyacheslav Egorov 7b972a653b [vm/linearscan] Account for definitions with no SSA name when processing PairLocation outputs.
ToSecondPairVreg(kNoVirtualRegister) should be kNoVirtualRegister not 0.

Revert fe28a2939a which updated statuses for
crashing tests.

Fixes https://github.com/dart-lang/sdk/issues/33329

Bug: https://github.com/dart-lang/sdk/issues/33329
Change-Id: I48e95bcb6f95555ec9ac51adc1f61619fbf40139
Reviewed-on: https://dart-review.googlesource.com/58461
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-06-05 17:41:34 +00:00
Alexander Aprelev 09fc582bfd Fix EvalExpression test.
Instance::Evaluate was replaced with EvaluateCompiledExpression. This fixes the test.
Change-Id: Ie5aba0a7ef25209a3319a07d45d76f347f6f3e95
Reviewed-on: https://dart-review.googlesource.com/58440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-06-05 17:40:59 +00:00
Alexander Aprelev 8bfbce33f1 Mark cc/Profiler_CodeTicks as failing on Windows, dartk x64 config
Change-Id: I44ab656634500cdd1dc43f2710c964e87dbffd4e
Reviewed-on: https://dart-review.googlesource.com/58520
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-06-05 17:32:54 +00:00
Aart Bik b7493b663e [vm/inliner] Inline small int convertors.
Rationale:
Always inline int convertors that don't do
much more than testing and anding.
For example, force inline
  v26 <- StaticCall:66( _toUint8@6027147<0> v4 T{Type: class 'int'?}) T{Type: class 'int'?}
to
  v47 <- Constant(#255)
  ..
  CheckSmi:10(v4 T{Type: class 'int'?})
  v45 <- BinarySmiOp:10(&, v4 T{_Smi}, v47 T{_Smi}) T{_Smi}

https://github.com/dart-lang/sdk/issues/33205

Change-Id: I595d9a64365e16ae244480b5e27f8be23c43d164
Reviewed-on: https://dart-review.googlesource.com/58061
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-05 16:54:19 +00:00
Paul Berry 60631b0944 Remove unnecessary casts from observatory.
Change-Id: I2ad59645471b41ce0c8530665b9dc2bcd3e56e7d
Reviewed-on: https://dart-review.googlesource.com/58321
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-05 15:55:00 +00:00
Alexander Aprelev e0ca1514a2 Mark test as failing.
Post a5e41681e5, the method Instance::Evaluate is now redundant in dart2 mode. Instead Instance::EvaluateCompiledExpression should be used.

The https://dart-review.googlesource.com/c/sdk/+/58440 should fix the test.

Change-Id: I18ee49174f51b46a87a56324be054ebc832a04df
Reviewed-on: https://dart-review.googlesource.com/58441
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-06-05 06:25:10 +00:00
Alexander Aprelev a5e41681e5 Add support for expression compilation via service.
If there is registered expression compiler, VM debugger uses it to compile expressions. Otherwise, it will fallback to use kernel service compiler.
This is needed to support Flutter use case where compiler is running on developer's host machine, not on the device where VM is running.

Bug: dartbug.com/31981
Change-Id: I8bdfc8ab45a57c306169abe189f1e24e1b0bcf40
Reviewed-on: https://dart-review.googlesource.com/57520
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-05 04:16:39 +00:00
Ryan Macnak ade0e93090 [vm] Normalize external string finalizers.
- Remove a level of indirection when accessing code units.
 - Require a finalizer when constructing an external string.

Change-Id: I3f65246bf0ac50ffad900e2c338623a7684a9d3d
Reviewed-on: https://dart-review.googlesource.com/54300
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-06-04 23:44:39 +00:00
Paul Berry 648f62a170 Rename Function to ServiceFunction, since creating a class called Function is deprecated.
Change-Id: Ia052b1663252a8786f94577626e631a66d69dff5
Reviewed-on: https://dart-review.googlesource.com/58280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 22:02:29 +00:00
Zach Anderson 9847c06e76 [observatory] Top-level observatory_archive rule copies to root_out_dir
Change-Id: I165d5391f8ae36ec4201d25907c90a526d8b8c6b
Reviewed-on: https://dart-review.googlesource.com/58360
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 21:35:39 +00:00
Ryan Macnak 53f7bb175e Revert "Make --sync-async the default for the VM."
This reverts commit 1ddf553eb6.

Reason for revert: Failing service tests

Original change's description:
> Make --sync-async the default for the VM.
> 
> Change-Id: Ic6d7bbc27835ea7b197cccf05724adb99e95dd51
> Reviewed-on: https://dart-review.googlesource.com/57580
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=vegorov@google.com,kustermann@google.com,floitsch@google.com

Change-Id: I062cb40badf0d1cf1808bee152fdd4074b00179d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/58380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-04 21:04:20 +00:00
Alexander Markov c3b5939965 [vm] Remove --limit-ints-to-64-bits option and old _Bigint class
Closes https://github.com/dart-lang/sdk/issues/33306

Change-Id: I7088d8b7143edbe24f5cefe4be037ad2006e0625
Reviewed-on: https://dart-review.googlesource.com/58101
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 20:10:40 +00:00
Zach Anderson b0f622a143 [vm] Fix GC assert
Saw this assert hit on the bots, so switching back to max with 0.

Change-Id: Idafcd55d99dd441131dd3ac9aeb57ec102f28569
Reviewed-on: https://dart-review.googlesource.com/58323
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-06-04 19:07:39 +00:00
Alexander Markov 5bfe8d454e [vm/kernel] Set active class when evaluating Dart annotations, take 2
In 4fb0c60938
active class was set in StreamingDartTypeTranslator, but it turns out
this is not enough. This CL sets active class in StreamingFlowGraphBuilder;
all dependent helper objects should pick it automatically.

Fixes https://github.com/dart-lang/sdk/issues/33259

Change-Id: If16afff35de32cbdba23f6260dac0e0fd7e9786a
Reviewed-on: https://dart-review.googlesource.com/57524
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-06-04 19:05:33 +00:00
Régis Crelier 57dc25c6f6 [VM interpreter] Initial version of stack walking of interpreted frames.
Various improvements and bug fixes.

Change-Id: Ice0ce0ba8db8c9f78b9fad89f951218c90c831b7
Reviewed-on: https://dart-review.googlesource.com/57443
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-06-04 18:37:30 +00:00
Florian Loitsch 1ddf553eb6 Make --sync-async the default for the VM.
Change-Id: Ic6d7bbc27835ea7b197cccf05724adb99e95dd51
Reviewed-on: https://dart-review.googlesource.com/57580
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-06-04 18:05:20 +00:00
Paul Berry a518d3c6dc Use int.tryParse rather than deprecated onError parameter of int.parse.
Change-Id: I20943a59e367fa6bd328604063b4a736ec300c0e
Reviewed-on: https://dart-review.googlesource.com/58260
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-04 17:49:39 +00:00
Ryan Macnak 2b5de60888 [vm] Improve --verbose-gc.
- Track mark-compact as a GC type instead of a GC reason.
 - Track external allocation as a GC reason.

Change-Id: Id79bf6a582109e3ebb97954822aefeffe68959e2
Reviewed-on: https://dart-review.googlesource.com/58002
Reviewed-by: Zach Anderson <zra@google.com>
2018-06-04 17:33:03 +00:00
Zach Anderson 0bec11a4f2 [vm] Control growth of external allocations
Previously, GC would only be triggered by external allocations on
reaching a limit indicated by a flag. This limit was too large
and not set thoughtfully by anyone.

This CL triggers GC when external allocations in old gen grow
larger than some limit based on results of previous GC, similar
to how Dart heap growth triggers GC. GC is triggered for new gen
when external allocations reach 4x the current new gen
capacity.

FL-61

Change-Id: I1d4da467bc2aab64058f25296aefdd73eebc38e6
Reviewed-on: https://dart-review.googlesource.com/58100
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-06-04 17:24:18 +00:00
Martin Kustermann 35b17f3730 [VM] Consistently use ValidationPolicy in frame iteration APIs
Previously there were places in the code where an API accepted a
`bool validate_frames` and call sites passed an enum value (which
implicitly got converted to a bool).

By changing the APIs to require an enum, the compiler will tell us if a
caller doesn't pass one.

Change-Id: I29fcd0b018e6cdd7e00b5bb03e83b9636d1345d4
Reviewed-on: https://dart-review.googlesource.com/57823
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-06-04 14:46:26 +00:00
Alexander Thomas a9257d05fb [vm] Prepare status files for dartk reload/rollback builders (#33126)
Change-Id: I954debb9f258eb94de227f6772ff08b53daba322
Reviewed-on: https://dart-review.googlesource.com/57623
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-06-04 11:30:21 +00:00
Ryan Macnak 5f9fcd0bbc [vm, x64] Remove embedded address from the implementation of math.min/max.
Embedded addresses are not safe for AppAOT and AppJIT snapshots.

Change-Id: Id36adb2e430bfc92c409ec96db15f2ad2151b2cb
Reviewed-on: https://dart-review.googlesource.com/58060
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-02 00:05:35 +00:00
Ryan Macnak 025cee6f1f Skip tests of snapshot determinism on Windows.
Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: I53cf4a99c547d3ada9f51bc32889b593a9579bf7
Reviewed-on: https://dart-review.googlesource.com/58080
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-01 23:25:19 +00:00
Paul Berry 6ba8c711fa Observatory strong mode fix: expand the class hierarchy for debug events.
This CL adds base classes for breakpoint events (which support a
`breakpoint` getter) and async suspension events (which support an
`atAsyncSuspension` getter).  Previously these getters were accessed
through dynamic dispatch.

Change-Id: I9bc450a8988483cd0662b1dfe31b4adaf0936ff9
Reviewed-on: https://dart-review.googlesource.com/57380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-01 22:43:29 +00:00
Vyacheslav Egorov 99a5f149ac [vm] Enable type stubs based type checks in JIT mode for some types.
Relanding 4be50d6fa1 with fixes to DBC
and location summaries: AssertAssignable must save FPU registers.

For now we are limiting this to type checks against type parameter types.


In Dart 1 mode Dart2JS compiles itself in 28s when running from source
and in 23s when running from ideal app-jit snapshot (trained on the
same workload).

Before this change in Dart 2 mode numbers were 51s and 57s respectively.

After this change in Dart 2 mode numbers are 38s and 32s. Meaning
that regression is reduced by 50%.

Issue https://github.com/dart-lang/sdk/issues/31798
Issue https://github.com/dart-lang/sdk/issues/33257

Change-Id: Ifb55f86453bfdf36a2e03bcd7f3197cfde257103
Reviewed-on: https://dart-review.googlesource.com/57980
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-06-01 20:58:33 +00:00
Zach Anderson 90c4215af4 [vm] Adds full GC check on all external allocations
related #33314

Change-Id: I3f715f5c3580c9f865a4579b732ba56c39c69012
Reviewed-on: https://dart-review.googlesource.com/58001
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-01 20:42:49 +00:00
Paul Berry bef7cd354f Observatory strong mode fix: Use .nodes= instead of .children= to accommodate text nodes.
This is necessary because HtmlElement.children= requires its parameter
type to be a List<Element>, and text nodes are not elements.

Change-Id: I99c91fe060c16f02d737d904f6869b3dad19c196
Reviewed-on: https://dart-review.googlesource.com/57005
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-06-01 20:39:34 +00:00
Paul Berry 72aae537a2 Observatory strong mode fix: clean up port mocking.
Change-Id: If2077620c0243838587d8d689a74f37c54b19c08
Reviewed-on: https://dart-review.googlesource.com/57360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-01 20:34:43 +00:00
Alexander Markov c8860b4ca2 Remove all uses of --limit-ints-to-64-bits VM option
VM option --limit-ints-to-64-bits was enabled by default a while ago,
and now we're preparing to remove it from Dart VM.

This CL removes all uses of this option in preparation for this cleanup.

Issue: https://github.com/dart-lang/sdk/issues/33306
Change-Id: I8f33cf4ca8ce7ef9a171a982346e43dd8cb722a9
Reviewed-on: https://dart-review.googlesource.com/57960
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-06-01 19:32:24 +00:00
Martin Kustermann 0629e3afa5 [VM] Fix vm/cc/DartAPI_TypeGetParameterizedTypes test
This test was looking up "int", "List" ... in a generated test library
instead of the "dart:core" library.

It seems like the old lookup has succeded because the C++ parser adds all
imports to the library object and the lookup mechanism uses the library scope,
which most likely falls back to the import scope.

Issue https://github.com/dart-lang/sdk/issues/33042

Change-Id: I37ea756fe53fe5dcbd8efe24053591816d5fc4af
Reviewed-on: https://dart-review.googlesource.com/57821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-06-01 17:48:14 +00:00
asiva e9a60098bb [VM] Use UserVisibleName for types in error messages reported to users to make the error more clear. This fixes the case in issue 33303.
Bug: 33303
Change-Id: Idd31eadea3d2caca1cc9416b3286d39102bc2108
Reviewed-on: https://dart-review.googlesource.com/57880
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-06-01 16:41:44 +00:00
Vyacheslav Egorov 0aadba1189 Revert "[vm] Enable type stubs based type checks in JIT mode for some types."
This reverts commit 4be50d6fa1.

Reason for revert: Failures on SIMDBC64 and Analyzer bots.

Original change's description:
> [vm] Enable type stubs based type checks in JIT mode for some types.
> 
> For now we are limiting this to type checks against type parameter types.
> 
> # Performance improvements
> 
> In Dart 1 mode Dart2JS compiles itself in 28s when running from source
> and in 23s when running from ideal app-jit snapshot (trained on the
> same workload).
> 
> Before this change in Dart 2 mode numbers were 51s and 57s respectively.
> 
> After this change in Dart 2 mode numbers are 38s and 32s. Meaning
> that regression is reduced by 50%.
> 
> Issue https://github.com/dart-lang/sdk/issues/31798
> Issue https://github.com/dart-lang/sdk/issues/33257
> 
> Change-Id: I34bf5385a5cc3c7702dc281c6dfa89da85d3dde1
> Reviewed-on: https://dart-review.googlesource.com/57601
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com,regis@google.com

Change-Id: I85a30c962b0cd556310e19193f5993ab76ecf2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/57840
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-06-01 11:23:08 +00:00
Vyacheslav Egorov 4be50d6fa1 [vm] Enable type stubs based type checks in JIT mode for some types.
For now we are limiting this to type checks against type parameter types.

# Performance improvements

In Dart 1 mode Dart2JS compiles itself in 28s when running from source
and in 23s when running from ideal app-jit snapshot (trained on the
same workload).

Before this change in Dart 2 mode numbers were 51s and 57s respectively.

After this change in Dart 2 mode numbers are 38s and 32s. Meaning
that regression is reduced by 50%.

Issue https://github.com/dart-lang/sdk/issues/31798
Issue https://github.com/dart-lang/sdk/issues/33257

Change-Id: I34bf5385a5cc3c7702dc281c6dfa89da85d3dde1
Reviewed-on: https://dart-review.googlesource.com/57601
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-06-01 10:50:09 +00:00
Ryan Macnak c984e63f61 Skip tests of snapshot determinism in checked mode.
Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: Ie762ed4be07d6b67cfc35fbcf5a6ba11bfb96d76
Reviewed-on: https://dart-review.googlesource.com/57713
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-31 22:40:05 +00:00
Aart Bik a0c4ac14c1 Omit redundant bounds check for Dart2 on typed setters/getters.
Rationale:
Some native typed setters/getters in the typed_data library
are only called from clients that perform explicit bounds checks
first. Under strongly typed Dart2, there is no need to repeat
these tests. Avoids overhead, and reduces the polymorphicness
of these calls (preparing more inlining later).

https://github.com/dart-lang/sdk/issues/33205

Tests:
./tools/test.py --mode release --arch x64 -r vm
tools/test.py -m release -r vm -c dartk --strong standalone_2/typed_data_test
Change-Id: I81771a4f4b41a21e344f2d50745bbc30480b2a6c
Reviewed-on: https://dart-review.googlesource.com/57460
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-31 21:34:16 +00:00
Samir Jindel 9a02f5bf4d [vm/kernel] Fix bugs with expression evaluation in debug mode.
Fixes #33170: We had an assert that type variables are not bounded by "dynamic".
This assert was previously valid because the FE replaces "extends dynamic" with
"extends Object". However, it's not necessary in any way, and it's difficult to
access the Object type from outside the FE when synthesizing type parameters for
expression compilation.

Fixes #33171: The synthetic class generated during serialization to hold the
synthetic method may need to extend core library classes if the expression's
scope was within a core library class. In this case, the class finalizer needs
to avoid applying the restrictions on class extension to the synthetic class.

To facilitate this, we now use a single class name for all synthetic classes,
rather than copying the original class name. The name of the synthetic class has
no function at all, since the synthetic method is reparented to the original
class before execution.

Fixes #33239: The arguments descriptor passed to InvokeFunction for expression
functions which capture generic type parameters was using the wrong argument
count.

Fixes #33270: Use LookupClassAllowPrivate instead of LookupClass when resolving
the expression's scope in the VM.

Test Plan:

#33170: python tools/test.py -m debug -c dartk --strong service/evaluate_function_type_parameters_test
#33171: python tools/test.py -m debug -c dartk --strong service/eval_test
#33239: Updated "evaluate_function_type_parameters_test.dart".
#33270: Updated "eval_test.dart".

Change-Id: I376926bddd2224ec2322b43685d6c13831f1a8e7
Reviewed-on: https://dart-review.googlesource.com/56060
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-31 18:46:07 +00:00
Samir Jindel 41c5da8919 [vm] Fix non-reproducibility of VM builds.
We recently removed two kind bits from `Function` to free up space for other
bits. This left two bits in `RawFunction::kind_tag_` unused and no longer
deterministically initialized. This caused `Function` objects saved in the
snapshot within the `.rodata` section of the `dart` binary to be serialized with
a non-deterministic kind tag. We now zero-initialize the kind tag.

# Test Plan

I built the `runtime` target (which includes `dart`) 10 times locally and
received the same SHA256 hash for `dart` each time.

Change-Id: Ib0de4b4b040e26a92a1ba3364460bcec0f665789
Reviewed-on: https://dart-review.googlesource.com/57624
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-31 18:36:46 +00:00
Ryan Macnak eb82559db2 Reapply "[vm] Add tests for determinism of script and AppJIT snapshots."
- Fix assembler->Stop("My address is not deterministic").
 - Skip tests on -cdartk + simulators as DFE is too slow.

Bug: https://github.com/dart-lang/sdk/issues/31427
Bug: https://github.com/dart-lang/sdk/issues/33264
Change-Id: Id79a8b8c8fc4b3842fcd1d3827d6d4551890b794
Reviewed-on: https://dart-review.googlesource.com/57483
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-31 17:18:42 +00:00
Paul Berry 9e3842d624 Observatory strong mode fix: fix type errors with onDisconnect.
The method ObservatoryApplication._switchVM calls newVM.onDisconnect
and requires the resulting future to be completed with a String.  In
normal operation, this is satisfied and we just need to change a few
static types to enforce it.  But when FakeVM was in use, the future
was completed with `this`.  Since ObservatoryApplication._switchVM is
the only call site that cares what the future is completed with, it
makes sense to just change all the types to Future<String> and modify
FakeVM accordingly.

Change-Id: Id94d27ac6a42f31ab19ccc9ad8dd270ecf4042b4
Reviewed-on: https://dart-review.googlesource.com/57400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-05-30 20:50:24 +00:00
asiva 3027302af6 [VM] Fix for issue 33277 (skip HasAttemptedReload check for kernel
isolate too).

Bug: 33277
Change-Id: I14c1a1b4e0fd07be6520fd8f77b9c6abddb5a5d0
Reviewed-on: https://dart-review.googlesource.com/57441
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-05-30 20:14:45 +00:00