Parallel compilation fix: the optimizer thread shouldn't change the allow...

Parallel compilation fix: the optimizer thread shouldn't change the allow allocation state on AssertNoAllocation scopes.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/14796014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 77924e7e
...@@ -872,6 +872,8 @@ bool EnterAllocationScope(Isolate* isolate, bool allow_allocation) { ...@@ -872,6 +872,8 @@ bool EnterAllocationScope(Isolate* isolate, bool allow_allocation) {
bool active = !isolate->optimizing_compiler_thread()->IsOptimizerThread(); bool active = !isolate->optimizing_compiler_thread()->IsOptimizerThread();
bool last_state = isolate->heap()->IsAllocationAllowed(); bool last_state = isolate->heap()->IsAllocationAllowed();
if (active) { if (active) {
// TODO(yangguo): Make HandleDereferenceGuard avoid isolate mutation in the
// same way if running on the optimizer thread.
isolate->heap()->set_allow_allocation(allow_allocation); isolate->heap()->set_allow_allocation(allow_allocation);
} }
return last_state; return last_state;
...@@ -879,7 +881,10 @@ bool EnterAllocationScope(Isolate* isolate, bool allow_allocation) { ...@@ -879,7 +881,10 @@ bool EnterAllocationScope(Isolate* isolate, bool allow_allocation) {
void ExitAllocationScope(Isolate* isolate, bool last_state) { void ExitAllocationScope(Isolate* isolate, bool last_state) {
isolate->heap()->set_allow_allocation(last_state); bool active = !isolate->optimizing_compiler_thread()->IsOptimizerThread();
if (active) {
isolate->heap()->set_allow_allocation(last_state);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment