dart-sdk/runtime
Kevin Millikin 65b19ffa3c Translate asserts in the VM-specific async translation
Translate assert statements in async functions.  The translation of
the condition subexpression can produce a sequence of statements that
have been hoisted out of it.  These need to be guarded so they are
executed only when asserts are enabled.

For this purpose, we introduce an AssertBlock.  The semantics of the
assert block:

assert { s0; ...; sn; }

is the same as:

if (assertsEnabled) { s0; ...; sn; }

where assertsEnabled is a more primitive nullary expression that is
true iff. assertions are enabled.  We chose not to encode this using a
construct like assertsEnabled because (1) we would have to support it
appearing as an arbitrary expression which we don't currently need
and (2) it requires deeper pattern matching to detect and skip the
guarded code when desired.

The translation is more complicated because if there is a message
subexpression in an assert, it is conditionally evaluated only if the
assert's condition is false.

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

Change-Id: I0912a57104ede3160533e49f65b6fb79b76f1500
Reviewed-on: https://dart-review.googlesource.com/46442
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-03-14 19:41:09 +00:00
..
bin [VM] Refactored console configuration out of platform_*.cc into console_config.h and reapplied c9700040c3 for POSIX platforms (Windows needs more work). We may also want to move code in bin/stdio.h. 2018-03-12 20:31:09 +00:00
include [vm] Stream writing snapshots as assembly to reduce peak memory usage. 2018-03-08 19:26:17 +00:00
lib Revert "[VM] Move runtime/lib/{developer,profiler,timeline}.dart -> ..._patch.dart, fix owner of constructors" 2018-03-13 22:24:19 +00:00
observatory [VM] Remaining fixes for flutter coverage issue 2018-03-14 17:08:17 +00:00
platform [vm] Move some string utils from runtime/vm to runtime/platform. 2018-03-01 02:07:46 +00:00
tests/vm [vm] Fix type test '_Closure class IS FunctionType' in strong mode 2018-03-13 19:08:56 +00:00
third_party
tools Read patch files in strong mode 2018-02-05 14:35:36 +00:00
vm Translate asserts in the VM-specific async translation 2018-03-14 19:41:09 +00:00
.gitignore
BUILD.gn Revert "[build] Declare dependency of the version strings on the current Git commit." 2018-03-10 00:39:50 +00:00
codereview.settings
CPPLINT.cfg
PRESUBMIT.py
runtime_args.gni [infra,flutter] Adds semantically meaningful custom version strings 2018-02-16 20:44:48 +00:00