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

Side by Side Diff: src/IceGlobalContext.h

Issue 997773002: Refactor Subzero initialization and add a browser callback handler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add argv note Created 5 years, 9 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
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceInstX8632.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares aspects of the compilation that persist across 10 // This file declares aspects of the compilation that persist across
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // no more work - the queue is empty and either end() has been 293 // no more work - the queue is empty and either end() has been
294 // called or the Sequential flag was set. 294 // called or the Sequential flag was set.
295 std::unique_ptr<Cfg> optQueueBlockingPop(); 295 std::unique_ptr<Cfg> optQueueBlockingPop();
296 // Notifies that no more work will be added to the work queue. 296 // Notifies that no more work will be added to the work queue.
297 void optQueueNotifyEnd() { OptQ.notifyEnd(); } 297 void optQueueNotifyEnd() { OptQ.notifyEnd(); }
298 298
299 void emitQueueBlockingPush(EmitterWorkItem *Item); 299 void emitQueueBlockingPush(EmitterWorkItem *Item);
300 EmitterWorkItem *emitQueueBlockingPop(); 300 EmitterWorkItem *emitQueueBlockingPop();
301 void emitQueueNotifyEnd() { EmitQ.notifyEnd(); } 301 void emitQueueNotifyEnd() { EmitQ.notifyEnd(); }
302 302
303 void initParserThread() {
304 ThreadContext *Tls = new ThreadContext();
305 auto Timers = getTimers();
306 Timers->initInto(Tls->Timers);
307 AllThreadContexts.push_back(Tls);
308 ICE_TLS_SET_FIELD(TLS, Tls);
309 }
310
303 void startWorkerThreads() { 311 void startWorkerThreads() {
304 size_t NumWorkers = getFlags().getNumTranslationThreads(); 312 size_t NumWorkers = getFlags().getNumTranslationThreads();
305 auto Timers = getTimers(); 313 auto Timers = getTimers();
306 for (size_t i = 0; i < NumWorkers; ++i) { 314 for (size_t i = 0; i < NumWorkers; ++i) {
307 ThreadContext *WorkerTLS = new ThreadContext(); 315 ThreadContext *WorkerTLS = new ThreadContext();
308 Timers->initInto(WorkerTLS->Timers); 316 Timers->initInto(WorkerTLS->Timers);
309 AllThreadContexts.push_back(WorkerTLS); 317 AllThreadContexts.push_back(WorkerTLS);
310 TranslationThreads.push_back(std::thread( 318 TranslationThreads.push_back(std::thread(
311 &GlobalContext::translateFunctionsWrapper, this, WorkerTLS)); 319 &GlobalContext::translateFunctionsWrapper, this, WorkerTLS));
312 } 320 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } 505 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); }
498 ~OstreamLocker() { Ctx->unlockStr(); } 506 ~OstreamLocker() { Ctx->unlockStr(); }
499 507
500 private: 508 private:
501 GlobalContext *const Ctx; 509 GlobalContext *const Ctx;
502 }; 510 };
503 511
504 } // end of namespace Ice 512 } // end of namespace Ice
505 513
506 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H 514 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H
OLDNEW
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698