Class: AdLint::Cc1::Memory

Inherits:
Object
  • Object
show all
Includes:
Bindable
Defined in:
lib/adlint/cc1/object.rb

Direct Known Subclasses

MemoryBlock

Instance Attribute Summary collapse

Attributes included from Bindable

#binding

Instance Method Summary collapse

Methods included from Bindable

#be_alias_to, #bind_to

Constructor Details

#initialize(addr, byte_size) ⇒ Memory

Returns a new instance of Memory.



1167
1168
1169
1170
1171
# File 'lib/adlint/cc1/object.rb', line 1167

def initialize(addr, byte_size)
  @address   = addr
  @byte_size = byte_size
  @value     = nil
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



1173
1174
1175
# File 'lib/adlint/cc1/object.rb', line 1173

def address
  @address
end

#byte_sizeObject (readonly)

Returns the value of attribute byte_size.



1174
1175
1176
# File 'lib/adlint/cc1/object.rb', line 1174

def byte_size
  @byte_size
end

Instance Method Details

#_cascade_update(src, br) ⇒ Object



1196
1197
1198
1199
1200
# File 'lib/adlint/cc1/object.rb', line 1196

def _cascade_update(src, br)
  # NOTE: This method will be called only from # #narrow_value_domain! and
  #       #widen_value_domain! of Variable to propagate memory mutation to
  #       the upper MemoryBlock from MemoryWindow.
end

#dynamic?Boolean

Returns:

  • (Boolean)


1180
1181
1182
# File 'lib/adlint/cc1/object.rb', line 1180

def dynamic?
  subclass_responsibility
end

#readObject



1184
1185
1186
# File 'lib/adlint/cc1/object.rb', line 1184

def read
  @value
end

#static?Boolean

Returns:

  • (Boolean)


1176
1177
1178
# File 'lib/adlint/cc1/object.rb', line 1176

def static?
  subclass_responsibility
end

#write(val, src, br) ⇒ Object



1188
1189
1190
1191
1192
1193
1194
# File 'lib/adlint/cc1/object.rb', line 1188

def write(val, src, br)
  if @value
    @value.overwrite!(val, TransitionTag.new([src], [br]))
  else
    @value = VersionedValue.new(val, TransitionTag.new([src], [br]))
  end
end