If an error happens during the compilation of a function body, an Error is thrown which can be intercepted, and ensures that finally blocks are executed before the isolate is terminated.
The language spec is vague about compilation errors. A doc describing the intentions behind this CL is at
https://docs.google.com/document/d/1_MWOgwJadLCQSBps0zD6Rj5dG4iP1UBuiDvTMH-WMzI/edit#
Example:
1 void bad() {
2 return 5
3 }
4
5 void main(args) {
6 bad();
7 }
Before this CL:
$ dart ~/tmp/e.dart
'file:///Users/hausner/tmp/e.dart': error: line 2 pos 11: semicolon expected
return 5
^
$
After this change:
$ dart ~/tmp/e.dart
Unhandled exception:
'file:///Users/hausner/tmp/e.dart': error: line 2 pos 11: semicolon expected
return 5
^
#0 main (file:///Users/hausner/tmp/e.dart:6:3)
#1 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#2 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
$
Notice that the stack trace points to the call site of bad(), not the text location of the syntax error. That's not a bug. The location of the syntax error is given in the error message.
BUG= https://github.com/dart-lang/sdk/issues/23684R=asiva@google.com, lrn@google.com
Review URL: https://codereview.chromium.org/2044753002 .
First, the look for trusted root certificates
in standard locations on the file system
(/etc/pki/tls/certs/ca-bundle.crt followed by
/etc/ssl/certs), and only if these do not exist
will we fall back on the compiled-in trusted root
certificates. This behavior can be overridden
with the new flags --root-certs-file and
--root-certs-cache.
R=asiva@google.com
Review URL: https://codereview.chromium.org/2346683003 .
Statically linking in the tcmalloc code is enough
to override the built-in malloc. I have this set up to
exclude the code for collecting heap profiles in a
Product build. There's still about a 230KB increase in
binary size, though. I think this isn't a big problem
since right now this is enabled only for server Linux.
product binary size:
before x64: 9569600
after x64: 9807840
increase: 238240 (2.5%)
before ia32: 9122836
after ia32: 9360944
increase: 238108 (2.6%)
before mips: 9418680
after mips: 9640940
increase: 222260 (2.4%)
InitialRSS:
product:
before x64: 6307840
after x64: 7430144
increase: 1122304 (17.8%)
release (--no-profiler)
before x64: 7843840
after x64: 9207808
increase: 1363968 (17.4%)
R=asiva@google.com, whesse@google.com
Review URL: https://codereview.chromium.org/2316813002 .
- Conditionally remove fields of Code, Function and ICData that are not used in the AOT runtime.
- Don't include RawClosureData.context_scope_ in AOT snapshots.
- Remove parameter names not needed for method resolution.
- Remove parameter types not needed for function type tests.
- Deduplicate parameter name and parameter type lists.
- Shrink and share the initial MegamorphicCache table.
Flutter gallery (IsolateSnapshotReader event)
snapshot size 2731129 -> 2199999 (-19.4%)
initial heap 7899568 -> 5433176 (-31.2%)
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2326483005 .
- [x] Don't show "(Connected)" next to a VM we aren't connected to.
- [x] Navigate to the vm-connect page if we get an initial connection error.
- [x] Fix regression of the 'vm disconnected' notification bubble not appearing.
- [x] Use the Uris helper class instead of hard coded paths
- [x] Improve user inputted URI normalization
- [x] Ignore network errors on stream subscription requests
- [x] On first launch, attempt to connect to the default target and not the last target connected to.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2340973002 .
Don't expect to find a Dart frame on the stack when an exception
occurs in background compilation. Propagate OOM error as an
unhandled exception, and disable optimization for the function
where it occurred.
BUG=#27206
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2341523002 .
Eliminate the need to invoke an execute-once function to compute
type literals and implicit closures. This reduces the number of
execute-once invocations from 6000 to 60 when compiling all of
the greentea sources, about 1MB of generated code. Sadly, no
significant runtime gain was observed.
Also simplify the caching of computed compile-time constants.
Reinstate the compiler stat counter for number of constants cached.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2338463003 .
Consider code like
try {
something();
} finally {
assert(expr);
}
The compiler de-sugars this into
try {
something();
} catch (_) {
rethrow;
} finally {
assert(expr);
}
In unchecked mode this leaves an empty finally-block, but we would still
have the overhead of the try-catch. This CL avoids this unnecessary overhead
by making try-finally with an empty finally zero-cost.
BUG=#27274
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2322853003 .