- A task has its own MarkingVisitor and SkippedCodeFunctions.
- Weak processing still happens on main thread, with tasks paused.
- Finalization (detaching code) happens in task.
- Cmdline-flag "marker_tasks=0" reverts to old behavior.
BUG=
Review URL: https://codereview.chromium.org//1309033007 .
This mimics the behavior of the pthreads destructor protocol:
"At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument."
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//1309563004 .
- InterruptableThreadState is gone.
- Moved InterruptableThreadState fields directly into Thread.
- Iterate over all threads in an isolate when profiling.
- Still only sample the mutator thread.
Fix ThreadRegistry leak
- When deleting a Thread, iterate over all isolates and remove it from the isolate's thread registry.
R=iposva@google.com
Review URL: https://codereview.chromium.org//1293253005 .
Adding this unit test ensures that we do not add any new code to the dependencies of the GC that assumes the current thread is the main mutator.
* Equip helper threads with a store buffer automatically, just like for the main thread.
* Share code by refactoring flushing.
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//1289153002 .
Move the field from Isolate to Thread::state_ to allow using a single thread local key.
Profiling is still only enabled for the Dart mutator thread.
The next step is to migrate the VM tags.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1261923008 .
Prepares for parallel processing of a shared marking stack, but code remains
unsynchronized for now.
Share basic data structures with the StoreBuffer.
BUG=
Review URL: https://codereview.chromium.org//1271833002 .
Cache a pointer to the isolate's Heap in the Thread object
and use it in generated code for allocation.
Change generated allocation code to load allocation-top and
end via THR (THR->heap.top). This is slightly slower than
embedding the address, but faster than loading it
via the Isolate (THR->isolate->heap.top)
BUG=
R=koda@google.com
Review URL: https://codereview.chromium.org//1263513002 .
In release mode, there seems to be nothing to prevent this.
In debug mode, the "Verify" call waits for the sweeper, but there is still a race between the task count update and the ExitIsolateAsHelper call, which could cause problems.
Fix both of these, and add more assertions and verbose error messages.
- make sweeper task cleanly exit isolate *before* notifying
- wait for sweeper before shutting down isolate
- verbose pthread failures
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//1233563004 .
This is needed to enable parallel marking/sweeping (and in the future, compilation) tasks to have their own zone allocations and to safely call code that relies on various scoped constructs (stack resources).
The next step is to migrate the scopes like NoSafepointScope, NoHandleScope, etc. from isolate- to thread-based interfaces.
NOTE: This is a copy of issue 1204303003.
BUG=
Review URL: https://codereview.chromium.org//1226403003 .
This saves code size and also makes intrinsic code relocatable since
the UpdateStoreBuffer-stub is now called indirectly (loaded from THR)
instead of embedded as an immediate.
Also addressed feedback from previous CL.
BUG=
R=koda@google.com
Review URL: https://codereview.chromium.org//1227733002 .
They can be loaded via the THR register.
In particular, do this for null, true, false, and the entry point of the UpdateStoreBufferStub.
This will help supporting precompilation and reduce memory usage from constant pools (assuming there are more constant pools than threads).
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1225933002.
Keep cache of empty blocks shared among all isolates, limited in size.
Change overflow threshold check to include partially filled blocks.
Make Isolate::store_buffer_ a pointer, now that it's less frequently accessed, to keep the offsets of other fields small
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//1173043002.
* Use real isolate in concurrent sweeper rather than shallow copy.
The only part of the isolate, other than the page being swept, used by the sweeper is the class table (via RawObject::Size), which is now safe to read concurrently (copy-on-write).
* Do not eagerly destroy a VM thread whenever it exits an isolate.
This extends the lifetime of a VM thread across entering/exiting multiple isolates. This is necessary in case an embedder callback executes during
compilation and switches/spawns isolates.
For embedder threads, since there is no API to signal "I'm done using the VM in this thread", this means we leak the (small) Thread structure.
For our own ThreadPool threads, we explicitly clean up.
BUG=23153
R=iposva@google.com
Review URL: https://codereview.chromium.org//1136143003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45810 260f80e4-7a28-3924-810f-c04153c831b5
Since the Thread structure is currently cleared on Enter/ExitIsolate,
there is a risk that CHA is cleared if an embedder callback executes during
compilation and switches/spawns isolates. This CL eliminates that risk.
However, Isolate is still not a good long-term place for CHA,
since it doesn't fit with a concurrent compilation model. Issue 23153 tracks
the work towards a permanent solution that couples its life cycle with
compilation.
R=fschneider@google.com, iposva@google.com
Review URL: https://codereview.chromium.org//1061243003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45121 260f80e4-7a28-3924-810f-c04153c831b5
The life cycle of Thread is still coupled with the life cycle of Isolate, but the added indirection allows the migration work to proceed, at negligible performance impact.
This is a small step towards making Thread different from Isolate and allow a many-to-one relationship. In particular, in prepares for being able to have the sweeper have some minimal separate state from the main thread (eliminating the current fake-isolate hack).
Concretely, it moves the thread-local storage key into the Thread class, but for now, keeps a "main_thread" in Isolate for quick access in native/runtime_entry.
Also moves cha_ field to Thread (the first of many fields that will move).
To summarize, this CL enables the next steps:
- moving other fields from Isolate to Thread without circular include-dependencies
- replacing sweeper's fake Isolate with a helper Thread (referencing the original Isolate)
Also add 'volatile' to local variables that clang thinks could be clobbered.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1037453002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44703 260f80e4-7a28-3924-810f-c04153c831b5