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

Side by Side Diff: src/IceInstX8632.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/IceInst.cpp ('k') | src/IceInstX8632.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/IceInstX8632.h - Low-level x86 instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstX8632.h - Low-level x86 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 InstX8632 and OperandX8632 classes and 10 // This file declares the InstX8632 and OperandX8632 classes and
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 Cvt, 189 Cvt,
190 Div, 190 Div,
191 Divps, 191 Divps,
192 Divss, 192 Divss,
193 Fld, 193 Fld,
194 Fstp, 194 Fstp,
195 Icmp, 195 Icmp,
196 Idiv, 196 Idiv,
197 Imul, 197 Imul,
198 Insertps, 198 Insertps,
199 Jmp,
199 Label, 200 Label,
200 Lea, 201 Lea,
201 Load, 202 Load,
202 Mfence, 203 Mfence,
203 Mov, 204 Mov,
204 Movd, 205 Movd,
205 Movp, 206 Movp,
206 Movq, 207 Movq,
207 MovssRegs, 208 MovssRegs,
208 Movsx, 209 Movsx,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 private: 394 private:
394 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, 395 InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
395 const InstX8632Label *Label, CondX86::BrCond Condition); 396 const InstX8632Label *Label, CondX86::BrCond Condition);
396 ~InstX8632Br() override {} 397 ~InstX8632Br() override {}
397 CondX86::BrCond Condition; 398 CondX86::BrCond Condition;
398 const CfgNode *TargetTrue; 399 const CfgNode *TargetTrue;
399 const CfgNode *TargetFalse; 400 const CfgNode *TargetFalse;
400 const InstX8632Label *Label; // Intra-block branch target 401 const InstX8632Label *Label; // Intra-block branch target
401 }; 402 };
402 403
404 // Jump to a target outside this function, such as tailcall, nacljump,
405 // naclret, unreachable. This is different from a Branch instruction
406 // in that there is no intra-function control flow to represent.
407 class InstX8632Jmp : public InstX8632 {
408 InstX8632Jmp(const InstX8632Jmp &) = delete;
409 InstX8632Jmp &operator=(const InstX8632Jmp &) = delete;
410
411 public:
412 static InstX8632Jmp *create(Cfg *Func, Operand *Target) {
413 return new (Func->allocate<InstX8632Jmp>()) InstX8632Jmp(Func, Target);
414 }
415 Operand *getJmpTarget() const { return getSrc(0); }
416 void emit(const Cfg *Func) const override;
417 void emitIAS(const Cfg *Func) const override;
418 void dump(const Cfg *Func) const override;
419 static bool classof(const Inst *Inst) { return isClassof(Inst, Jmp); }
420
421 private:
422 InstX8632Jmp(Cfg *Func, Operand *Target);
423 };
424
403 // AdjustStack instruction - subtracts esp by the given amount and 425 // AdjustStack instruction - subtracts esp by the given amount and
404 // updates the stack offset during code emission. 426 // updates the stack offset during code emission.
405 class InstX8632AdjustStack : public InstX8632 { 427 class InstX8632AdjustStack : public InstX8632 {
406 InstX8632AdjustStack(const InstX8632AdjustStack &) = delete; 428 InstX8632AdjustStack(const InstX8632AdjustStack &) = delete;
407 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) = delete; 429 InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) = delete;
408 430
409 public: 431 public:
410 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) { 432 static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) {
411 return new (Func->allocate<InstX8632AdjustStack>()) 433 return new (Func->allocate<InstX8632AdjustStack>())
412 InstX8632AdjustStack(Func, Amount, Esp); 434 InstX8632AdjustStack(Func, Amount, Esp);
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const; 1604 template <> void InstX8632Pinsr::emitIAS(const Cfg *Func) const;
1583 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const; 1605 template <> void InstX8632Movsx::emitIAS(const Cfg *Func) const;
1584 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const; 1606 template <> void InstX8632Movzx::emitIAS(const Cfg *Func) const;
1585 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const; 1607 template <> void InstX8632Pmull::emitIAS(const Cfg *Func) const;
1586 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const; 1608 template <> void InstX8632Pshufd::emitIAS(const Cfg *Func) const;
1587 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const; 1609 template <> void InstX8632Shufps::emitIAS(const Cfg *Func) const;
1588 1610
1589 } // end of namespace Ice 1611 } // end of namespace Ice
1590 1612
1591 #endif // SUBZERO_SRC_ICEINSTX8632_H 1613 #endif // SUBZERO_SRC_ICEINSTX8632_H
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698