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

Side by Side Diff: src/IceInst.cpp

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/IceInst.h ('k') | src/IceInstX8632.h » ('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.cpp - High-level instruction implementation ----===// 1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===//
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 implements the Inst class, primarily the various 10 // This file implements the Inst class, primarily the various
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 Labels[I] = NewNode; 429 Labels[I] = NewNode;
430 return true; 430 return true;
431 } 431 }
432 } 432 }
433 return false; 433 return false;
434 } 434 }
435 435
436 InstUnreachable::InstUnreachable(Cfg *Func) 436 InstUnreachable::InstUnreachable(Cfg *Func)
437 : InstHighLevel(Func, Inst::Unreachable, 0, nullptr) {} 437 : InstHighLevel(Func, Inst::Unreachable, 0, nullptr) {}
438 438
439 InstBundleLock::InstBundleLock(Cfg *Func, InstBundleLock::Option BundleOption)
440 : InstHighLevel(Func, Inst::BundleLock, 0, nullptr),
441 BundleOption(BundleOption) {}
442
443 InstBundleUnlock::InstBundleUnlock(Cfg *Func)
444 : InstHighLevel(Func, Inst::BundleUnlock, 0, nullptr) {}
445
439 InstFakeDef::InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src) 446 InstFakeDef::InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src)
440 : InstHighLevel(Func, Inst::FakeDef, Src ? 1 : 0, Dest) { 447 : InstHighLevel(Func, Inst::FakeDef, Src ? 1 : 0, Dest) {
441 assert(Dest); 448 assert(Dest);
442 if (Src) 449 if (Src)
443 addSource(Src); 450 addSource(Src);
444 } 451 }
445 452
446 InstFakeUse::InstFakeUse(Cfg *Func, Variable *Src) 453 InstFakeUse::InstFakeUse(Cfg *Func, Variable *Src)
447 : InstHighLevel(Func, Inst::FakeUse, 1, nullptr) { 454 : InstHighLevel(Func, Inst::FakeUse, 1, nullptr) {
448 assert(Src); 455 assert(Src);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 FalseOp->dump(Func); 774 FalseOp->dump(Func);
768 } 775 }
769 776
770 void InstUnreachable::dump(const Cfg *Func) const { 777 void InstUnreachable::dump(const Cfg *Func) const {
771 if (!ALLOW_DUMP) 778 if (!ALLOW_DUMP)
772 return; 779 return;
773 Ostream &Str = Func->getContext()->getStrDump(); 780 Ostream &Str = Func->getContext()->getStrDump();
774 Str << "unreachable"; 781 Str << "unreachable";
775 } 782 }
776 783
784 void InstBundleLock::emit(const Cfg *Func) const {
785 if (!ALLOW_DUMP)
786 return;
787 Ostream &Str = Func->getContext()->getStrEmit();
788 Str << "\t.bundle_lock";
789 switch (BundleOption) {
790 case Opt_None:
791 break;
792 case Opt_AlignToEnd:
793 Str << "\talign_to_end";
794 break;
795 }
796 }
797
798 void InstBundleLock::dump(const Cfg *Func) const {
799 if (!ALLOW_DUMP)
800 return;
801 Ostream &Str = Func->getContext()->getStrDump();
802 Str << "bundle_lock";
803 switch (BundleOption) {
804 case Opt_None:
805 break;
806 case Opt_AlignToEnd:
807 Str << " align_to_end";
808 break;
809 }
810 }
811
812 void InstBundleUnlock::emit(const Cfg *Func) const {
813 if (!ALLOW_DUMP)
814 return;
815 Ostream &Str = Func->getContext()->getStrEmit();
816 Str << "\t.bundle_unlock";
817 }
818
819 void InstBundleUnlock::dump(const Cfg *Func) const {
820 if (!ALLOW_DUMP)
821 return;
822 Ostream &Str = Func->getContext()->getStrDump();
823 Str << "bundle_unlock";
824 }
825
777 void InstFakeDef::emit(const Cfg *Func) const { 826 void InstFakeDef::emit(const Cfg *Func) const {
778 if (!ALLOW_DUMP) 827 if (!ALLOW_DUMP)
779 return; 828 return;
780 // Go ahead and "emit" these for now, since they are relatively 829 // Go ahead and "emit" these for now, since they are relatively
781 // rare. 830 // rare.
782 Ostream &Str = Func->getContext()->getStrEmit(); 831 Ostream &Str = Func->getContext()->getStrEmit();
783 Str << "\t# "; 832 Str << "\t# ";
784 getDest()->emit(Func); 833 getDest()->emit(Func);
785 Str << " = def.pseudo "; 834 Str << " = def.pseudo ";
786 emitSources(Func); 835 emitSources(Func);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 867
819 void InstTarget::dump(const Cfg *Func) const { 868 void InstTarget::dump(const Cfg *Func) const {
820 if (!ALLOW_DUMP) 869 if (!ALLOW_DUMP)
821 return; 870 return;
822 Ostream &Str = Func->getContext()->getStrDump(); 871 Ostream &Str = Func->getContext()->getStrDump();
823 Str << "[TARGET] "; 872 Str << "[TARGET] ";
824 Inst::dump(Func); 873 Inst::dump(Func);
825 } 874 }
826 875
827 } // end of namespace Ice 876 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698