org.jikesrvm.compilers.baseline.ia32
Class BaselineMagic

java.lang.Object
  extended by org.jikesrvm.compilers.baseline.ia32.BaselineMagic

final class BaselineMagic
extends Object

Create magic code


Nested Class Summary
private static class BaselineMagic.AddressComparison
          Address comparison
private static class BaselineMagic.AddressComparison_isMax
          Is an address max?
private static class BaselineMagic.AddressComparison_isZero
          Is an address zero?
private static class BaselineMagic.AddressConstant
          Generate an address constant
private static class BaselineMagic.Attempt32
          Compare and swap a 32bit value
private static class BaselineMagic.Attempt32_Offset
          Compare and swap a 32bit value at an address plus offset
private static class BaselineMagic.CreateArray
          Create an array for a runtime table
private static class BaselineMagic.Dsqrt
          Double precision square root
private static class BaselineMagic.DuplicateStackSlot
          Perform an operation to duplicate a stack slot
private static class BaselineMagic.DynamicBridgeTo
          Perform dynamic bridge from linker to compiled code
private static class BaselineMagic.EarlyReferenceCheckDecorator
          Add a reference check to a magic generator
private static class BaselineMagic.FreeStackSlot
          Perform an operation to release a stack slot
private static class BaselineMagic.Fsqrt
          Floating point square root
private static class BaselineMagic.GetFramePointer
          Get frame pointer on entry to method
private static class BaselineMagic.GetInlineDepth
          Return the current inlining depth (always 0 for baseline)
private static class BaselineMagic.GetObjectType
          Get the type from an object
private static class BaselineMagic.GetRegister
          Put a register on to the stack
private static class BaselineMagic.GetReturnAddressLocation
          Create address that holds return address
private static class BaselineMagic.GetTimeBase
          Get a 64bit time base value (not accurate on certain multi-cores)
private static class BaselineMagic.GetValueAtDisplacement
          Load an address from the stack and load the value at it plus a displacement
private static class BaselineMagic.InvokeClassInitializer
          Boot up calling of class initializers
private static class BaselineMagic.InvokeEntryPoint
          Invoke an entry point taking values off of the stack
private static class BaselineMagic.InvokeMethodReturningDouble
          Reflective method dispatch
private static class BaselineMagic.InvokeMethodReturningFloat
          Reflective method dispatch
private static class BaselineMagic.InvokeMethodReturningInt
          Reflective method dispatch
private static class BaselineMagic.InvokeMethodReturningLong
          Reflective method dispatch
private static class BaselineMagic.InvokeMethodReturningObject
          Reflective method dispatch
private static class BaselineMagic.InvokeMethodReturningVoid
          Reflective method dispatch
private static class BaselineMagic.IsConstantParameter
          Is the requested parameter a constant?
private static class BaselineMagic.LateReferenceCheckDecorator
          Add a reference check to a magic generator
private static class BaselineMagic.Load32
          Load a 32bit quantity from an address
private static class BaselineMagic.Load32_Array
          Get a 32bit element from a runtime table
private static class BaselineMagic.Load32_Offset
          Load a 32bit quantity from an address and offset parameter
private static class BaselineMagic.Load64
          Load a 64bit quantity from an address
private static class BaselineMagic.Load64_Array
          Get a 64bit element from a runtime table
private static class BaselineMagic.Load64_Offset
          Load a 32bit quantity from an address plus offset
private static class BaselineMagic.LoadByte
          Load a byte from an address
private static class BaselineMagic.LoadByte_Array
          Get a byte element from a runtime table
private static class BaselineMagic.LoadByte_Offset
          Load a byte from an address and offset parameter
private static class BaselineMagic.LoadChar
          Load a char from an address
private static class BaselineMagic.LoadChar_Offset
          Load a char from an address plus offset
private static class BaselineMagic.LoadShort
          Load a short quantity from an address
private static class BaselineMagic.LoadShort_Offset
          Load a short quantity from an address plus offset
private static class BaselineMagic.LoadUnsignedByte_Offset
          Load an unsigned byte from an address and offset parameter
private static class BaselineMagic.Magic_Attempt32
          Compare and swap a 32bit value in the format used in Magic
private static class BaselineMagic.Magic_Attempt64
          Compare and swap a 64bit value in the format used in Magic
private static class BaselineMagic.Magic_Load32_MD
          Load a 32bit quantity from an address and offset parameter
private static class BaselineMagic.Magic_Store16
          Store a 16 bit quantity to an address plus offset in the format used in Magic
private static class BaselineMagic.Magic_Store16_MD
          Store a 16bit quantity to an address plus offset in the format used in Magic with an additional meta-data argument
private static class BaselineMagic.Magic_Store32
          Store a 32bit quantity to an address plus offset in the format used in Magic
private static class BaselineMagic.Magic_Store32_MD
          Store a 32bit quantity to an address plus offset in the format used in Magic with an additional meta-data argument
private static class BaselineMagic.Magic_Store64
          Store a 64bit quantity to an address plus offset in the format used in Magic
