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

Unified Diff: src/IceThreading.cpp

Issue 916653004: Subzero: Emit functions and global initializers in a separate thread. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Const change Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceThreading.h ('k') | src/IceTranslator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceThreading.cpp
diff --git a/src/IceThreading.cpp b/src/IceThreading.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5576abb2ded87b45f432e446ca5703b6ce7fdafc
--- /dev/null
+++ b/src/IceThreading.cpp
@@ -0,0 +1,48 @@
+//===- subzero/src/IceThreading.cpp - Threading function definitions ------===//
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines threading-related functions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "IceCfg.h"
+#include "IceDefs.h"
+#include "IceThreading.h"
+
+namespace Ice {
+
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq)
+ : Sequence(Seq), Kind(WI_Nop), GlobalInits(nullptr), Function(nullptr),
+ RawFunc(nullptr) {}
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, VariableDeclarationList *D)
+ : Sequence(Seq), Kind(WI_GlobalInits), GlobalInits(D), Function(nullptr),
+ RawFunc(nullptr) {}
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Assembler *A)
+ : Sequence(Seq), Kind(WI_Asm), GlobalInits(nullptr), Function(A),
+ RawFunc(nullptr) {}
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Cfg *F)
+ : Sequence(Seq), Kind(WI_Cfg), GlobalInits(nullptr), Function(nullptr),
+ RawFunc(F) {}
+
+std::unique_ptr<VariableDeclarationList> EmitterWorkItem::getGlobalInits() {
+ assert(getKind() == WI_GlobalInits);
+ return std::move(GlobalInits);
+}
+
+std::unique_ptr<Assembler> EmitterWorkItem::getAsm() {
+ assert(getKind() == WI_Asm);
+ return std::move(Function);
+}
+
+std::unique_ptr<Cfg> EmitterWorkItem::getCfg() {
+ assert(getKind() == WI_Cfg);
+ return std::move(RawFunc);
+}
+
+} // end of namespace Ice
« no previous file with comments | « src/IceThreading.h ('k') | src/IceTranslator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698