- [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 .
Most of the infrastructure is fixed to work with DBC stack layout:
- register allocator allocates DBC registers with the limitation that we allocate only 20 registers and bail out if anything needs spilling (there is no use implementing spilling on DBC because registers are memory locations themselves). We should be able to bump number of CPU registers on DBC up to 256 but this requires major surgery in some parts - so I postponed this;
- lazy deoptimization is implemented, eager deoptimization is not - because we don't emit any code that actually requires it. it's a minor change to support it once we have a target;
- stack scanning respects stack maps built by registers allocator;
We bailout from all unsupported instructions.
R=zra@google.com
Review URL: https://codereview.chromium.org/1992963002 .
This is a cut of the work that Todd and I collaborated on in the reload branch.
In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.
- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1965823002 .
Initializer expressions are evaluated only once. Therefore, do not store
constant expressions in the constant cache, since they will never be
used again.
Except: when generating a stack trace and accessing the local variables
in a the stack frame of an initializer expression (static final getter function),
the constant will have to be recomputed instead of retrieved from the cache.
This CL also disables the stacktrace_every stress flag while a stack trace
is being collected, to avoid recursive requests for stack traces.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1934733002 .
Fix a crash in debugger: in background compilation check if the function is still marked as optimizable; setting breakpoints at runtime can change that.
Add flag --stress-test-background-compilation which re-feeds compiled functions into the compilation queue.
Add various asserts related to background compilation.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1884213004 .
stack_limit_,
stack_overflow_flags_,
saved_stack_limit_,
stack_overflow_count_ and
other interrupts mask fields from Isolate structure to Thread structure
- Change the stack overflow check in the prolog to load the stack limit
from the THR register, this removes the back to back dependent loads to
load the stack limit from the Isolate structure
R=johnmccutchan@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1812753002 .