diff options
author | 2012-10-26 13:51:26 -0700 | |
---|---|---|
committer | 2012-11-06 16:07:36 -0800 | |
commit | 02b6a78038f12c109f95eb31713cfc747f5512f1 (patch) | |
tree | c36841561a47b2ce3cf15b00fdae822e5a6c5b64 /src/compiler.cc | |
parent | bcc2926b9721f94c17ed98fae5264cc98f0e066f (diff) |
Parellel mark stack processing
Enabled parallel mark stack processing by using a thread pool.
Optimized object scanning by removing dependent loads for IsClass.
Performance:
Prime: ~10% speedup of partial GC.
Nakasi: ~50% speedup of partial GC.
Change-Id: I43256a068efc47cb52d93108458ea18d4e02fccc
Diffstat (limited to 'src/compiler.cc')
-rw-r--r-- | src/compiler.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler.cc b/src/compiler.cc index b09691211f..4c9860cecb 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -993,7 +993,7 @@ class CompilationContext { self->AssertNoPendingException(); CHECK_GT(work_units, 0U); - std::vector<Closure*> closures(work_units); + std::vector<ForAllClosure*> closures(work_units); for (size_t i = 0; i < work_units; ++i) { closures[i] = new ForAllClosure(this, begin + i, end, callback, work_units); thread_pool_->AddTask(self, closures[i]); @@ -1006,13 +1006,11 @@ class CompilationContext { // Wait for all the worker threads to finish. thread_pool_->Wait(self); - - STLDeleteElements(&closures); } private: - class ForAllClosure : public Closure { + class ForAllClosure : public Task { public: ForAllClosure(CompilationContext* context, size_t begin, size_t end, Callback* callback, size_t stripe) @@ -1031,6 +1029,10 @@ class CompilationContext { self->AssertNoPendingException(); } } + + virtual void Finalize() { + delete this; + } private: CompilationContext* const context_; const size_t begin_; |