summaryrefslogtreecommitdiff
path: root/runtime/proxy_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Clean up Field::CreateFromArtField().Vladimir Marko2020-05-151-9/+5
| | | | | | | | | | | | Remove code dealing with the DexCache. This was obsolete since switching to hash-based DexCache arrays. This makes the last remaining template parameter unused, so remove it and move the implementation to the .cc file. Test: m test-art-host-gtest Test: testrunner.py --host --optmizing Test: aost_taimen-userdebug boots. Change-Id: Ib2077028f45792e4357d9c57280ece70a22e47a2
* Clean up Constructor/Method/Field construction.Vladimir Marko2020-05-051-4/+4
| | | | | | | | | | | | | Simplify the code by ignoring active transactions. Writing to fields of a newly allocated object does not need to be recorded as aborting the transaction removes all references to the new object and it's unnecessary to roll back writes to unreachable object's fields. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Change-Id: Ib5cd60c003d2ad3e6a246ff86d6b9288428c60ee
* Make jni_internal_test a CommonRuntimeTest.Vladimir Marko2019-02-201-1/+1
| | | | | | | Also clean up proxy_test and reflection_test. Test: m test-art-host-gtest Change-Id: I7530855a40d7b9f7214ea7a069508ae1361b2b42
* Use 'final' and 'override' specifiers directly in ART.Roland Levillain2018-08-281-1/+1
| | | | | | | | | | | | | | | Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
* Ensure we never instrument Proxy.<init> entrypointAlex Light2018-06-131-1/+14
| | | | | | | | | | | | | | | | | | | | | | Due to the way we implement Proxy classes we need to be very careful when modifying proxy classes and the (non-proxy) java.lang.reflect.Proxy class and its methods. In particular we always avoid installing an instrumentation entrypoint into the Proxy.<init> method since we copy it for each proxy class. Failing to do this causes problems as the instrumentation entrypoint bounces to the Proxy entrypoint which gets confused since the copied init method is not really a proxy method. Unfortunately if one starts the profiling process early enough it was possible for the Proxy.<init> method to get instrumented as it is being loaded. This CL ensures that the method is skipped just like it would be if profiling was started later. NB Test requires several other patches to actually run far enough to observe this issue. Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xplugin:libtracefast-trampolined.so Test: ./test/testrunner/testrunner.py --host --run-test-option='--with-agent libtifast.so=MethodEntry,MethodExit' Change-Id: I18fb381d18d7100b5ec843b3cddd387f2d033776
* ObjPtr<>-ify ClassLinker::FindClass(), fix 1 stale reference use.Vladimir Marko2018-05-311-7/+7
| | | | | | | | | | Thread::CreateAnnotatedStackTrace() was using a stale reference `aste_array_class`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I191907c0053456bb57de425aa6ccd9668df818a2
* Fix hiddenapi::MemberSignature for proxiesDavid Brazdil2018-05-081-88/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Proxy classes are classes generated at runtime which implement a given interface. Because they do not inherit the associated dex file form the interface(s), names/signatures of methods cannot be requested directly, but rather through the original interface method. Calling getName() on a proxy mirror::Class also triggers a DCHECK. This patch will refer to the interface method when printing the signature instead of the proxy method. This fixes the warning printed for the proxy method, printing even the class name of the interface instead of the name of the proxy class. This is meant to provide useful info to the devloper. Proxies do not define fields except for the synthetic 'interfaces' and 'throws' fields. Their signatures remain unchanged. This patch also continues to check the access flags of the proxy method for performance reasons. De-proxying the method would introduce two new memory accesses into the fast path. That means deduplication of warnings remains independent between the original and proxy methods. Bug: 78327881 Test: make test-art-host-gtest-hidden_api_test Merged-In: I8f334e5e2b62ca38691c94524edaf198eb73574b Change-Id: I8f334e5e2b62ca38691c94524edaf198eb73574b (cherry picked from commit 73a64f6a2a475c2fe018c7ab1151e3f44d316533)
* Refactor ArtField::GetType<>() as {Lookup,Resolve}Type().Vladimir Marko2017-11-061-2/+2
| | | | | | | | | And add no thread suspension assertion to LookupType() as well as ArtMethod::LookupResolvedClassFromTypeIndex(). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: If1541ccb0aafeabb6d1dd5566f10afcac98a2ef1
* ART: Change method lookup to be more consistent to JLS and the RI.Vladimir Marko2017-07-201-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method lookup for different invoke types was previously widely different and didn't work well with the dex cache method array where we have only a single slot for each MethodId. The new behavior is to perform the same lookup for all cases, distinguishing only between interface and non-interface referencing class, and to further align the behavior with the JLS and the RI. Where the JLS conflicts with the RI, we follow the JLS semantics. The new lookup for class methods first searches the methods declared in the superclass chain (ignoring "copied" methods) and only then looks in the "copied" methods. If the search in the superclass chain finds a method that has not been inherited (i.e. either a private method or a package-access method where one of the classes in the chain does not belong to the same package, see JLS 8.4.8), we still search the "copied" methods as there may actually be a method inherited from an interface. This follows the JLS semantics where inherited methods are included in the search (JLS 15.12.2.1) but conflicts with the RI where the private or package-access method takes precedence over methods inherited from interfaces. Note that this search can find an accessible method that is not inherited by the qualifying type, either for a package access method when the referrer is in the same package but the qualifying type is in another package, or for a private method where the referrer is in the same class but the qualifying type is actually a subclass. For the moment we allow such calls and we shall consider whether to throw an IncompatibleClassChangeError in this situation in future to comply with JLS 15.12.4.3. The new lookup for interface methods searches the interface class, then all the superinterfaces and then the java.lang.Object class, see implicitly declared methods in interfaces, JLS 9.2. The search for the maximally-specific non-abstract superinterface method is not yet implemented, but the difference should be difficult to observe as the usual subsequent call to FindVirtualMethodForInterface() should yield the same result for any matching method. The new test 162-method-idx-clash exposes several cases where we previously completely messed up due to the effects of the DexCache, or where we were out of line with the RI. It also tests a case where the JLS and the RI disagree and we follow the JLS. Test: art/test/run-test --host --jvm 162-method-resolution Test: m test-art-host-gtest Test: testrunner.py --host Test: testrunner.py --host --interp-ac Test: Nexus 6P boots. Test: testrunner.py --target Bug: 62855082 Bug: 30627598 Change-Id: If450c8cff2751369011d649c25d28a482a2c61a3
* ART: Clean up art_method.hAndreas Gampe2017-04-211-0/+1
| | | | | | | | | | | Clean up the header. Fix up other headers including the -inl file, in an effort to prune the include graph. Fix broken transitive includes by making includes explicit. Introduce new -inl files for method handles and reference visiting. Test: source build/envsetup.sh && lunch aosp_angler-userdebug && mmma art Test: source build/envsetup.sh && lunch aosp_mips64-userdebug && mmma art Change-Id: I8f60f1160c2a702fdf3598149dae38f6fa6bc851
* ART: Add operator == and != with nullptr to HandleAndreas Gampe2017-02-141-10/+10
| | | | | | | Get it in line with ObjPtr and prettify our code. Test: m Change-Id: I1322e2a9bc7a85d7f2441034a19bf4d807b81a0e
* Clean up Class::GetDirectInterface().Vladimir Marko2016-12-091-2/+2
| | | | | | | | | | | | | | | | | | | Once the `klass` has been resolved, this function should not need to resolve interface types anymore. Drop the type resolution from this function and pass the Class as ObjPtr<> instead of Handle<>. Make callers that expect non-null result DCHECK() that assumption. For the callers that may actually need to resolve these interface classes, introduce a new function ResolveDirectInterface(). Also improve ObjPtr<> constructors and assignment operator to improve overload resolution. For example, if we have foo(ObjPtr<T1>) and foo(ObjPtr<T2>), calling foo(.) with a T1* would have previously been ambiguous even if T1 is not a base of T2. Test: m test-art-host Change-Id: Iff44a7285f68f0af4507fc9ba37343865422fe84
* ART: Make Handle trivially-copyableAndreas Gampe2016-11-031-2/+0
| | | | | | | | | | | | Use default copy constructor and copy assignment to make Handle trivially copyable. Do the same for MutableHandle. Fix up unused Handle warnings. Add asserts in the HandleScope test. Bug: 32619234 Test: m test-art-host Change-Id: I151f0bdbeeb131a6fc5c44610f345663ebe96c09
* Move mirror::Class to use ObjPtrMathieu Chartier2016-10-131-2/+2
| | | | | | | | | | | Leave the return types as non ObjPtr for now. Fixed moving GC bugs in tests. Test: test-art-host Bug: 31113334 Change-Id: I5da1b5ac55dfbc5cc97a64be2c870ba9f512d9b0
* ObjPtr misc cleanupMathieu Chartier2016-10-051-6/+6
| | | | | | | | | | | Check for subtypes in constructor. Remove various calls to MakeObjPtr and ObjPtr::Ptr. Bug: 31113334 Test: test-art-host Change-Id: I8d680d514ea52cd64fc4f7c2e988926bc726174e
* Move ArtField to ObjPtrMathieu Chartier2016-10-031-6/+6
| | | | | | | | | | | | | | | | | | | Added EXPECT_OBJ_PTR_EQ and variants to gtests. Fixed moving GC bugs in: ClassLinker::CreatePathClassLoader ClassLinkerTest: StaticFields ObjPtr Decode call sites: 186 -> 181. Some tests fail due to ResolvedFieldAccessTest, will fix in follow up CL. Bug: 31113334 Test: test-art-host CC baker Change-Id: I8b266ad00f3c20c8cbe7cfdf280d175083df0b88
* Clean up ScopedThreadStateChange to use ObjPtrMathieu Chartier2016-09-291-4/+4
| | | | | | | | | | | | | | | Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
* ART: SHARED_REQUIRES to REQUIRES_SHAREDAndreas Gampe2016-08-301-1/+1
| | | | | | | | | This coincides with the actual attribute name and upstream usage. Preparation for deferring to libbase. Test: m Test: m test-art-host Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
* ART: Convert pointer size to enumAndreas Gampe2016-08-011-14/+15
| | | | | | | | | Move away from size_t to dedicated enum (class). Bug: 30373134 Bug: 30419309 Test: m test-art-host Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
* ART: Add pointer-size template to some reflection functionsAndreas Gampe2016-07-251-8/+16
| | | | | | | | | | | | | | | | | The unstarted runtime may run code for a different pointer size, even when no transaction is active (e.g., during startup). To retain performance when the runtime is up and executing under normal conditions, add a template parameter and use sizeof(void*) in places where it is adequate. For maintainability, it is necessary to drop the default for the transaction template parameter. Implicit conversions from bool to size_t may lead to incorrect code and hard to diagnose problems. So instead ensure that all callers must give all template parameter values. Test: m test-art-host Change-Id: I3076883422c8553ede4de5642409c5684a5a9aa8
* Revert "Revert "Combine direct_methods_ and virtual_methods_ fields of ↵Alex Light2015-12-161-1/+1
| | | | | | | | | | mirror::Class"" This reverts commit ae358c1d5cef227b44d6f4971b79e1ab91aa26eb. Bug: 24618811 Change-Id: I8becf9bae3258450b90cfef5e79589db7c535a4d
* Revert "Combine direct_methods_ and virtual_methods_ fields of mirror::Class"Alex Light2015-12-151-1/+1
| | | | | | This reverts commit 6286a97bea0f584342803a215550038852b24776. Change-Id: I5b00f6d1350e9c587acd4b185367dc815ea707de
* Combine direct_methods_ and virtual_methods_ fields of mirror::ClassAlex Light2015-12-141-1/+1
| | | | | | | | | This makes several parts of the overall runtime simpler and reduces the size of a class object by 32-bits. Bug: 24618811 Change-Id: I36129b52189e26898ea56fa2b7b45652e06af236
* Revert "lambda: Add support for invoke-interface for boxed innate lambdas"Nicolas Geoffray2015-11-241-4/+4
| | | | | | | | | | | 955-lambda is flaky Bug: 24618608 Bug: 25107649 This reverts commit 457e874459ae638145cab6d572e34d48480e39d2. Change-Id: I24884344d21d7a4262e53e3f5dba57032687ddb7
* lambda: Add support for invoke-interface for boxed innate lambdasIgor Murashkin2015-11-201-4/+4
| | | | | | | | | | | | | | Lambda closures created with the 'create-lambda' instruction (termed "innate lambdas") can be turned into an object with 'box-lambda'. This CL enables support for those kinds of lambdas to work with 'invoke-interface' by generating a proxy class for the lambda. Note: MIPS32/64 support not included. Bug: 24618608 Bug: 25107649 Change-Id: Ic8f1bb66ebeaed4097e758a50becf1cff6ccaefb
* Reduce memory used by CompiledMethods.Vladimir Marko2015-10-271-2/+2
| | | | | | | | | | | | | | | | | Use LengthPrefixedArray<>s instead of SwapVector<>s to store CompiledMethod data and get rid of the unnecessary members of CompiledMethod to reduce dex2oat memory usage. Refactor the deduplication from CompilerDriver to a new class. Use HashSet<> instead of std::set<> for the DedupeSet<> to further decrease the memory usage and improve performance. This reduces the dex2oat memory usage when compiling boot image on Nexus 5 (with Optimizing, -j1) by ~6.75MiB (5%). This also reduces the compile time by ~2.2% (~1.6% dex2oat time; with Optimizing, without -j). Change-Id: I974f1f5e58350de2bf487a2bca3907fa05fb80ea
* Move ArtFields and ArtMethods to be a length prefixed arrayMathieu Chartier2015-08-051-21/+20
| | | | | | | | Fixes race conditions between changing method and fields arrays being seen in the wrong order by the GC. Bug: 22832610 Change-Id: Ia21d6698f73ba207a6392c3d6b9be2658933073f
* Move to newer clang annotationsMathieu Chartier2015-07-221-1/+1
| | | | | | | | | | | | | | | Also enable -Wthread-safety-negative. Changes: Switch to capabilities and negative capabilities. Future work: Use capabilities to implement uninterruptible annotations to work with AssertNoThreadSuspension. Bug: 20072211 Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
* Move mirror::ArtMethod to nativeMathieu Chartier2015-05-291-8/+8
| | | | | | | | | | | | | 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
* Fix a cts crash around proxy class fields.Hiroshi Yamauchi2015-05-201-0/+50
| | | | | | | | | | | | | | org.apache.harmony.tests.java.io.SerializationStressTest4#test_writeObject_Proxy As the static fields of proxy classes share the dex file indices, they shouldn't be resolved in the dex cache or else Field::GetArtField() may return a wrong art field that belong to a different proxy class. (cherry pick commit a56ce5e267c9744ed99e40ae5cd9b527971e1d63) Bug: 20557050 Change-Id: If672c0e67bc49e672e34d75ffbe29c65f5a423b9
* Add AbstractMethod, Constructor, MethodMathieu Chartier2015-04-211-34/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves functionality to ART from libcore. Precursor to moving ArtMethods to native. Mostly performance improvements. N5 perf before (irrelevant results removed): Class_getConstructor 962.87 =========== Class_getDeclaredMethod 2394.37 ============================ Class_getMethod 2509.20 ============================== Class_newInstance 1999.81 ======================= Method_invokeI 1439.02 ================= Method_invokePreBoxedI 1415.82 ================ Method_invokeStaticI 1456.24 ================= Method_invokeStaticPreBoxedI 1427.32 ================= Method_invokeStaticV 814.47 ========= Method_invokeV 816.56 ========= After: benchmark ns linear runtime Class_getConstructor 1302.04 ================ Class_getDeclaredMethod 1459.01 ================== Class_getMethod 1560.40 =================== Class_newInstance 2029.94 ========================= Method_invokeI 1312.89 ================ Method_invokePreBoxedI 1255.01 =============== Method_invokeStaticI 1289.13 =============== Method_invokeStaticPreBoxedI 1196.52 ============== Method_invokeStaticV 790.82 ========= Method_invokeV 791.73 ========= Performance improvements are more than just fixing regressions introduced in: http://android-review.googlesource.com/#/c/146069/ Bug: 19264997 Change-Id: Ife79c469fdb09f30e3aefcfc3e0ce5ed32303fce
* ART: Clean up includes.Vladimir Marko2015-04-131-0/+1
| | | | | | | Reduce dependencies to improve incremental build times. Break up circular dependency involving class_linker-inl.h. Change-Id: I4be742c5c2b5cd9855beea86630fd68aab76b0db
* Move ArtField to nativeMathieu Chartier2015-04-101-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* Add AccessibleObject and Field to mirrorMathieu Chartier2015-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main motivation is to remove all the functionality / field access on java side to ArtField. Also comes with some reflection speedups / slowdowns. Summary results: getDeclaredField/getField are slower mostly due to JNI overhead. However, there is a large speedup in getInt, setInt, GetInstanceField, and GetStaticField. Before timings (N5 --compiler-filter=everything): benchmark ns linear runtime Class_getDeclaredField 782.86 === Class_getField 832.77 === Field_getInt 160.17 = Field_setInt 195.88 = GetInstanceField 3214.38 ============== GetStaticField 6809.49 ============================== After: Class_getDeclaredField 1068.15 ============ Class_getField 1180.00 ============== Field_getInt 121.85 = Field_setInt 139.98 = GetInstanceField 1986.15 ======================= GetStaticField 2523.63 ============================== Bug: 19264997 Change-Id: Ic0d0fc1b56b95cd6d60f8e76f19caeaa23045c77
* Remove FieldHelper.Ian Rogers2014-12-021-13/+11
| | | | Change-Id: I2d74e2d5b3c35a691c95339de0db9361847fca11
* ART: Rename Handle hierarchyAndreas Gampe2014-09-151-7/+9
| | | | | | | Bring the names in line with normal OO principles: ConstHandle becomes Handle, and Handle becomes MutableHandle. Change-Id: I0f018eb7ba28bc422e3a23dd73a6cbe6fc2d2044
* Prevent stubs from being installed in java.lang.reflect.Proxy.<init>.Jeff Hao2014-08-151-8/+2
| | | | | | | This CL is a better fix for proxy tracing and undoes the changes in https://android-review.googlesource.com/#/c/103025/ Change-Id: Ie82bb49f07774bd08a6720ddbe5b1f8ee9363acf
* Avoid use of std::string where we have const char*.Ian Rogers2014-08-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
* Fix proxy tracing and enable tests that now work with tracing.Jeff Hao2014-08-061-2/+8
| | | | | | | Also updates proxy_test to generate an image for GetQuickOatCodeFor. Bug: 16386215 Change-Id: Ie7daad3d73ea7b60187bc1e7037ade0df8277107
* Remove object_utils.h.Ian Rogers2014-07-161-0/+1
| | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Break apart header files.Ian Rogers2014-07-151-3/+4
| | | | | | | | Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
* Merge "Change FieldHelper to use a handle."Mathieu Chartier2014-06-061-29/+37
|\
| * Change FieldHelper to use a handle.Mathieu Chartier2014-06-061-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed compaction bugs related to FieldHelper::GetType in: artSet32InstanceFromCode SetFieldValueImpl CheckReceiver Field_set interpreter::DoFieldPut MethodVerifier::VerifyISGet MethodVerifier::VerifyISPut MethodVerifier::VerifyIGetQuick Bug: 13077697 Change-Id: I7de9ded2893b5568d43e4daa86fd135bf5508b72
* | Fix crash in JDWP ReferenceType.SourceFile commandSebastien Hertz2014-06-051-2/+2
|/ | | | | | | | | | | | | Updates Dbg::GetSourceFile to return ABSENT_INFORMATION error code when Class::GetSourceFile returns nullptr. This happens if the class has no source file information. Updates Class:GetSourceFile to return nullptr for classes which have no ClassDef item like generated classes. This allows to remove the IsProxyClass test from Dbg::GetSourceFile. Adds this test in proxy_test. Bug: 15426710 Change-Id: I019da4ced83778d5264484c43b225f8b5c95632e
* Delete ClassHelper and fix compaction bug in GetDirectInterfaceMathieu Chartier2014-05-181-18/+21
| | | | | | | | | | | Cleanup helps to prevent compaction bugs. Fixed a fairly serious compaction error caused by calling ClassHelper::GetDirectInterface without handling the case where it causes thread suspension due to ResolveType. Bug: 8981901 Change-Id: I82b3bb6dd48d21eb6ece7aae0733c4a23c2bc408
* Add Handle/HandleScope and delete SirtRef.Mathieu Chartier2014-05-131-4/+6
| | | | | | | | | | | | | | | | Delete SirtRef and replaced it with Handle. Handles are value types which wrap around StackReference*. Renamed StackIndirectReferenceTable to HandleScope. Added a scoped handle wrapper which wraps around an Object** and restores it in its destructor. Renamed Handle::get -> Get. Bug: 8473721 Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
* Fix ClassHelper::GetDirectInterface for proxy classSebastien Hertz2014-04-011-9/+56
| | | | | | | | | | | Returns only the direct interfaces implemented by the proxy class. We collect them from the "interfaces" field in the synthesized proxy class instead of looking into the iftable. Also updates proxy_test to reflect this change. Bug: 13689930 Change-Id: I926e2ed30f9e65972d700a378671cec82dedaa7c
* Fix debugger crashes in presence of proxy objects.Sebastien Hertz2014-03-131-0/+139
Fix ClassHelper::NumDirectInterfaces to use IfTable::Count instead of the iftable array's length (which is twice the interface count). This happens when processing ReferenceType::Interfaces command and was causing a crash. Return ABSENT_INFORMATION error code when we're asked for the source file of a proxy class. Otherwise we call ClassHelper::GetSourceFile which expect the class has a corresponding ClassDef item in the DEX file which is not true for proxy classes. Add new proxy_test to check ClassHelper works correctly with proxy classes. Bug: 13426918 Change-Id: I5c1212b1a697dd7dc1ab18e99552ee113c533a5a