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
diff --git a/runtime/debugger.h b/runtime/debugger.h
index 811d345..7c586a4 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -37,13 +37,13 @@
namespace art {
namespace mirror {
-class ArtMethod;
class Class;
class Object;
class Throwable;
} // namespace mirror
class AllocRecord;
class ArtField;
+class ArtMethod;
class ObjectRegistry;
class ScopedObjectAccessUnchecked;
class StackVisitor;
@@ -54,7 +54,7 @@
*/
struct DebugInvokeReq {
DebugInvokeReq(mirror::Object* invoke_receiver, mirror::Class* invoke_class,
- mirror::ArtMethod* invoke_method, uint32_t invoke_options,
+ ArtMethod* invoke_method, uint32_t invoke_options,
uint64_t* args, uint32_t args_count)
: receiver(invoke_receiver), klass(invoke_class), method(invoke_method),
arg_count(args_count), arg_values(args), options(invoke_options),
@@ -66,7 +66,7 @@
/* request */
GcRoot<mirror::Object> receiver; // not used for ClassType.InvokeMethod
GcRoot<mirror::Class> klass;
- GcRoot<mirror::ArtMethod> method;
+ ArtMethod* method;
const uint32_t arg_count;
uint64_t* const arg_values; // will be null if arg_count_ == 0
const uint32_t options;
@@ -92,7 +92,7 @@
class SingleStepControl {
public:
SingleStepControl(JDWP::JdwpStepSize step_size, JDWP::JdwpStepDepth step_depth,
- int stack_depth, mirror::ArtMethod* method)
+ int stack_depth, ArtMethod* method)
: step_size_(step_size), step_depth_(step_depth),
stack_depth_(stack_depth), method_(method) {
}
@@ -109,17 +109,14 @@
return stack_depth_;
}
- mirror::ArtMethod* GetMethod() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return method_.Read();
+ ArtMethod* GetMethod() const {
+ return method_;
}
const std::set<uint32_t>& GetDexPcs() const {
return dex_pcs_;
}
- void VisitRoots(RootVisitor* visitor, const RootInfo& root_info)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
-
void AddDexPc(uint32_t dex_pc);
bool ContainsDexPc(uint32_t dex_pc) const;
@@ -138,7 +135,8 @@
// set of DEX pcs associated to the source line number where the suspension occurred.
// This is used to support SD_INTO and SD_OVER single-step depths so we detect when a single-step
// causes the execution of an instruction in a different method or at a different line number.
- GcRoot<mirror::ArtMethod> method_;
+ ArtMethod* method_;
+
std::set<uint32_t> dex_pcs_;
DISALLOW_COPY_AND_ASSIGN(SingleStepControl);
@@ -166,9 +164,9 @@
SetMethod(other.Method());
}
- mirror::ArtMethod* Method() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ ArtMethod* Method() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- void SetMethod(mirror::ArtMethod* m) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ void SetMethod(ArtMethod* m) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Name 'Kind()' would collide with the above enum name.
Kind GetKind() const {
@@ -256,7 +254,7 @@
static bool IsJdwpConfigured();
// Returns true if a method has any breakpoints.
- static bool MethodHasAnyBreakpoints(mirror::ArtMethod* method)
+ static bool MethodHasAnyBreakpoints(ArtMethod* method)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
LOCKS_EXCLUDED(Locks::breakpoint_lock_);
@@ -524,10 +522,10 @@
kMethodEntry = 0x04,
kMethodExit = 0x08,
};
- static void PostFieldAccessEvent(mirror::ArtMethod* m, int dex_pc, mirror::Object* this_object,
+ static void PostFieldAccessEvent(ArtMethod* m, int dex_pc, mirror::Object* this_object,
ArtField* f)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static void PostFieldModificationEvent(mirror::ArtMethod* m, int dex_pc,
+ static void PostFieldModificationEvent(ArtMethod* m, int dex_pc,
mirror::Object* this_object, ArtField* f,
const JValue* field_value)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
@@ -541,7 +539,7 @@
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static void UpdateDebugger(Thread* thread, mirror::Object* this_object,
- mirror::ArtMethod* method, uint32_t new_dex_pc,
+ ArtMethod* method, uint32_t new_dex_pc,
int event_flags, const JValue* return_value)
LOCKS_EXCLUDED(Locks::breakpoint_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
@@ -574,7 +572,7 @@
// Indicates whether we need to force the use of interpreter to invoke a method.
// This allows to single-step or continue into the called method.
- static bool IsForcedInterpreterNeededForCalling(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForCalling(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (!IsDebuggerActive()) {
return false;
@@ -585,7 +583,7 @@
// Indicates whether we need to force the use of interpreter entrypoint when calling a
// method through the resolution trampoline. This allows to single-step or continue into
// the called method.
- static bool IsForcedInterpreterNeededForResolution(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForResolution(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (!IsDebuggerActive()) {
return false;
@@ -596,7 +594,7 @@
// Indicates whether we need to force the use of instrumentation entrypoint when calling
// a method through the resolution trampoline. This allows to deoptimize the stack for
// debugging when we returned from the called method.
- static bool IsForcedInstrumentationNeededForResolution(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInstrumentationNeededForResolution(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (!IsDebuggerActive()) {
return false;
@@ -607,7 +605,7 @@
// Indicates whether we need to force the use of interpreter when returning from the
// interpreter into the runtime. This allows to deoptimize the stack and continue
// execution with interpreter for debugging.
- static bool IsForcedInterpreterNeededForUpcall(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForUpcall(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (!IsDebuggerActive()) {
return false;
@@ -709,7 +707,7 @@
static JDWP::FieldId ToFieldId(const ArtField* f)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static void SetJdwpLocation(JDWP::JdwpLocation* location, mirror::ArtMethod* m, uint32_t dex_pc)
+ static void SetJdwpLocation(JDWP::JdwpLocation* location, ArtMethod* m, uint32_t dex_pc)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static JDWP::JdwpState* GetJdwpState();
@@ -733,7 +731,7 @@
static void PostThreadStartOrStop(Thread*, uint32_t)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static void PostLocationEvent(mirror::ArtMethod* method, int pcOffset,
+ static void PostLocationEvent(ArtMethod* method, int pcOffset,
mirror::Object* thisPtr, int eventFlags,
const JValue* return_value)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
@@ -745,16 +743,16 @@
EXCLUSIVE_LOCKS_REQUIRED(Locks::deoptimization_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static bool IsForcedInterpreterNeededForCallingImpl(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForCallingImpl(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static bool IsForcedInterpreterNeededForResolutionImpl(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForResolutionImpl(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static bool IsForcedInstrumentationNeededForResolutionImpl(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInstrumentationNeededForResolutionImpl(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static bool IsForcedInterpreterNeededForUpcallImpl(Thread* thread, mirror::ArtMethod* m)
+ static bool IsForcedInterpreterNeededForUpcallImpl(Thread* thread, ArtMethod* m)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static AllocRecord* recent_allocation_records_ PT_GUARDED_BY(Locks::alloc_tracker_lock_);