summaryrefslogtreecommitdiff
path: root/runtime/fault_handler.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-04-22 13:56:20 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-05-29 18:45:49 -0700
commite401d146407d61eeb99f8d6176b2ac13c4df1e33 (patch)
tree17927f9bfe7d2041b5942c89832d55f9dedb24c5 /runtime/fault_handler.cc
parent2006b7b9b8e32722bd0d640c62549d8a0ac624b6 (diff)
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
Diffstat (limited to 'runtime/fault_handler.cc')
-rw-r--r--runtime/fault_handler.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc
index 83f3ae1c87..4a352ddf9a 100644
--- a/runtime/fault_handler.cc
+++ b/runtime/fault_handler.cc
@@ -19,8 +19,9 @@
#include <setjmp.h>
#include <sys/mman.h>
#include <sys/ucontext.h>
+
+#include "art_method-inl.h"
#include "base/stl_util.h"
-#include "mirror/art_method.h"
#include "mirror/class.h"
#include "sigchain.h"
#include "thread-inl.h"
@@ -321,7 +322,7 @@ bool FaultManager::IsInGeneratedCode(siginfo_t* siginfo, void* context, bool che
return false;
}
- mirror::ArtMethod* method_obj = 0;
+ ArtMethod* method_obj = 0;
uintptr_t return_pc = 0;
uintptr_t sp = 0;
@@ -331,6 +332,7 @@ bool FaultManager::IsInGeneratedCode(siginfo_t* siginfo, void* context, bool che
// If we don't have a potential method, we're outta here.
VLOG(signals) << "potential method: " << method_obj;
+ // TODO: Check linear alloc and image.
if (method_obj == 0 || !IsAligned<kObjectAlignment>(method_obj)) {
VLOG(signals) << "no method";
return false;
@@ -341,7 +343,7 @@ bool FaultManager::IsInGeneratedCode(siginfo_t* siginfo, void* context, bool che
// Check that the class pointer inside the object is not null and is aligned.
// TODO: Method might be not a heap address, and GetClass could fault.
// No read barrier because method_obj may not be a real object.
- mirror::Class* cls = method_obj->GetClass<kVerifyNone, kWithoutReadBarrier>();
+ mirror::Class* cls = method_obj->GetDeclaringClassNoBarrier();
if (cls == nullptr) {
VLOG(signals) << "not a class";
return false;
@@ -357,12 +359,6 @@ bool FaultManager::IsInGeneratedCode(siginfo_t* siginfo, void* context, bool che
return false;
}
- // Now make sure the class is a mirror::ArtMethod.
- if (!cls->IsArtMethodClass()) {
- VLOG(signals) << "not a method";
- return false;
- }
-
// We can be certain that this is a method now. Check if we have a GC map
// at the return PC address.
if (true || kIsDebugBuild) {
@@ -418,16 +414,14 @@ bool JavaStackTraceHandler::Action(int sig, siginfo_t* siginfo, void* context) {
#endif
if (in_generated_code) {
LOG(ERROR) << "Dumping java stack trace for crash in generated code";
- mirror::ArtMethod* method = nullptr;
+ ArtMethod* method = nullptr;
uintptr_t return_pc = 0;
uintptr_t sp = 0;
Thread* self = Thread::Current();
manager_->GetMethodAndReturnPcAndSp(siginfo, context, &method, &return_pc, &sp);
// Inside of generated code, sp[0] is the method, so sp is the frame.
- StackReference<mirror::ArtMethod>* frame =
- reinterpret_cast<StackReference<mirror::ArtMethod>*>(sp);
- self->SetTopOfStack(frame);
+ self->SetTopOfStack(reinterpret_cast<ArtMethod**>(sp));
#ifdef TEST_NESTED_SIGNAL
// To test the nested signal handler we raise a signal here. This will cause the
// nested signal handler to be called and perform a longjmp back to the setjmp