History log of /art/runtime/native/sun_misc_Unsafe.cc
Revision Date Author Comments
629afaba488c5cfdd3ee9ba5b2df24af9de6f2a7 19-Feb-2016 Igor Murashkin <iam@google.com> runtime: Add CAS and fences to sun.misc.Unsafe

Bug: 26264765
Change-Id: I68b482e5f9a0a26419af5e58a8d67c8c8a8e01a9
0dd8c399e6a3b4f46ce1ba1388507bf0ef93d5ff 01-Feb-2016 Narayan Kamath <narayan@google.com> Track libcore change aa517a356a38b8cd6764667e1edd735aaf5978e9.

Change-Id: I32a995eb62e3268c20fa5c2ac8dc2bf190c6fb7a
cc78f3f87b0b8c6b0fb759e698840898940d4865 12-Dec-2015 Hiroshi Yamauchi <yamauchi@google.com> Fix (non-intrinsic) UnsafeCASObject for the read barrier config.

Make sure the field contains a to-space reference before attempting the
CAS with a special read barrier to avoid an incorrect CAS failure.

This is only about the non-intrinsic UnsafeCASObject.

This seems to fix some jsr166 test failures.

Also, remove the unused template parameter kMaybeDuringStartup.

Bug: 25883050
Bug: 12687968

Change-Id: Ia6f0d882fa3d90c42f14968672d547babcdf6309
56e03f6540420644a9e84f99f6ccacb3f107e971 13-Nov-2015 Narayan Kamath <narayan@google.com> Remove implementation of Unsafe_getAddress.

Change-Id: I68fa1a02a47ac5bf7e5880ccb154d460747938f7
6c0ea2799f7dc8b8763c07a6e94c23590f6b54b5 23-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Sprinkle attribute unused / noreturn wherever necessary.

Change-Id: I32b646edc2617aa7c2f5e3b1fa39d1fcc1f2ab39
a0cf5a663f19f0392187d349f1832d85f90ab805 07-Sep-2015 Narayan Kamath <narayan@google.com> Fix cpplint issues.

Change-Id: I03399f92ce36a69539ee4e0509a884ea0a639ad4
5c4042222fef6bca942a229a464b233d5ca89a84 04-Aug-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix sun.misc.Unsafe#(get|set)(Float|Double)

Unsafe was suffering from implicity cast from
double/float to int32_t/int64_t in unsafe setters and
getters. Fixes few tests.

Change-Id: Ia3ad1b71bc6fd1a0d9fc8e15fdec44497cd73ff5
903ac2791d303e4827aea0c0afaeefe0dc65c621 23-Jul-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Use offset in sun.misc.Unsafe#copyMemoryTo/FromArray

Change-Id: I4b6a89d1949b687d91712c236b31636fe0cde122
5abc6f913bc77aa3b9c05ad07905d4c1c28b2661 30-Jun-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Object::Get/SetField methods for 8 and 16 bit fields.

For simplicity new methods lack support for transactions.
Those new netods are used to implement sun.misc.Unsafe.get/set
methods for 8/16 bit wide primitives. Those methods are used
by the java primitive serialization/deserialization methods.

Change-Id: Iaa133b32beac996642f691e1611536f5fd11a260
8e73ea4796c832271cd578727b5834f7a10bc693 07-May-2015 Piotr Jastrzebski <haaawk@google.com> Implement some more of sun.misc.Unsafe.

Change-Id: If005462fb188472c0177fb95b3045d78536042f9
d7fcf6e23cbfcb87f566dc2ac7092e0021662784 05-May-2015 Piotr Jastrzebski <haaawk@google.com> Unsafe: Add native implementations for new methods.

Change-Id: I9324deffa068d9e5d9e581363cec6c7fae969537
3d21bdf8894e780d349c481e5c9e29fe1556051c 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997

(cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33)

Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d

Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3

ART: Fix casts for 64-bit pointers on 32-bit compiler.

Bug: 19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457

Fix JDWP tests after ArtMethod change

Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.

Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.

Bug: 19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2

Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0

Fix bogus image test assert

Previously we were comparing the size of the non moving space to
size of the image file.

Now we properly compare the size of the image space against the size
of the image file.

Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a

[MIPS64] Fix art_quick_invoke_stub argument offsets.

ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.

This fixes mips64 boot.

Bug: 19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
e401d146407d61eeb99f8d6176b2ac13c4df1e33 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
277ccbd200ea43590dfc06a93ae184a765327ad0 04-Nov-2014 Andreas Gampe <agampe@google.com> ART: More warnings

Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.

Change-Id: I81bbdd762213444673c65d85edae594a523836e5
d8434439dc64add41cdfa69ddf96b960af9050de 11-Jul-2014 Hans Boehm <hboehm@google.com> Call strong CAS from unsafe. Add more CAS versions.

Adds a number of additional CAS versions. Calls the correct
one from sun.misc.unsafe, fixing a recently introduced bug.
Avoid unnecessary ordering constraint when installing hash code.

Change-Id: I7c09d0c95ceb2a549ec28ee34084198ab3107946
228602f562f1d130d06e60a98752d99c2d467d6a 10-Jul-2014 Ian Rogers <irogers@google.com> Make CAS operations in Object use art::Atomic.

