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

Unified Diff: src/trusted/validator_ragel/unreviewed/validator_internal.h

Issue 12226019: Move bitmap manipulation functions in bitmap.h (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/unreviewed/validator_internal.h
===================================================================
--- src/trusted/validator_ragel/unreviewed/validator_internal.h (revision 10718)
+++ src/trusted/validator_ragel/unreviewed/validator_internal.h (working copy)
@@ -248,60 +248,6 @@
#define SET_IMM2_TYPE_IMM16 \
(instruction_info_collected += SECOND_IMMEDIATE_16BIT)
-#define BITMAP_WORD_NAME BITMAP_WORD_NAME1(NACL_HOST_WORDSIZE)
-#define BITMAP_WORD_NAME1(size) BITMAP_WORD_NAME2(size)
-#define BITMAP_WORD_NAME2(size) uint##size##_t
-
-typedef BITMAP_WORD_NAME bitmap_word;
-
-static INLINE bitmap_word *BitmapAllocate(size_t indexes) {
- bitmap_word *bitmap;
- size_t byte_count = ((indexes + NACL_HOST_WORDSIZE - 1) / NACL_HOST_WORDSIZE)*
- sizeof *bitmap;
- bitmap = malloc(byte_count);
- if (bitmap != NULL) {
- memset(bitmap, 0, byte_count);
- }
- return bitmap;
-}
-
-static FORCEINLINE int BitmapIsBitSet(bitmap_word *bitmap, size_t index) {
- return (bitmap[index / NACL_HOST_WORDSIZE] &
- (((bitmap_word)1) << (index % NACL_HOST_WORDSIZE))) != 0;
-}
-
-static FORCEINLINE void BitmapSetBit(bitmap_word *bitmap, size_t index) {
- bitmap[index / NACL_HOST_WORDSIZE] |=
- ((bitmap_word)1) << (index % NACL_HOST_WORDSIZE);
-}
-
-static FORCEINLINE void BitmapClearBit(bitmap_word *bitmap, size_t index) {
- bitmap[index / NACL_HOST_WORDSIZE] &=
- ~(((bitmap_word)1) << (index % NACL_HOST_WORDSIZE));
-}
-
-/* All the bits must be in a single 32-bit bundle. */
-static FORCEINLINE int BitmapIsAnyBitSet(bitmap_word *bitmap,
- size_t index, size_t bits) {
- return (bitmap[index / NACL_HOST_WORDSIZE] &
- (((((bitmap_word)1) << bits) - 1) << (index % NACL_HOST_WORDSIZE))) != 0;
-}
-
-/* All the bits must be in a single 32-bit bundle. */
-static FORCEINLINE void BitmapSetBits(bitmap_word *bitmap,
- size_t index,
- size_t bits) {
- bitmap[index / NACL_HOST_WORDSIZE] |=
- ((((bitmap_word)1) << bits) - 1) << (index % NACL_HOST_WORDSIZE);
-}
-
-/* All the bits must be in a single 32-bit bundle. */
-static FORCEINLINE void BitmapClearBits(bitmap_word *bitmap,
- size_t index, size_t bits) {
- bitmap[index / NACL_HOST_WORDSIZE] &=
- ~(((((bitmap_word)1) << bits) - 1) << (index % NACL_HOST_WORDSIZE));
-}
-
/* Mark the destination of a jump instruction and make an early validity check:
* to jump outside given code region, the target address must be aligned.
*
« no previous file with comments | « src/trusted/validator_ragel/unreviewed/dfa_validate_64.c ('k') | src/trusted/validator_ragel/unreviewed/validator_x86_32.rl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698