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

Unified Diff: src/IceTargetLoweringMIPS32.h

Issue 2482123002: Subzero, MIPS32: Sandbox initial patch (Closed)
Patch Set: Created 4 years, 1 month 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/IceTargetLoweringMIPS32.h
diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h
index e7cc5a322a85cf43210141b892306e23c55b073a..2c8c96b657dadf1aaf678cc8bfdf829ab977efa1 100644
--- a/src/IceTargetLoweringMIPS32.h
+++ b/src/IceTargetLoweringMIPS32.h
@@ -580,6 +580,34 @@ public:
void lowerArguments() override;
+ class Sandboxer {
+ Sandboxer() = delete;
+ Sandboxer(const Sandboxer &) = delete;
+ Sandboxer &operator=(const Sandboxer &) = delete;
+
+ public:
+ explicit Sandboxer(
+ TargetMIPS32 *Target,
+ InstBundleLock::Option BundleOption = InstBundleLock::Opt_None);
+ ~Sandboxer();
+
+ void addiu_sp(uint32_t StackOffset);
+ void lw(Variable *Dest, OperandMIPS32Mem *Mem);
+ void sw(Variable *Dest, OperandMIPS32Mem *Mem);
+ void ret(Variable *RetAddr, Variable *RetValue);
+ void reset_sp(Variable *Src);
+ InstMIPS32Call *jal(Variable *ReturnReg, Operand *CallTarget);
+
+ private:
+ TargetMIPS32 *const Target;
+ const InstBundleLock::Option BundleOption;
+ std::unique_ptr<AutoBundle> Bundler;
+
+ void createAutoBundle();
+ };
+
+ const bool NeedSandboxing;
+
/// Make a pass through the SortedSpilledVariables and actually assign stack
/// slots. SpillAreaPaddingBytes takes into account stack alignment padding.
/// The SpillArea starts after that amount of padding. This matches the scheme

Powered by Google App Engine
This is Rietveld 408576698