Make naming consistent with art::Atomic.

Change-Id: If3abdb019ef8b53bd809e3fef3fd5248aeb27e9a
3035961cb41865b80b927546be0c708b6389cec6 22-May-2014 Hans Boehm <hboehm@google.com> Clean up and augment Atomic class. Replace QuasiAtomic MemBars.

Add a number of missing C++11 operations to Atomic class.
Invoke the 64 bit routines in QuasiAtomic when necessary.
Replace QuasiAtomic membars with fences that correspond to C++11 fences.

QuasiAtomic was moved to the top of the file. Only fence implementations
actually changed.

This replaces some buggy uses of MembarStoreStore, as reported
in b/14685856 .

Avoid some redundant fences for long volatile operations.

Incompletely converts low-level memory access operations to Atomic.

Change-Id: Iea828431a0cea46540eb74fcaa02071cab6fdcda
b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cf 29-Apr-2014 Ian Rogers <irogers@google.com> Force inlining on trivial accessors.

Make volatility for GetFieldObject a template parameter.
Move some trivial mirror::String routines to a -inl.h.

Bug: 14285442

Change-Id: Ie23b11d4f18cb15a62c3bbb42837a8aaf6b68f92
d2fe10a3a34af171bf1631219cd2d6ff6b7778b5 15-Jan-2014 Sebastien Hertz <shertz@google.com> Remove blacklist

Removes the class initialization blacklist and use transaction to detect and
revert class initialization attempting to invoke native method. This only
concerns class initialization happening at compilation time when generating an
image (like boot.art for the system).

In transactional mode, we log every object's field assignment and array update.
Therefore we're able to abort a transaction to restore values of fields and
array as they were before the transaction starts. We also log changes to the
intern string table so we can restore its state prior to transaction start.

Since transactional mode only happens at compilation time, we don't need to log
all these changes at runtime. In order to reduce the overhead of testing if
transactional mode is on/off, we templatize interfaces of mirror::Object and
mirror::Array, respectively responsible for setting a field and setting an
array element.

For various reasons, we skip some specific fields from transaction:
- Object's class and array's length must remain unchanged so garbage collector
can compute object's size.
- Immutable fields only set during class loading: list of fields, method,
dex caches, vtables, ... as all classes have been loaded and verified before a
transaction occurs.
- Object's monitor for performance reason.

Before generating the image, we browse the heap to collect objects that need to
be written into it. Since the heap may still holds references to unreachable
objects due to aborted transactions, we trigger one collection at the end of
the class preinitialization phase.

Since the transaction is held by the runtime and all compilation threads share
the same runtime, we need to ensure only one compilation thread has exclusive
access to the runtime. To workaround this issue, we force class initialization
phase to run with only one thread. Note this is only done when generating image
so application compilation is not impacted. This issue will be addressed in a
separate CL.

Bug: 9676614
Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9
4d2efce8bf1947880b90efc44448b4940c8016fb 11-Feb-2014 Hiroshi Yamauchi <yamauchi@google.com> Don't hardcode object layout in Unsafe and space_test.

Add a test for Unsafe.arrayBaseOffset() and Unsafe.arrayIndexScale().

Change-Id: I9cbdb79a4a7ee055129f41811a117910c8b2febd
ef7d42fca18c16fbaf103822ad16f23246e2905d 06-Jan-2014 Ian Rogers <irogers@google.com> Object model changes to support 64bit.

Modify mirror objects so that references between them use an ObjectReference
value type rather than an Object* so that functionality to compress larger
references can be captured in the ObjectRefererence implementation.
ObjectReferences are 32bit and all other aspects of object layout remain as
they are currently.

Expand fields in objects holding pointers so they can hold 64bit pointers. Its
expected the size of these will come down by improving where we hold compiler
meta-data.
Stub out x86_64 architecture specific runtime implementation.
Modify OutputStream so that reads and writes are of unsigned quantities.
Make the use of portable or quick code more explicit.
Templatize AtomicInteger to support more than just int32_t as a type.
Add missing, and fix issues relating to, missing annotalysis information on the
mutator lock.
Refactor and share implementations for array copy between System and uses
elsewhere in the runtime.
Fix numerous 64bit build issues.

Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
b122a4bbed34ab22b4c1541ee25e5cf22f12a926 20-Nov-2013 Ian Rogers <irogers@google.com> Tidy up memory barriers.

Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 19-Oct-2013 Ian Rogers <irogers@google.com> Fast JNI support.

Use a modifier to signal a native method is a fast JNI method. If the
modifier is set then don't perform runnable transitions.

Change-Id: I7835b4d837bfdd1cb8e2d54b919c0d5e6cf90499
7940e44f4517de5e2634a7e07d58d0fb26160513 12-Jul-2013 Brian Carlstrom <bdc@google.com> Create separate Android.mk for main build targets

The runtime, compiler, dex2oat, and oatdump now are in seperate trees
to prevent dependency creep. They can now be individually built
without rebuilding the rest of the art projects. dalvikvm and jdwpspy
were already this way. Builds in the art directory should behave as
before, building everything including tests.

Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81