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/IceInst.h

Issue 930733002: Subzero: Add sandboxing for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a sandboxing test. Rebase. 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 unified diff | Download patch
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInst.h - High-level instructions ----------*- C++ -*-===// 1 //===- subzero/src/IceInst.h - High-level instructions ----------*- 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 // This file declares the Inst class and its target-independent 10 // This file declares the Inst class and its target-independent
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 Fcmp, 52 Fcmp,
53 Icmp, 53 Icmp,
54 IntrinsicCall, 54 IntrinsicCall,
55 InsertElement, 55 InsertElement,
56 Load, 56 Load,
57 Phi, 57 Phi,
58 Ret, 58 Ret,
59 Select, 59 Select,
60 Store, 60 Store,
61 Switch, 61 Switch,
62 FakeDef, // not part of LLVM/PNaCl bitcode 62 BundleLock, // not part of LLVM/PNaCl bitcode
63 FakeUse, // not part of LLVM/PNaCl bitcode 63 BundleUnlock, // not part of LLVM/PNaCl bitcode
64 FakeKill, // not part of LLVM/PNaCl bitcode 64 FakeDef, // not part of LLVM/PNaCl bitcode
65 Target // target-specific low-level ICE 65 FakeUse, // not part of LLVM/PNaCl bitcode
66 // Anything >= Target is an InstTarget subclass. 66 FakeKill, // not part of LLVM/PNaCl bitcode
67 Target // target-specific low-level ICE
68 // Anything >= Target is an InstTarget subclass.
67 }; 69 };
68 InstKind getKind() const { return Kind; } 70 InstKind getKind() const { return Kind; }
69 71
70 InstNumberT getNumber() const { return Number; } 72 InstNumberT getNumber() const { return Number; }
71 void renumber(Cfg *Func); 73 void renumber(Cfg *Func);
72 enum { 74 enum {
73 NumberDeleted = -1, 75 NumberDeleted = -1,
74 NumberSentinel = 0, 76 NumberSentinel = 0,
75 NumberInitial = 2, 77 NumberInitial = 2,
76 NumberExtended = NumberInitial - 1 78 NumberExtended = NumberInitial - 1
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 void dump(const Cfg *Func) const override; 738 void dump(const Cfg *Func) const override;
737 static bool classof(const Inst *Inst) { 739 static bool classof(const Inst *Inst) {
738 return Inst->getKind() == Unreachable; 740 return Inst->getKind() == Unreachable;
739 } 741 }
740 742
741 private: 743 private:
742 InstUnreachable(Cfg *Func); 744 InstUnreachable(Cfg *Func);
743 ~InstUnreachable() override {} 745 ~InstUnreachable() override {}
744 }; 746 };
745 747
748 // BundleLock instruction. There are no operands. Contains an option
749 // indicating whether align_to_end is specified.
750 class InstBundleLock : public InstHighLevel {
751 InstBundleLock(const InstBundleLock &) = delete;
752 InstBundleLock &operator=(const InstBundleLock &) = delete;
753
754 public:
755 enum Option { Opt_None, Opt_AlignToEnd };
756 static InstBundleLock *create(Cfg *Func, Option BundleOption) {
757 return new (Func->allocate<InstBundleLock>())
758 InstBundleLock(Func, BundleOption);
759 }
760 void emit(const Cfg *Func) const override;
761 void emitIAS(const Cfg * /* Func */) const override {}
762 void dump(const Cfg *Func) const override;
763 Option getOption() const { return BundleOption; }
764 static bool classof(const Inst *Inst) {
765 return Inst->getKind() == BundleLock;
766 }
767
768 private:
769 Option BundleOption;
770 InstBundleLock(Cfg *Func, Option BundleOption);
771 ~InstBundleLock() override {}
772 };
773
774 // BundleUnlock instruction. There are no operands.
775 class InstBundleUnlock : public InstHighLevel {
776 InstBundleUnlock(const InstBundleUnlock &) = delete;
777 InstBundleUnlock &operator=(const InstBundleUnlock &) = delete;
778
779 public:
780 static InstBundleUnlock *create(Cfg *Func) {
781 return new (Func->allocate<InstBundleUnlock>()) InstBundleUnlock(Func);
782 }
783 void emit(const Cfg *Func) const override;
784 void emitIAS(const Cfg * /* Func */) const override {}
785 void dump(const Cfg *Func) const override;
786 static bool classof(const Inst *Inst) {
787 return Inst->getKind() == BundleUnlock;
788 }
789
790 private:
791 explicit InstBundleUnlock(Cfg *Func);
792 ~InstBundleUnlock() override {}
793 };
794
746 // FakeDef instruction. This creates a fake definition of a variable, 795 // FakeDef instruction. This creates a fake definition of a variable,
747 // which is how we represent the case when an instruction produces 796 // which is how we represent the case when an instruction produces
748 // multiple results. This doesn't happen with high-level ICE 797 // multiple results. This doesn't happen with high-level ICE
749 // instructions, but might with lowered instructions. For example, 798 // instructions, but might with lowered instructions. For example,
750 // this would be a way to represent condition flags being modified by 799 // this would be a way to represent condition flags being modified by
751 // an instruction. 800 // an instruction.
752 // 801 //
753 // It's generally useful to set the optional source operand to be the 802 // It's generally useful to set the optional source operand to be the
754 // dest variable of the instruction that actually produces the FakeDef 803 // dest variable of the instruction that actually produces the FakeDef
755 // dest. Otherwise, the original instruction could be dead-code 804 // dest. Otherwise, the original instruction could be dead-code
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 static void noteHead(Ice::Inst *, Ice::Inst *) {} 914 static void noteHead(Ice::Inst *, Ice::Inst *) {}
866 void deleteNode(Ice::Inst *) {} 915 void deleteNode(Ice::Inst *) {}
867 916
868 private: 917 private:
869 mutable ilist_half_node<Ice::Inst> Sentinel; 918 mutable ilist_half_node<Ice::Inst> Sentinel;
870 }; 919 };
871 920
872 } // end of namespace llvm 921 } // end of namespace llvm
873 922
874 #endif // SUBZERO_SRC_ICEINST_H 923 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698