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

Unified Diff: src/IceGlobalContext.h

Issue 1257283004: Iasm and obj lowering for advanced switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 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
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index d19249d40c2f9aaa6bedf2b27a2b4e328abb4914..c71f19155898b906791889ff36cde9b3f41226b5 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -20,6 +20,7 @@
#include "IceClFlags.h"
#include "IceIntrinsics.h"
#include "IceRNG.h"
+#include "IceSwitchLowering.h"
#include "IceThreading.h"
#include "IceTimerTree.h"
#include "IceTypes.h"
@@ -55,6 +56,7 @@ public:
}
~LockedPtr() { Lock->unlock(); }
T *operator->() const { return Value; }
+ T &operator*() const { return *Value; }
private:
T *Value;
@@ -209,6 +211,13 @@ public:
/// Returns a copy of the list of external symbols.
ConstantList getConstantExternSyms();
+ /// Return a locked pointer to the registered jump tables.
+ LockedPtr<std::vector<JumpTableData>> getJumpTables() {
+ return LockedPtr<std::vector<JumpTableData>>(&JumpTables, &JumpTablesLock);
+ }
+ /// Create a new jump table entry and return a reference to it.
+ JumpTableData &addJumpTable(IceString FuncName, SizeT Id, SizeT NumTargets);
+
const ClFlags &getFlags() const { return Flags; }
bool isIRGenerationDisabled() const {
@@ -335,6 +344,8 @@ public:
void lowerConstants();
+ void lowerJumpTables();
+
void emitQueueBlockingPush(EmitterWorkItem *Item);
EmitterWorkItem *emitQueueBlockingPop();
void emitQueueNotifyEnd() { EmitQ.notifyEnd(); }
@@ -456,6 +467,11 @@ private:
std::unique_ptr<ConstantPool> ConstPool;
ICE_CACHELINE_BOUNDARY;
+ // Managed by getJumpTables()
+ GlobalLockType JumpTablesLock;
+ std::vector<JumpTableData> JumpTables;
Jim Stichnoth 2015/07/30 15:20:23 Make vector<JumpTableData> into a typedef, like Ju
ascull 2015/07/30 17:29:59 Despite my dislike of hiding the type, done.
Jim Stichnoth 2015/07/30 17:40:44 I share this dislike, but I find it less displeasi
+
+ ICE_CACHELINE_BOUNDARY;
// Managed by getErrorStatus()
GlobalLockType ErrorStatusLock;
ErrorCode ErrorStatus;

Powered by Google App Engine
This is Rietveld 408576698