There are three types of changes in this CL:
* If there is a repeated per-component sequence of instruction, it is
replaced with a loop (e.g. see Float32x4ConstructorInstr);
* When accessing components in the spilled SIMD values don't use
hardcoded constants but instead compute the offset from op_kind()
(e.g. kFloat32x4WithZ accesses component with index kFloat32x4WithZ - kFloat32x4WithX = 2).
This allows to share code.
* Use setcc and arithmetic to materialize result of the comparison instead of branches;
* Use the fact that true and false are consecutive values in the Thread structure to convert
0/1 to true/false (see Int32x4GetFlagInstr)
* Extract Int32x4 components without spilling the whole SIMD value to the
stack (see Int32x4GetFlagInstr).
This extracted from a larger refactoring CL: https://dart-review.googlesource.com/c/sdk/+/10120
Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: Ic3757789a1ca621b267150133991fed5b85da633
Reviewed-on: https://dart-review.googlesource.com/11080
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Revert "Attempts to fix bugs introduced in 8b6fcf50e85d."
This reverts commit 7568e1f18e.
Revert "Changes calculation of Scavenger's UsedInWords"
This reverts commit 91470e7211.
Revert "Fixes the regression caused by 7568e1f18e."
This reverts commit 479db734e3.
BUG=
Review-Url: https://codereview.chromium.org/2998663002 .
The IO tests unscheduled the mutator thread constantly, forcing the
isolate to fill new space and cause a GC.
Now, the mutator thread keeps its TLAB when unscheduled, taking
advantage of the fact the same thread object will always be the
mutator thread.
R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/2993863002 .
This reverts commit bb6203dade and
adds changes FlushTLS.
Now, FlushTLS will fill the mutator thread's TLAB instead of
changing top_ in the Scavenger. This should prevent the assertion
(thread->end() == 0) || (thread->end() == top_)
in TryAllocateInTLAB in runtime/vm/scavenger.h due to a race on top_.
R=asiva@google.com, rmacnak@google.com, zra@google.com
Review-Url: https://codereview.chromium.org/2991343003 .
Revert "Changes new space allocation from simple bump pointer allocation from"
This reverts commit e6e378bb6e.
Revert "Fixes bug in calculation of memory used by new space"
This reverts commit 044f818f01.
BUG=
Review-Url: https://codereview.chromium.org/2992923002 .
mutator to thread local allocation buffer system used only by mutator.
The new allocation scheme is as follows:
- Mutator allocates an aligned buffer from the heap.
- For each object the mutator wishes to allocate
- If the object fits in the overall space of the bufffer,
bump allocate into the buffer.
- If the object is larger than the buffer overall, allocate into old
space.
- If the object is not larger than the buffer but cannot fit,
make the buffer iterable by GC and allocate a new buffer.
- If the mutator cannot get a new buffer, do a GC and try again.
- If the mutator still cannot get a new buffer, allocate the object
in old space.
- If the mutator does get a new buffer (before or after GC), allocate
the object into the buffer.
BUG=
R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/2985863002 .
This is the first step to adding Thread Local Allocation Buffers to
the VM.
In this step, the mutator alone allocates to the new space, but keeps
track of the start and end of the space. This is akin to a single large
TLAB.
As a result, the generated code and the dbc simulator changed how they
allocate objects into the new space as well.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2980033002 .
This is the first step to adding Thread Local Allocation Buffers to
the VM.
In this step, the mutator alone allocates to the new space, but keeps
track of the start and end of the space. This is akin to a single large
TLAB.
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2951333002 .
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.
Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2750843003 .
This CL improves the stack traces that accompany exceptions. Whenever an
async function is entered, we remember how we got there. This is similar
in spirit to package:stack_trace but the implementation is more efficient
and memory usage can be more easily reasoned about.
Tracking causal stack traces:
- [x] Upon entry to an async function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Upon entry to an async* function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Before returning from an async function, clear the Thread's asynchronous stack trace.
- [x] After resuming an async function, load the sychronous stack trace prefix into the Thread.
- [x] Filter stack traces to remove async machinery.
Service protocol changes:
- [x] Send causal async stack trace.
Observatory changes:
- [x] Display causal async stack trace below async functions.
Fixes https://github.com/dart-lang/sdk/issues/27661R=asiva@google.com, rmacnak@google.com
Comparisons: https://docs.google.com/a/google.com/document/d/10r6jEqr8OCiDZ4y9SYU_uOimcHiOGAZMly2ghTErALI/edit?usp=sharing
Review-Url: https://codereview.chromium.org/2646443005 .
This is a fixed version of c84f30741c90d040254767ff769a40d2cba3fb1a that
resolves issues with comparing uint and intptr_t.
Original Commit Message:
Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track of using a high watermark for both the threads and the isolates. Isolate high watermark information is updated when a thread exits the isolate. The isolate high watermark consists of the sum of all thread high watermarks (including the high watermark of the exiting thread). High watermark information for both threads and isolates is now visible in the isolate view in the Observatory.
BUG=
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2610253002 .
Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track of using a high watermark for both the threads and the isolates. Isolate high watermark information is updated when a thread exits the isolate. The isolate high watermark consists of the sum of all thread high watermarks (including the high watermark of the exiting thread). High watermark information for both threads and isolates is now visible in the isolate view in the Observatory.
BUG=
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2609253002 .
Added methods to surface number of zone and scoped handles in each isolate. These values are displayed in the isolate view page in the Observatory. These handle counts for the native IO isolate will be surfaced in another CL.
BUG=
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2601153002 .
Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track of using a high watermark for both the threads and the isolates. Isolate high watermark information is updated when a thread exits the isolate. The isolate high watermark consists of the sum of all thread high watermarks (including the high watermark of the exiting thread). High watermark information for both threads and isolates is now visible in the isolate view in the Observatory.
BUG=
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2608463002 .
- Adjust fingerprints to be independent of the library's private key, which varies with load order.
- Use usage_counter in AOT inlining decisions if JIT feedback is available.
- Reduce inlining in cold functions.
dart2js product aot snapshot 15841351 -> 14436273 (-8.86%)
R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2562693003 .
- Refactor the JumpToExceptionHandle code so that it is now built from
two pieces: JumpToFrame and RunExceptionHandler.
- Refactor the Simulator::Longjmp() code so that it is no longer
exception-specific. Instead it uses the RunExceptionHandler stub.
This makes it so that the JumpToFrame stub and Simulator::JumpToFrame
have the same semantics. This will make it easier to land the Rewind
changes I am working on.
There are some oddities for dbc.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2503653002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
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 .
- Fix setting exit frame info to indicate when we are executing Dart code.
- Copy local pc to memory on call and return to make it accessible to the profiler. Since the profiler cannot access the local pc, the profiler is not accurate at the instruction level.
- Teach the profiler's stack walker that the stack grows up for Dart frames on DBC.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2250823002 .
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 .
- Optimized instructions in the megamorphic stubs on X64, IA32, ARM, and ARM64.
In a micro benchmark testing megamorphic calls using 71 different receiver types,
the execution times goes from 2.6 sec to 1.4 sec.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2131583002 .