- live browsing of Self object memory -

lobby traitsint32

CopyDowns: vector

CreatorPath: traits int32

Module: int32and64

parent* = traits int32or64
sizeInBytes = ( os bytesPerInt32)
zero = ( int32)

32 bit primitives

add:With: = ( _Int32: i1 asInt32 Add: i2 asInt32)
and:With: = ( _Int32: i1 asInt32 And: i2 asInt32)
cmp:With: = ( _Int32: i1 asInt32 Cmp: i2 asInt32)
div:With:IfFail: = ( _Int32: i1 asInt32 Div: i2 asInt32 IfFail: eb)
fromFloat: = ( _Int32FromFloat: f asFloat)
fromInt64: = ( _Int32FromInt64: i asInt64)
mul:With: = ( _Int32: i1 asInt32 Mul: i2 asInt32)
or:With: = ( _Int32: i1 asInt32 Or: i2 asInt32)
rem:With:IfFail: = ( _Int32: i1 asInt32 Rem: i2 asInt32 IfFail: eb)
shl:With: = ( _Int32: i1 asInt32 Shl: i2 asInt32)
shr:With: = ( _Int32: i1 asInt32 Shr: i2 asInt32)
sub:With: = ( _Int32: i1 asInt32 Sub: i2 asInt32)
ushr:With: = ( _Int32: i1 asInt32 Ushr: i2 asInt32)
xor:With: = ( _Int32: i1 asInt32 Xor: i2 asInt32)

deprecated

add:And: = ( _Int32: i1 asInt32 Add: i2 asInt32)
and:And: = ( _Int32: i1 asInt32 And: i2 asInt32)
cmp:And: = ( _Int32: i1 asInt32 Cmp: i2 asInt32)
div:And:IfFail: = ( _Int32: i1 asInt32 Div: i2 asInt32 IfFail: eb)
mul:And: = ( _Int32: i1 asInt32 Mul: i2 asInt32)
or:And: = ( _Int32: i1 asInt32 Or: i2 asInt32)
rem:And:IfFail: = ( _Int32: i1 asInt32 Rem: i2 asInt32 IfFail: eb)
shl:And: = ( _Int32: i1 asInt32 Shl: i2 asInt32)
shr:And: = ( _Int32: i1 asInt32 Shr: i2 asInt32)
sub:And: = ( _Int32: i1 asInt32 Sub: i2 asInt32)
ushr:And: = ( _Int32: i1 asInt32 Ushr: i2 asInt32)
xor:And: = ( _Int32: i1 asInt32 Xor: i2 asInt32)

Java runtime

arithmetic

java_inst_iadd: = ( add: self With: i)
java_inst_idiv: = ( java_inst_helper_div: self And: i)
java_inst_imul: = ( mul: self With: i)
java_inst_irem: = ( java_inst_helper_rem: self And: i)
java_inst_isub: = ( sub: self With: i)

boolean operations

java_inst_iand: = ( and: self With: i)
java_inst_ior: = ( or: self With: i)
java_inst_ixor: = ( xor: self With: i)

comparisons

java_inst_if_icmpeq: = ( 0 = (cmp: self With: i))
java_inst_if_icmpge: = ( 1 = (cmp: self With: i))
java_inst_if_icmpgt: = ( -1 != (cmp: self With: i))
java_inst_if_icmple: = ( 1 != (cmp: self With: i))
java_inst_if_icmplt: = ( -1 = (cmp: self With: i))
java_inst_if_icmpne: = ( 0 != (cmp: self With: i))

shifts

java_inst_ishl: = ( shl: self With: i)
java_inst_ishr: = ( shr: self With: i)
java_inst_iushr: = ( ushr: self With: i)

coercions

asBigEndianByteVectorFrom: =
( | r |
    [endianDependentServer].
    r: byteVector copySize: 4.
    intOrInt32 storeAsBigEndianByteVectorInto: r At: 0 IfFail: raiseError.
    r)
asFloat = ( _FloatFromInt32)
asInt16 = ( _Int16FromInt32: self)
asInt32 = ( self)
asInt64 = ( int64 fromInt32: self)
asInt8 = ( _Int8FromInt32: self)
asLittleEndianByteVectorFrom: =
( | r |
    r: byteVector copySize: 4.
    intOrInt32 storeAsLittleEndianByteVectorInto: r At: 0 IfFail: raiseError.
    r)
storeAsBigEndianByteVectorInto:At:IfFail: =
( 
    [endianDependentServer].
    aByteVector at: index + 0 Put: (ushr: self With: 24)                IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 1 Put: (and: 255 With: ushr: self With: 16) IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 2 Put: (and: 255 With: ushr: self With: 8)  IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 3 Put: (and: 255 With: self)                IfAbsent: [|:e| ^ fb value: e].
    self)
storeAsLittleEndianByteVectorInto:At:IfFail: =
( 
    [endianDependentServer].
    aByteVector at: index + 3 Put: (ushr: self With: 24)                IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 2 Put: (and: 255 With: ushr: self With: 16) IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 1 Put: (and: 255 With: ushr: self With:  8) IfAbsent: [|:e| ^ fb value: e].
    aByteVector at: index + 0 Put: (and: 255 With: self)                IfAbsent: [|:e| ^ fb value: e].
    self)

iterating

bigEndianBytesFrom:Do: =
( 
    [endianDependentServer].
    blk value: (                ushr: i With: 24 ) With: 0.
    blk value: ( and: 255 With: ushr: i With: 16 ) With: 1.
    blk value: ( and: 255 With: ushr: i With:  8 ) With: 2.
    blk value: ( and: 255 With:       i          ) With: 3.
    self)
littleEndianBytesFrom:Do: =
( 
    [endianDependentServer].
    blk value: ( and: 255 With:       i          ) With: 0.
    blk value: ( and: 255 With: ushr: i With:  8 ) With: 1.
    blk value: ( and: 255 With: ushr: i With: 16 ) With: 2.
    blk value: (                ushr: i With: 24 ) With: 3.
    self)

store string

fromHigh16Bits:Low16Bits: =
( 
    or:  (shl: high16Bits With: 16)
    With: low16Bits)
storeStringFor:IfFail: =
( | high16Bits. low16Bits |
    high16Bits: '16r', (ushr: a With: 16) hexPrintString.
    low16Bits:  '16r', (and:  a With: 16rffff) hexPrintString.
    'int32 fromHigh16Bits: ', high16Bits, ' Low16Bits: ', low16Bits)
faster than parent's