Top Description Constructors Methods
org.jruby.runtime.ivars

public Class AtomicVariableTable

extends Object
Class Inheritance
Imports
org.jruby.RubyBasicObject, .RubyClass, org.jruby.java.proxies.JavaProxy, org.jruby.util.ArraySupport, java.lang.invoke.VarHandle

Shared operations for working atomically with a Ruby object's variable table.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean

Returns:

whether the update was successful, for CAS retrying
createTableAtomic
(RubyBasicObject
the object into which to set the variable
self
,
int
the current variable table stamp
currentStamp
,
RubyClass
the "real" class for the object
realClass
,
Object[]
the current table
currentTable
,
int
the index of the variable
index
,
Object
the variable's value
value
)

Create or expand a variable table for the given object, using atomic operations to ensure visibility.

public static void
setVariableAtomic(RubyBasicObject
the object into which to set the variable
self
,
RubyClass
the "real" class for the object
realClass
,
boolean
if a full memory fence should be forced after updating the variable's value
fullFence
,
int
the index of the variable
index
,
Object
the variable's value
value
)

Set the given variable index into the specified object using atomic semantics.

private static boolean

Returns:

whether the update was successful, for CAS retrying
updateTableAtomic
(RubyBasicObject
the object into which to set the variable
self
,
int
the current variable table stamp
currentStamp
,
Object[]
the current table
currentTable
,
int
the index of the variable
index
,
Object
the variable's value
value
)

Update the given variable table for the given object, using atomic operations to ensure visibility.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AtomicVariableTableback to summary
public AtomicVariableTable()

Method Detail

createTableAtomicback to summary
private static boolean createTableAtomic(RubyBasicObject self, int currentStamp, RubyClass realClass, Object[] currentTable, int index, Object value)

Create or expand a variable table for the given object, using atomic operations to ensure visibility.

Parameters
self:RubyBasicObject

the object into which to set the variable

currentStamp:int

the current variable table stamp

realClass:RubyClass

the "real" class for the object

currentTable:Object[]

the current table

index:int

the index of the variable

value:Object

the variable's value

Returns:boolean

whether the update was successful, for CAS retrying

setVariableAtomicback to summary
public static void setVariableAtomic(RubyBasicObject self, RubyClass realClass, boolean fullFence, int index, Object value)

Set the given variable index into the specified object using atomic semantics. The "real" class and index are pass in to provide functional access.

Parameters
self:RubyBasicObject

the object into which to set the variable

realClass:RubyClass

the "real" class for the object

fullFence:boolean

if a full memory fence should be forced after updating the variable's value

index:int

the index of the variable

value:Object

the variable's value

updateTableAtomicback to summary
private static boolean updateTableAtomic(RubyBasicObject self, int currentStamp, Object[] currentTable, int index, Object value)

Update the given variable table for the given object, using atomic operations to ensure visibility.

Parameters
self:RubyBasicObject

the object into which to set the variable

currentStamp:int

the current variable table stamp

currentTable:Object[]

the current table

index:int

the index of the variable

value:Object

the variable's value

Returns:boolean

whether the update was successful, for CAS retrying