Don't expand mark-stack during mutator stack scanning
With the current implementation, we left a window where one mutator is
writing to the mark-stack, while another thread finds it full and tries
to expand it. This can cause data race and missing references from being
marked.
We can instead have thread-local overflow arrays be allocated when the
mark-stack is full, and pass them to the gc-thread to be processed
after checkpoint.
The CL also now directly pushes references to the mark-stack, rather
than creating a buffer on the stack. This avoids one (unnecessary) copy
of references.
Test: art/test/testrunner/testrunner.py --host --debug
Change-Id: Id9d4303f9cc9e3f172e7b172508157836bd6a915
3 files changed