Related to #29145.
Fixes#29199.
1. Missing source positions in async and async* functions (synthetic code)
2. Added unit tests for issues #28980 and added asyns stack trace testing flags to existing test.
3. Handle uninitialized Completer object when collecting async stack traces.
Still missing is the correct calculation of context levels in ActivationFrame::ContextLevel. This is planned for a separate CL.
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2786503003 .
AssertAssignableInstr::Canonicalize was too restrictive: it can instantiate the
type even if the instantiator is null.
Do not allocate empty TypeArguments handles, but use the common one instead.
R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2759393005 .
In Debug mode we have assertions checking that we don't attempt OSR when
FLAG_use_osr is disabled - however app-jit snapshots are compiled with OSR
enabled and still contain countining and OSR attempting code, which causes
assertions to fail.
Refactor how getters for isolate flags are defined, consolidate all flags into
a single list.
Update test expectations and switch -c dartk configuration to use app-jit snapshot.
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2728163002 .
Simplify handling of closures as deferred objects.
The name "type_arguments_" is confusing, because class Closure is not generic.
Class Closure was forcefully made (kinda) generic by setting its
type_arguments_field_offset_in_words_ field to a valid value, so that the
type_arguments_ field in closure instances could be accessed similarly as in
generic instances. With generic functions, closures will potentially have more
than one instantiator and the name type_arguments_ becomes nonsensical.
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2719603002 .
- [x] Add three public fields to the "BoundVariable" service type: declarationTokenPos, visibleStartTokenPos, and visibleEndTokenPos. (naming suggestions welcome!)
- [x] Extend LocalVarDescriptors to hold the declaration token position (it already had the scope visibility boundaries).
- [x] Extend ContextScope to hold the declaration token position.
- [x] Add a unit test which verifies this works for local variables, function parameters, and closure captured variables.
Fixes https://github.com/dart-lang/sdk/issues/25569
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2419013004 .
Unoptimized code has a static call to optimized code.
Optimized code prologue goes to the OptimizeInvokedFunction runtime.
Callee schedule for background compilation and current code set the return entries return value.
Verify-on-transition triggers a safepoint, wherein the background compiler disables the old optimized code.
The OptimizedInvokedFunction stub calls through the disabled code.
FixCallersTarget see an unoptimized caller. BOOM
Similar problem without --verify-on-transition, except the safepoint comes from BackgroundCompiler::CompileOptimized.
Fixes#26927.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2418673002 .
When throwing to a frame scheduled for lazy deopt, update the continuation pc for that frame to be the catch handler.
Weaken new assert that the deopt pc belongs to the frame's code as the deopt pc for the last eager deopt in a function lies outside the code, after the call to the deopt stub.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2392613002 .
Catch block entries need to be considered when doing lazy deoptimization.
In addition to the return, also patch all catch entry blocks in a function scheduled for lazy deoptimization.
Also, move restoring the pool pointer to the jump-to-handler stub to simplify patching the catch entry.
BUG=#27419
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2357343003 .
Expand the range on a miss if all classes in the range have the same lookup result, otherwise transition to the stub that does a linear scan of ICData.
Because we do a depth-first sort of classes during AOT, if a call site sees only objects all inheriting the same function as the call target, the call site will be handled by this new stub.
Adjust LoadClassIdMayBeSmi on x64 to preserve the object.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2279563002 .
The call sequence is very similar to a classic IC call, except the guarded class and the target are loaded indirectly from the constant pool instead of as immediates. In the monomorphic case, we call directly to the expected target with a class check in the callee. In the unlinked, polymorphic and megamorphic cases, we call a stub; these case are now call-through instead of call-and-return.
Every code, except stubs involved in switchable calls, includes the class check sequence at the beginning. So we now distinguish between a checked and an unchecked entry point. Generated code except the switchable call continues to use the unchecked entry point.
PC offsets are calculated relative to the beginning of the instruction stream, rather than either entry point.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2226893002 .
We now check all of the scripts which make up a library. If any
script is modified, then we consider that library to be modified. We
also consider any library which imports a modified library to be
modified. To propagate this info efficiently, we build and discard
the imported-by graph when beginning a reload.
The embedder must provide a FileModifiedCallback in order to support
the detection of modified scripts.
In order to detect changes to package: libraries, we have modified the
embedder interface to provide the resolved url when possible, so that
we don't need to re-resolve package uris when checking for reload.
This change is incompatible and all embedders will need to be updated.
We now support a "force" flag when reloading sources. This causes all
libraries to be reloaded regardless of whether the underlying scripts
have been updated.
Closes#26919R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2186423002 .
1. Make CheckArrayBoundInstr also check the index for smi. This allows easy replacement
of the deoptimizing checks with the slow-path checks in the precompiler.
2. Add GenericCheckBoundInstr which has a slow-path attached for
handling check failures.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org/2149023002 .
Fixes crash:
runtime/vm/object.h: 4787: error: expected: raw() != null()
(gdb) bt
#0 0x00007ffff6c01c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff6c05028 in __GI_abort () at abort.c:89
#2 0x000000000084b879 in dart::OS::Abort () at runtime/vm/os_linux.cc:424
#3 0x00000000005c0585 in dart::DynamicAssertionHelper::Fail (this=this@entry=0x7ffff5776390,
format=format@entry=0xb9f864 "expected: %s") at runtime/platform/assert.cc:46
#4 0x000000000062e68b in dart::Code::raw_ptr (this=0x7fffe8181ad0) at runtime/vm/object.h:4787
#5 0x00000000007ce875 in var_descriptors (this=this@entry=0x7fffe8181ad0) at runtime/vm/object.h:4593
#6 dart::Code::GetLocalVarDescriptors (this=this@entry=0x7fffe8181ad0) at runtime/vm/object.cc:13582
#7 0x000000000066159a in dart::ActivationFrame::GetVarDescriptors (this=0x7ffff5776980) at runtime/vm/debugger.cc:580
#8 0x0000000000665ed5 in GetVarDescriptors (this=0x7ffff5776980) at runtime/vm/debugger.cc:788
#9 dart::ActivationFrame::GetDescIndices (this=this@entry=0x7ffff5776980) at runtime/vm/debugger.cc:719
#10 0x0000000000666121 in dart::ActivationFrame::NumLocalVariables (this=this@entry=0x7ffff5776980) at runtime/vm/debugger.cc:792
#11 0x0000000000629a00 in DRT_HelperStackOverflow (zone=<optimized out>, thread=0x12bf680, isolate=<optimized out>, arguments=...)
at runtime/vm/code_generator.cc:1324
#12 dart::DRT_StackOverflow (arguments=...) at runtime/vm/code_generator.cc:1217
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2141503005 .
- [x] Start reloading even earlier.
- [x] Keep the value of FLAG_reload_every per-isolate (so spawned isolates reload eagerly too).
- [x] Adjust the reload every back off curve to be linear in the beginning.
- [x] Cap the reload every threshold at 1,000,000
- [x] Test status file updates.
- [x] Stop disabling the background compiler / OSR when running tests.
- [x] Skip multi tests with compilation errors when reloading.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2133823002 .
- [x] Add --hot-reload-test-mode to standalone embedder.
- [x] Have test.py pass `--hot-reload-test-mode` instead of specific flags.
- [x] Add --reload_every_back_off flag to control exponential backof off reloads.
- [x] Add --check_reloaded flag to ensure that an isolate has reloaded at least once before exiting.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2118923002 .
- [x] Report the reload error synchronously from the _reloadSources RPC.
- [x] Add sticky reload error to an isolate so we can report the error.
- [x] Remove redundant 'OnStackReload'.
- [x] Fix a bug where a class could have a field added but we wouldn't reject it.
- [x] Add unit test for above bug fix.
- [x] Enable reload via the service protocol with a live stack.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2070873002 .