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

Side by Side 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 unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- 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 /// \file 10 /// \file
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 void _xor(Variable *Dest, Variable *Src0, Variable *Src1) { 573 void _xor(Variable *Dest, Variable *Src0, Variable *Src1) {
574 Context.insert<InstMIPS32Xor>(Dest, Src0, Src1); 574 Context.insert<InstMIPS32Xor>(Dest, Src0, Src1);
575 } 575 }
576 576
577 void _xori(Variable *Dest, Variable *Src, uint32_t Imm) { 577 void _xori(Variable *Dest, Variable *Src, uint32_t Imm) {
578 Context.insert<InstMIPS32Xori>(Dest, Src, Imm); 578 Context.insert<InstMIPS32Xori>(Dest, Src, Imm);
579 } 579 }
580 580
581 void lowerArguments() override; 581 void lowerArguments() override;
582 582
583 class Sandboxer {
584 Sandboxer() = delete;
585 Sandboxer(const Sandboxer &) = delete;
586 Sandboxer &operator=(const Sandboxer &) = delete;
587
588 public:
589 explicit Sandboxer(
590 TargetMIPS32 *Target,
591 InstBundleLock::Option BundleOption = InstBundleLock::Opt_None);
592 ~Sandboxer();
593
594 void addiu_sp(uint32_t StackOffset);
595 void lw(Variable *Dest, OperandMIPS32Mem *Mem);
596 void sw(Variable *Dest, OperandMIPS32Mem *Mem);
597 void ret(Variable *RetAddr, Variable *RetValue);
598 void reset_sp(Variable *Src);
599 InstMIPS32Call *jal(Variable *ReturnReg, Operand *CallTarget);
600
601 private:
602 TargetMIPS32 *const Target;
603 const InstBundleLock::Option BundleOption;
604 std::unique_ptr<AutoBundle> Bundler;
605
606 void createAutoBundle();
607 };
608
609 const bool NeedSandboxing;
610
583 /// Make a pass through the SortedSpilledVariables and actually assign stack 611 /// Make a pass through the SortedSpilledVariables and actually assign stack
584 /// slots. SpillAreaPaddingBytes takes into account stack alignment padding. 612 /// slots. SpillAreaPaddingBytes takes into account stack alignment padding.
585 /// The SpillArea starts after that amount of padding. This matches the scheme 613 /// The SpillArea starts after that amount of padding. This matches the scheme
586 /// in getVarStackSlotParams, where there may be a separate multi-block global 614 /// in getVarStackSlotParams, where there may be a separate multi-block global
587 /// var spill area and a local var spill area. 615 /// var spill area and a local var spill area.
588 void assignVarStackSlots(VarList &SortedSpilledVariables, 616 void assignVarStackSlots(VarList &SortedSpilledVariables,
589 size_t SpillAreaPaddingBytes, 617 size_t SpillAreaPaddingBytes,
590 size_t SpillAreaSizeBytes, 618 size_t SpillAreaSizeBytes,
591 size_t GlobalsAndSubsequentPaddingSize); 619 size_t GlobalsAndSubsequentPaddingSize);
592 620
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 uint32_t Flags1 = AFL_FLAGS1_ODDSPREG; 1028 uint32_t Flags1 = AFL_FLAGS1_ODDSPREG;
1001 uint32_t Flags2 = AFL_FLAGS2_NONE; 1029 uint32_t Flags2 = AFL_FLAGS2_NONE;
1002 1030
1003 MipsABIFlagsSection() = default; 1031 MipsABIFlagsSection() = default;
1004 }; 1032 };
1005 1033
1006 } // end of namespace MIPS32 1034 } // end of namespace MIPS32
1007 } // end of namespace Ice 1035 } // end of namespace Ice
1008 1036
1009 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 1037 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698