Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: src/optimizing-compiler-thread.cc

Issue 13982023: Do not dereference handles during relocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/heap.h ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 Barrier_AtomicIncrement(&queue_length_, static_cast<Atomic32>(-1)); 81 Barrier_AtomicIncrement(&queue_length_, static_cast<Atomic32>(-1));
82 82
83 // The function may have already been optimized by OSR. Simply continue. 83 // The function may have already been optimized by OSR. Simply continue.
84 OptimizingCompiler::Status status = optimizing_compiler->OptimizeGraph(); 84 OptimizingCompiler::Status status = optimizing_compiler->OptimizeGraph();
85 USE(status); // Prevent an unused-variable error in release mode. 85 USE(status); // Prevent an unused-variable error in release mode.
86 ASSERT(status != OptimizingCompiler::FAILED); 86 ASSERT(status != OptimizingCompiler::FAILED);
87 87
88 // The function may have already been optimized by OSR. Simply continue. 88 // The function may have already been optimized by OSR. Simply continue.
89 // Mark it for installing before queuing so that we can be sure of the write 89 // Mark it for installing before queuing so that we can be sure of the write
90 // order: marking first and (after being queued) installing code second. 90 // order: marking first and (after being queued) installing code second.
91 optimizing_compiler->info()->closure()->MarkForInstallingRecompiledCode(); 91 { Heap::RelocationLock relocation_lock(isolate_->heap());
92 optimizing_compiler->info()->closure()->MarkForInstallingRecompiledCode();
93 }
92 output_queue_.Enqueue(optimizing_compiler); 94 output_queue_.Enqueue(optimizing_compiler);
93 } 95 }
94 96
95 97
96 void OptimizingCompilerThread::Stop() { 98 void OptimizingCompilerThread::Stop() {
97 ASSERT(!IsOptimizerThread()); 99 ASSERT(!IsOptimizerThread());
98 Release_Store(&stop_thread_, static_cast<AtomicWord>(true)); 100 Release_Store(&stop_thread_, static_cast<AtomicWord>(true));
99 input_queue_semaphore_->Signal(); 101 input_queue_semaphore_->Signal();
100 stop_semaphore_->Wait(); 102 stop_semaphore_->Wait();
101 103
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 146
145 #ifdef DEBUG 147 #ifdef DEBUG
146 bool OptimizingCompilerThread::IsOptimizerThread() { 148 bool OptimizingCompilerThread::IsOptimizerThread() {
147 if (!FLAG_parallel_recompilation) return false; 149 if (!FLAG_parallel_recompilation) return false;
148 return ThreadId::Current().ToInteger() == thread_id_; 150 return ThreadId::Current().ToInteger() == thread_id_;
149 } 151 }
150 #endif 152 #endif
151 153
152 154
153 } } // namespace v8::internal 155 } } // namespace v8::internal
OLDNEW
« src/heap.h ('K') | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698