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

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

Issue 14159028: Fixed an issue with HConstant::InNewSpace() for parallel compilation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Be able to recognize if running on the optimizer thread Created 7 years, 7 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
« no previous file with comments | « src/optimizing-compiler-thread.h ('k') | src/x64/lithium-x64.cc » ('j') | 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 20 matching lines...) Expand all
31 31
32 #include "hydrogen.h" 32 #include "hydrogen.h"
33 #include "isolate.h" 33 #include "isolate.h"
34 #include "v8threads.h" 34 #include "v8threads.h"
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 39
40 void OptimizingCompilerThread::Run() { 40 void OptimizingCompilerThread::Run() {
41 #ifdef DEBUG
42 thread_id_ = ThreadId::Current().ToInteger(); 41 thread_id_ = ThreadId::Current().ToInteger();
43 #endif
44 Isolate::SetIsolateThreadLocals(isolate_, NULL); 42 Isolate::SetIsolateThreadLocals(isolate_, NULL);
45 43
46 int64_t epoch = 0; 44 int64_t epoch = 0;
47 if (FLAG_trace_parallel_recompilation) epoch = OS::Ticks(); 45 if (FLAG_trace_parallel_recompilation) epoch = OS::Ticks();
48 46
49 while (true) { 47 while (true) {
50 input_queue_semaphore_->Wait(); 48 input_queue_semaphore_->Wait();
51 Logger::TimerEventScope timer( 49 Logger::TimerEventScope timer(
52 isolate_, Logger::TimerEventScope::v8_recompile_parallel); 50 isolate_, Logger::TimerEventScope::v8_recompile_parallel);
53 51
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 OptimizingCompiler* optimizing_compiler) { 135 OptimizingCompiler* optimizing_compiler) {
138 ASSERT(IsQueueAvailable()); 136 ASSERT(IsQueueAvailable());
139 ASSERT(!IsOptimizerThread()); 137 ASSERT(!IsOptimizerThread());
140 Barrier_AtomicIncrement(&queue_length_, static_cast<Atomic32>(1)); 138 Barrier_AtomicIncrement(&queue_length_, static_cast<Atomic32>(1));
141 optimizing_compiler->info()->closure()->MarkInRecompileQueue(); 139 optimizing_compiler->info()->closure()->MarkInRecompileQueue();
142 input_queue_.Enqueue(optimizing_compiler); 140 input_queue_.Enqueue(optimizing_compiler);
143 input_queue_semaphore_->Signal(); 141 input_queue_semaphore_->Signal();
144 } 142 }
145 143
146 144
147 #ifdef DEBUG
148 bool OptimizingCompilerThread::IsOptimizerThread() { 145 bool OptimizingCompilerThread::IsOptimizerThread() {
149 if (!FLAG_parallel_recompilation) return false; 146 if (!FLAG_parallel_recompilation) return false;
150 return ThreadId::Current().ToInteger() == thread_id_; 147 return ThreadId::Current().ToInteger() == thread_id_;
151 } 148 }
152 #endif
153 149
154 150
155 } } // namespace v8::internal 151 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/optimizing-compiler-thread.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698