bits.hpp File Reference

Go to the source code of this file.

Defines

#define AllBits   ~0
#define NoBits   0
#define OneBit   1
#define addBits(x, m)   ((x) | (m))
#define setBits(x, m)   ((x) |= (m))
#define subBits(x, m)   ((x) & ~(m))
#define clearBits(x, m)   ((x) &= ~(m))
#define maskBits(x, m)   ((x) & (m))
#define anySet(x, m)   (maskBits((x), (m)) != NoBits)
#define nthBit(n)   (OneBit << (n))
#define addNth(x, n)   addBits((x), nthBit(n))
#define setNth(x, n)   setBits((x), nthBit(n))
#define clearNth(x, n)   clearBits((x), nthBit(n))
#define subNth(x, n)   subBits((x), nthBit(n))
#define isSet(x, n)   anySet((x), nthBit(n))
#define nthMask(n)   (n == 32 ? AllBits : (nthBit(n) - OneBit))
#define lowerBits(x, n)   maskBits((x), nthMask(n))
#define roundMask(x, m)   (((x) + (m)) & ~(m))
#define roundBits(x, n)   roundMask((x), nthMask(n))
#define roundTo(x, v)   roundMask((x), (v) - OneBit)

Functions

int arithmetic_shift_right (int value, int shift)
int logic_shift_right (int value, int shift)
int get_unsigned_bitfield (int value, int start_bit_no, int field_length)
int get_signed_bitfield (int value, int start_bit_no, int field_length)
int set_unsigned_bitfield (int value, int start_bit_no, int field_length, unsigned int new_field_value)


Define Documentation

#define addBits ( x,
 )     ((x) | (m))

Definition at line 28 of file bits.hpp.

Referenced by get_signed_bitfield(), and set_unsigned_bitfield().

#define addNth ( x,
 )     addBits((x), nthBit(n))

Definition at line 35 of file bits.hpp.

#define AllBits   ~0

Definition at line 24 of file bits.hpp.

Referenced by rSet::clear().

#define anySet ( x,
 )     (maskBits((x), (m)) != NoBits)

Definition at line 33 of file bits.hpp.

#define clearBits ( x,
 )     ((x) &= ~(m))

Definition at line 31 of file bits.hpp.

Referenced by oldSpace::object_start().

#define clearNth ( x,
 )     clearBits((x), nthBit(n))

Definition at line 37 of file bits.hpp.

#define isSet ( x,
 )     anySet((x), nthBit(n))

Definition at line 39 of file bits.hpp.

Referenced by methodOopDesc::allocatesInterpretedContext(), primitive_desc::can_be_constant_folded(), primitive_desc::can_fail(), primitive_desc::can_perform_NLR(), primitive_desc::can_scavenge(), methodOopDesc::containsNLR(), get_signed_bitfield(), primitive_desc::has_receiver(), IfNode::IfNode(), methodOopDesc::is_customized(), primitive_desc::is_internal(), methodOopDesc::mustBeCustomizedToClass(), and primitive_desc::needs_delta_fp_code().

#define lowerBits ( x,
 )     maskBits((x), nthMask(n))

Definition at line 41 of file bits.hpp.

Referenced by get_unsigned_bitfield().

#define maskBits ( x,
 )     ((x) & (m))

Definition at line 32 of file bits.hpp.

Referenced by markOopDesc::age(), copy_oops_down(), markOopDesc::has_sentinel(), markOopDesc::has_tagged_contents(), markOopDesc::hash(), markOopDesc::is_near_death(), set_unsigned_bitfield(), and oopDesc::tag().

#define NoBits   0

Definition at line 25 of file bits.hpp.

#define nthBit (  )     (OneBit << (n))

Definition at line 34 of file bits.hpp.

#define nthMask (  )     (n == 32 ? AllBits : (nthBit(n) - OneBit))

Definition at line 40 of file bits.hpp.

Referenced by get_signed_bitfield(), oldSpace::object_start(), and set_unsigned_bitfield().

#define OneBit   1

Definition at line 26 of file bits.hpp.

#define roundBits ( x,
 )     roundMask((x), nthMask(n))

Definition at line 44 of file bits.hpp.

#define roundMask ( x,
 )     (((x) + (m)) & ~(m))

Definition at line 43 of file bits.hpp.

#define roundTo ( x,
 )     roundMask((x), (v) - OneBit)

Definition at line 45 of file bits.hpp.

Referenced by ResourceArea::allocate_bytes(), doubleValueArrayKlass::allocateObjectSize(), doubleByteArrayKlass::allocateObjectSize(), byteArrayKlass::allocateObjectSize(), doubleByteArrayOopDesc::compare(), byteArrayOopDesc::compare(), doubleValueArrayKlass::object_size(), doubleByteArrayKlass::object_size(), byteArrayKlass::object_size(), PRIM_DECL_2(), and scale_and_adjust().

#define setBits ( x,
 )     ((x) |= (m))

Definition at line 29 of file bits.hpp.

#define setNth ( x,
 )     setBits((x), nthBit(n))

Definition at line 36 of file bits.hpp.

#define subBits ( x,
 )     ((x) & ~(m))

Definition at line 30 of file bits.hpp.

Referenced by set_unsigned_bitfield().

#define subNth ( x,
 )     subBits((x), nthBit(n))

Definition at line 38 of file bits.hpp.


Function Documentation

int arithmetic_shift_right ( int  value,
int  shift 
) [inline]

Definition at line 47 of file bits.hpp.

int get_signed_bitfield ( int  value,
int  start_bit_no,
int  field_length 
) [inline]

Definition at line 55 of file bits.hpp.

References addBits, get_unsigned_bitfield(), isSet, and nthMask.

Here is the call graph for this function:

int get_unsigned_bitfield ( int  value,
int  start_bit_no,
int  field_length 
) [inline]

Definition at line 51 of file bits.hpp.

References lowerBits.

Referenced by methodOopDesc::flags(), Interpreter::get_invocation_counter_limit(), get_signed_bitfield(), primitive_desc::group(), handleCallBack(), methodOopDesc::invocation_count(), InliningDatabase::mangle_name(), methodOopDesc::nofArgs(), primitive_desc::number_of_parameters(), methodOopDesc::sharing_count(), and methodOopDesc::size_of_codes().

int logic_shift_right ( int  value,
int  shift 
) [inline]

Definition at line 48 of file bits.hpp.

int set_unsigned_bitfield ( int  value,
int  start_bit_no,
int  field_length,
unsigned int  new_field_value 
) [inline]

Definition at line 62 of file bits.hpp.

References addBits, assert, maskBits, nthMask, and subBits.


Generated on Mon Oct 9 13:37:51 2006 for Strongtalk VM by  doxygen 1.4.7