summaryrefslogtreecommitdiff
path: root/runtime/mirror/array-alloc-inl.h
AgeCommit message (Collapse)Author
2024-09-30Revert^5 "Object.clone() allocates more movable objects" Nicolas Geoffray
This reverts commit ea269f69d05fe333e4b36634b925c3c40fc8ce95. Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Bug: 364629185 Reason for revert: Failure on asan: +addressOf succeeded on movable object +Unexpectedly got 0 address in checkMovable Change-Id: I1f27845bf3fb7a1542f24b943d999f2d4da5e23a
2024-09-26Revert^4 "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit fc0ed57a5f25d8a7b3fbf200224bd880ed05eff5. PS1 is identical to aosp/3231043 PS2 adds 2280-address-of test, re-allows non-movable objects to be allocated in LOS, and more generally tracks non-movable objects in other spaces. PS3 Style tweak PS4 Disable test on jvm Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Bug: 364629185 Test: Build and boot AOSP Test: testrunner.py --host -b --all-gc -t 2280-address-of Change-Id: I4b2929c353a6ede916762de509056817f001d6f8
2024-09-03Revert^3 "Object.clone() allocates more movable objects" Pechetty Sravani (xWF)
This reverts commit 1956542906d0b128a86975af009ba4601d02129a. Reason for revert: Droid Monitor created revert due to this b/363849521. Change-Id: Ic56e46bc11b1fd696b82f29782a1d1735ee805a9
2024-08-30Revert^2 "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit 7c89f49c2c542df1a5780fb851e2ef0e0909f48f. PS1 is identical to aosp/3200711. PS2 revises the approach a bit by continuing to allocate non-movable objects in LargeObjectsSpace, but tracking them explicitly in a renamed, and now lock-protected, data structure stray_non_movable_objects_, which explicitly tracks nonmovable objects in both zygote and large objects spaces. This was done after discovering that there are applications that allocate more than 64MB of mostly large DirectByteBuffers. Also modifies 070-nio-buffer to check that we can allocate lots of direct ByteBuffers. PS3-PS5 have minor tweaks (comments and slight code simplification). Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Test: Build and boot AOSP Test: testrunner.py --host -b --all-gc -t 070-nio-buffer Change-Id: Ia6948c516b30188934a644a3f8f788914dfabb2a
2024-08-19Revert "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit a5001fed23788c966fd87048d7f17ba8c0b51914. Reason for revert: b/360363656 Change-Id: Ibfea46976bb6434d728c69160edb5904ab7708aa
2024-08-14Object.clone() allocates more movable objects Hans Boehm
Make Object.clone() allocate an unmovable object only if the original was specifically allocated as nonmovable. Or at least get much closer to that. In the process, we stop allocated nonmovable objects in LargeObjectsSpace, so that we can better identifty them. Objects in image space cannot have been allocated as nonmovable: newNonMovableArray() involves JNI call, and this will cause a transaction failure. This is good, since the act of including the object in an ImageSpace would move it. The ZygoteSpace is allocated by copying objects into nonmoving space. To avoid having clone() treat the whole ZygoteSpace as nonmovable, we explicitly remember the non-class objects that were already there. Currently we use a std::set data structure for this. This seems a bit suboptimal; a sorted array may be an improvement. But empirically the set only contains a dozen or two elements for AOSP. We do implicitly allocate classes using the nonnmoving allocator. But those cannot be cloned. Thus we do not bother tracking them. For Array::CopyOf, we DCHECK that the argument was movable, and fix one of the callers to fail in a more appropriate way if we would otherwise violate that. Prevent jvmti from resizing a nonmovable array. I don't think anything good could have come of that anyway. This should prevent us from creating unrequested nonmovable objects, except as a result of the CC collector using that as a backup when it otherwise runs out of space during copying. Rename IsMovableObject() to somewhat clarify that it queries an implementation property, where IsNonMovable() is a query about intended object semantics, NOT implementation artifacts. Various drive-by documentation fixes for issues I encountered while trying to understand the code. Bug: 355291033 Bug: 354087169 Test: Build and boot AOSP Change-Id: Ia24dd1c2623d3d588c397332f87be45cc0f4bf27
2024-01-24Add visibility attributes in runtime/mirror Dmitrii Ishcheikin
Bug: 260881207 Test: presubmit Test: abtd app_compat_drm Test: abtd app_compat_top_100 Test: abtd app_compat_banking Change-Id: I6f5eacb96d0ead8144f090624aa99610f78fe57c
2023-05-22Use C++17's [[maybe_unused]] attribute in ART Stefano Cianciulli
Bug: 169680875 Test: mmm art Change-Id: Ic0cc320891c42b07a2b5520a584d2b62052e7235
2019-05-31Add default template args to Heap::Alloc*Object*(). Vladimir Marko
Namely kInstrumented=true and kCheckLargeObject=true. This is a follow-up after https://android-review.googlesource.com/963693 Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I6c23e76f90f1892382c3bb8c331d12437bc23f89
2019-05-16ART: Forward-declare AllocatorType (iwyu) Andreas Gampe
Test: mmma art Change-Id: I064a1664727dfbed6ae91bde1658c7ba021bcc94
2019-03-29Clean up explicit conversions to ObjPtr<>. Vladimir Marko
Add an ObjPtr<>::DownCast() overload that takes a plain pointer and remove unnecessary calls to MakeObjPtr(), usually preceding DownCast(). Move the MakeObjPtr() to common_art_test.h . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I2a243b6d8f3b2e773396dfc53b659c5f7d9ea44a
2018-10-25ART: Add array-alloc-inl.h Andreas Gampe
In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for array allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: Id3378f40c52fa7ef4297af08cb7509e0c04b94d1