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

Unified Diff: src/IceCfg.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/IceCfg.h
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 08b4e979c2c07d993a56b38a2f3163627b45c1e1..b4b2476af601b9c913a4a48632a90b916d299d24 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -24,6 +24,8 @@
namespace Ice {
+class InstJumpTable;
Jim Stichnoth 2015/07/30 15:20:23 There are already a bunch of forward class declara
ascull 2015/07/30 17:29:59 Done.
Jim Stichnoth 2015/07/30 19:21:23 But remove it here?
ascull 2015/07/30 20:39:38 Done.
+
class Cfg {
Cfg() = delete;
Cfg(const Cfg &) = delete;
@@ -140,6 +142,13 @@ public:
const VarList &getImplicitArgs() const { return ImplicitArgs; }
/// @}
+ /// \name Manage the jump tables.
+ /// @{
+ void addJumpTable(InstJumpTable *JumpTable) {
+ JumpTables.emplace_back(JumpTable);
+ }
+ /// @}
+
/// \name Miscellaneous accessors.
/// @{
TargetLowering *getTarget() const { return Target.get(); }
@@ -183,6 +192,7 @@ public:
bool validateLiveness() const;
void contractEmptyNodes();
void doBranchOpt();
+ void markNodesForSandboxing();
/// \name Manage the CurrentNode field.
/// CurrentNode is used for validating the Variable::DefNode field during
@@ -229,6 +239,12 @@ private:
/// code needs to be defined.
void profileBlocks();
+ /// Delete registered jump table placeholder instructions. This should only be
+ /// called once all repointing has taken place.
+ void deleteJumpTableInsts();
+ /// Iterate through the registered jump tables and emit them.
+ void emitJumpTables();
+
GlobalContext *Ctx;
uint32_t SequenceNumber; /// output order for emission
VerboseMask VMask;
@@ -252,6 +268,7 @@ private:
std::unique_ptr<Assembler> TargetAssembler;
/// Globals required by this CFG. Mostly used for the profiler's globals.
std::unique_ptr<VariableDeclarationList> GlobalInits;
+ std::vector<InstJumpTable *> JumpTables;
/// CurrentNode is maintained during dumping/emitting just for
/// validating Variable::DefNode. Normally, a traversal over

Powered by Google App Engine
This is Rietveld 408576698