aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.cpp
diff options
context:
space:
mode:
authorSerban Constantinescu <serban.constantinescu@arm.com>2013-10-03 16:56:48 +0100
committerAndrew Warfield <hiasant@gmail.com>2013-12-18 22:28:53 +0100
commit4f0337ace7492c564f63a284cbf3dcd8b3550fe9 (patch)
tree0e71cb4fe1b95cbefda1f9949e5f522e1d940578 /vm/compiler/codegen/arm/CodegenDriver.cpp
parent05c005112752bfb5ad7807d0dadf016fbb696271 (diff)
Dalvik: Ensure that the array length complies with the final specifier
JSR-133, which Android 4 should comply with, "final" fields should be visible to all threads at the time the constructor exits, regardless of synchronization. This behaviour should also apply to the array lengths as they are regarded as equivalent in behaviour to "final" fields. Non-final fields require explicit synchronization in Java for them to be accessed correctly. The Dalvik VM in Android ensures constructors for ordinary object behave properly by inserting a memory barrier ("DMB") on their return if the object's class has a "final" field. The issue, however, is that while Dalivk inserts a barrier in constructors, it doesn't during array create. A barrier ought to be inserted in order to ensure an array's length is visible when the array itself can be observed by other threads. In order for Dalvik to be correct in respect to JSR-133 and the ARM memory model, it should be modified to have a memory barrier after an array is allocated and initialized, before it is visible to other threads. Change-Id: I329656139264552bbd7cacd8c743b694ee2e0bb8 Signed-off-by: Stuart Monteith <Stuart.Monteith@arm.com> Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.cpp')
0 files changed, 0 insertions, 0 deletions