After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.
Reland with fix to NativeArgument setup in simulator_arm.cc
Change-Id: Ib9b4df6eb4d997dfbe361188b8a127828c1d9c6f
Reviewed-on: https://dart-review.googlesource.com/74003
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
So far the frontend (parser, flow graph builder, ssa construction) were
aware of the actual frame layout.
This CL makes the indices we assign to [LocalVariable]s logical
indices, assigning:
* M parameters the indices 1 ... M
* N local variables the indices 0 -1 ... -(N-1)
The scope building, flow graph builder and ssa construction operate on
those logical indices.
When emitting actual code, the backend will translate those indices into
actual FP relative indices. This allows us to be more flexible in the
backend which frame layout we choose.
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I9a504bf97821c257aafd2b3430df9f4c9da4b442
Reviewed-on: https://dart-review.googlesource.com/57321
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Previously there were places in the code where an API accepted a
`bool validate_frames` and call sites passed an enum value (which
implicitly got converted to a bool).
By changing the APIs to require an enum, the compiler will tell us if a
caller doesn't pass one.
Change-Id: I29fcd0b018e6cdd7e00b5bb03e83b9636d1345d4
Reviewed-on: https://dart-review.googlesource.com/57823
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Improves the space overhead of compaction from O(size of live objects) to O(number of live objects).
Future work includes:
- a smaller, faster representation the forwarding table via a bitmap of used allocation units
- sorting class sizes off-heap to allow sliding classes
- running forwarding in parallel
Removes unnecessary sweep from evacuating compactor.
Change-Id: If0991bfb75573201c6e8feed142ca0cc69fccab4
Bug: https://github.com/dart-lang/sdk/issues/30978
Reviewed-on: https://dart-review.googlesource.com/15988
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
The assertions which tried to assert that we only use
StackFrameIterator to walk frames of the current thread was incorrect.
We already have cases where other threads will walk the stack of the
mutator thread, see below for an example where this can happen.
Thread::VisitObjectPointers was incorrectly passing Thread::Current() to
the StackFrameIterator instead of 'this'. (Code in thread_registry.cc will
loop over a number of threads and calls VisitObjectPointers on them)
Mutator thread:
0 pthread_cond_wait@@GLIBC_2.3.2
1 dart::Monitor::WaitMicros
2 dart::Monitor::Wait
3 dart::MonitorLocker::Wait
4 dart::ThreadBarrier::Sync
5 dart::GCMarker::MarkObjects
6 dart::PageSpace::MarkSweep
7 dart::Heap::CollectOldSpaceGarbage
8 dart::Heap::CollectNewSpaceGarbage
9 dart::Heap::CollectGarbage
10 dart::DN_HelperObject_<native>
11 dart::BootstrapNatives::<native>
<dart frames>
MarkTask thread:
1 dart::EntryFrame::VisitObjectPointers
2 dart::Thread::VisitObjectPointers <---- Walks mutator thread stack
3 dart::ThreadRegistry::VisitObjectPointers <---- Iterates over a number of threads
4 dart::Isolate::VisitStackPointers
5 dart::Isolate::VisitObjectPointers
6 dart::GCMarker::IterateRoots
7 dart::MarkTask::Run
8 dart::ThreadPool::Worker::Loop
9 dart::ThreadPool::Worker::Main
10 dart::ThreadStart
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2845053003 .
Use that to sync variables to predefined stack
slots inside of exception handler, not before
each MayThrow() instruction.
In JIT mode we can avoid storing extra metadata
by using deopt info instead.
Introduce caching of metadata and
exception handler based on PC.
R=fschneider@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2734323003 .
Use that to sync variables to predefined stack
slots inside of exception handler, not before
each MayThrow() instruction.
In JIT mode we can avoid storing extra metadata
by using deopt info instead.
Introduce caching of metadata and
exception handler based on PC.
R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2640853002 .
We have a racy read of the object header in the stack frame walker
called from the profiler (in this case the gc marker is running at
the same time).
It is appropriate to avoid this even though we think the access is
safe as the objects are in old space and never forwarded and only
the mark bits are manipulated while marking
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2517473002 .
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 .
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).
There are some cleanups I plan on doing as a follow up CL:
- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()
R=iposva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1644793002 .
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.
All non-ia32 platforms:
No entry patching.
ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1192103004 .
This allows to make the last explicitly named stubs shared between isolates.
When sharing code stubs, we can't do patching at their entry anymore.
Therefore, I had to remove patching support of the array allocation stub.
Is this a functionality we want to keep?
The change is mostly performance-neutral because optimized code has an inlined fast
path for array allocation and only uses the stub for the slow-case.
The only isolate-specific stubs left are object allocation stubs which are
associated with their Class are per-isolate.
Since this CL removes any isolate-specific stubs from StubCode, it becomes AllStatic.
BUG=
R=koda@google.com
Review URL: https://codereview.chromium.org//1247783002 .
This adds meta-information to object pool entries to allow storing
untagged immediates or code addresses (ExternalLabel) directly.
This eliminates the need to generate extra code to preserve the LSB
when storing immediates as smis (x64, arm64).
BUG=
Review URL: https://codereview.chromium.org//1175523002.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.
This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//678763004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
When we call a closure, the caller saves the context before the call.
So when walking the stack, we used to check the callee activation to
see if it was a closure call, and then recover our caller-saved
context.
This breaks down in the following case:
1. Caller calls function F.
2. Function F is compiled.
3. The compiler needs to run code to evaluate a constant (e.g. a
static final getter).
4. We hit a breakpoint *while* evaluating the constant.
In this case, there is no callee frame for the closure call yet.
I fix this by using the the pc descriptors to see if the current pc in
the caller is a closure call. This avoids needing to have a callee
frame available.
---
ALSO:
New flags:
--verify-incoming-contexts: in development - verify assumptions about
contexts in stub code. (currently ia32 only)
--trace-debugger-stacktrace: this helps debug these kinds of
stacktrace issues.
Miscellaneous improvements to frame and context printing.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//240213004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35130 260f80e4-7a28-3924-810f-c04153c831b5
- Split runtime and native entry tags.
- Set runtime / native entry address as vm tag in stubs.
- Add reverse native entry resolver (pc to name) to public API (breaking change).
- Hookup reverse resolver for standalone VM (io + bootstrap + builtin natives).
- Runtime entries are registered with tags.
- Profiler queries for tag names via the reverse native entry resolver.
- Profiler outputs named entry tags as children under parent tag (runtime or native).
R=asiva@google.com
Review URL: https://codereview.chromium.org//227433004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34941 260f80e4-7a28-3924-810f-c04153c831b5
inlined frames.
------------
Most remaining deoptimization code from the code generator moves to
DeoptContext. This allows the code to be reused by the debugger.
There is some rework of the code along the way. The remaining code in
the code generator is simpler.
Implement the ability to deopt a frame to an Array. Each inlined
frame accesses its locals from this array at some fixed offset.
Refactor the Debugger::CollectStackTrace code. New code is int
Debugger::CollectStackTraceNew. There is a flag --use_new_stacktrace
which can be used to revert back to the old version. I intend to
remove this flag shortly, after any dust clears.
Added a unit test which makes sure that we can inspect locals from
optimized and inlined frames. Tested this code in the dart editor
debugger as well.
R=iposva@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//26255004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28468 260f80e4-7a28-3924-810f-c04153c831b5