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

Side by Side Diff: src/assembler_ia32.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 bundle alignment to the instruction emission loop 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
« src/IceCfgNode.cpp ('K') | « src/assembler.h ('k') | no next file » | 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/assembler_ia32.h - Assembler for x86-32 ------*- C++ -*-===// 1 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ------*- C++ -*-===//
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 // 5 //
6 // Modified by the Subzero authors. 6 // Modified by the Subzero authors.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // The Subzero Code Generator 10 // The Subzero Code Generator
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 void alignFunction() override; 348 void alignFunction() override;
349 349
350 SizeT getBundleAlignLog2Bytes() const override { return 5; } 350 SizeT getBundleAlignLog2Bytes() const override { return 5; }
351 351
352 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override { 352 llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override {
353 static const uint8_t Padding[] = {0xF4}; 353 static const uint8_t Padding[] = {0xF4};
354 return llvm::ArrayRef<uint8_t>(Padding, 1); 354 return llvm::ArrayRef<uint8_t>(Padding, 1);
355 } 355 }
356 356
357 void padWithNop(intptr_t Padding) override {
358 while (Padding > MAX_NOP_SIZE) {
359 nop(MAX_NOP_SIZE);
360 Padding -= MAX_NOP_SIZE;
361 }
362 if (Padding)
363 nop(Padding);
364 }
365
357 Label *GetOrCreateCfgNodeLabel(SizeT NodeNumber); 366 Label *GetOrCreateCfgNodeLabel(SizeT NodeNumber);
358 void BindCfgNodeLabel(SizeT NodeNumber) override; 367 void BindCfgNodeLabel(SizeT NodeNumber) override;
359 Label *GetOrCreateLocalLabel(SizeT Number); 368 Label *GetOrCreateLocalLabel(SizeT Number);
360 void BindLocalLabel(SizeT Number); 369 void BindLocalLabel(SizeT Number);
361 370
362 bool fixupIsPCRel(FixupKind Kind) const override { 371 bool fixupIsPCRel(FixupKind Kind) const override {
363 // Currently assuming this is the only PC-rel relocation type used. 372 // Currently assuming this is the only PC-rel relocation type used.
364 return Kind == llvm::ELF::R_386_PC32; 373 return Kind == llvm::ELF::R_386_PC32;
365 } 374 }
366 375
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { 875 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) {
867 buffer_.EmitFixup(fixup); 876 buffer_.EmitFixup(fixup);
868 } 877 }
869 878
870 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } 879 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); }
871 880
872 } // end of namespace x86 881 } // end of namespace x86
873 } // end of namespace Ice 882 } // end of namespace Ice
874 883
875 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ 884 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_
OLDNEW
« src/IceCfgNode.cpp ('K') | « src/assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698