private static class BaselineMagic.Magic_Store64_MD
          Store a 64bit quantity to an address plus offset in the format used in Magic with an additional meta-data argument
private static class BaselineMagic.Magic_Store8
          Store a 8bit quantity to an address plus offset in the format used in Magic
private static class BaselineMagic.Magic_Store8_MD
          Store a 8bit quantity to an address plus offset in the format used in Magic with an additional meta-data argument
private static class BaselineMagic.MagicGenerator
          Parent of all magic generating classes
private static class BaselineMagic.MFence
          Generate the MFENCE instruction.
private static class BaselineMagic.Nop
          Perform no-operation
private static class BaselineMagic.Pause
          Pause hint that thread is contending for a lock
private static class BaselineMagic.Prefetch
          Prefetch from an address
private static class BaselineMagic.QuadSignExtend
          Sign extend 32bit int to 64bits
private static class BaselineMagic.QuadZeroExtend
          Zero high part of 64bits
private static class BaselineMagic.ReturnToNewStack
          Exchange stacks
private static class BaselineMagic.SetRegister
          Set a register to a value from the stack
private static class BaselineMagic.SetValueAtDisplacement
          Store a value to an address from the stack plus a displacement
private static class BaselineMagic.Store16
          Store a 16bit quantity to an address
private static class BaselineMagic.Store16_Offset
          Store a 16bit quantity to an address plus offset
private static class BaselineMagic.Store32
          Store a 32bit quantity to an address
private static class BaselineMagic.Store32_Array
          Store a 32bit element to a runtime table
private static class BaselineMagic.Store32_Offset
          Store a 32bit quantity to an address plus offset
private static class BaselineMagic.Store64
          Store a 64bit quantity to an address
private static class BaselineMagic.Store64_Array
          Store a 64bit element to a runtime table
private static class BaselineMagic.Store64_Offset
          Store a 64bit quantity to an address plus offset
private static class BaselineMagic.Store8
          Store a 8bit quantity to an address plus offset
private static class BaselineMagic.Store8_Array
          Set a 8bit in a runtime table
private static class BaselineMagic.Store8_Offset
          Store a 8bit quantity to an address plus offset
private static class BaselineMagic.WordAnd
          Logical and of words
private static class BaselineMagic.WordLsh
          Logical left shift of words
private static class BaselineMagic.WordMinus
          Subtraction of words
private static class BaselineMagic.WordMinus32
          Special case of 64bit subtraction to 32bit value
private static class BaselineMagic.WordNot
          Logical not of word
private static class BaselineMagic.WordOr
          Logical or of words
private static class BaselineMagic.WordPlus
          Addition of words
private static class BaselineMagic.WordPlus32
          Special case of 64bit addition to 32bit value
private static class BaselineMagic.WordRsha
          Arithmetic right shift of words
private static class BaselineMagic.WordRshl
          Logical right shift of words
private static class BaselineMagic.WordToLong
          Convert word to long
private static class BaselineMagic.WordXor
          Logical xor of words
 
Field Summary
private static MethodReference checkMR
          Reference of method that checks a reference
private static boolean FAIL_ON_BAD_REFERENCES
          If a bad reference is encountered should we halt the VM?
private static ImmutableEntryHashMapRVM<MethodReference,BaselineMagic.MagicGenerator> generators
          Map of method references to objects that will generate the necessary magic
private static boolean inCheck
          Flag to avoid recursive calls to check
private static boolean VALIDATE_OBJECT_REFERENCES
          When casting or loading object references should the reference be checked to see if it is an object reference first?
 
Constructor Summary
BaselineMagic()
           
 
Method Summary
private static void check(ObjectReference value)
          Method called to check an object reference is valid
(package private) static boolean generateMagic(ArchitectureSpecific.Assembler asm, MethodReference m, RVMMethod cm, Offset sd)
          Entry point to generating magic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generators

private static final ImmutableEntryHashMapRVM<MethodReference,BaselineMagic.MagicGenerator> generators
Map of method references to objects that will generate the necessary magic


VALIDATE_OBJECT_REFERENCES

private static final boolean VALIDATE_OBJECT_REFERENCES
When casting or loading object references should the reference be checked to see if it is an object reference first?

See Also:
Constant Field Values

FAIL_ON_BAD_REFERENCES

private static final boolean FAIL_ON_BAD_REFERENCES
If a bad reference is encountered should we halt the VM?

See Also:
Constant Field Values

inCheck

private static volatile boolean inCheck
Flag to avoid recursive calls to check


checkMR

private static final MethodReference checkMR
Reference of method that checks a reference

Constructor Detail

BaselineMagic

BaselineMagic()
Method Detail

generateMagic

static boolean generateMagic(ArchitectureSpecific.Assembler asm,
                             MethodReference m,
                             RVMMethod cm,
                             Offset sd)
Entry point to generating magic

Parameters:
asm - assembler to generate magic code into
m - method reference
cm - the method being compiled
sd - the depth of the stack
Returns:
true if magic was generated

check

private static void check(ObjectReference value)
Method called to check an object reference is valid

Parameters:
value -