summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter_common.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/interpreter/interpreter_common.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/interpreter/interpreter_common.cc')
-rw-r--r--runtime/interpreter/interpreter_common.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 363c65afc1..1ed1a649b8 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -413,25 +413,19 @@ EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimNot) // iput-objec
#undef EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL
#undef EXPLICIT_DO_IPUT_QUICK_TEMPLATE_DECL
-uint32_t FindNextInstructionFollowingException(Thread* self,
- ShadowFrame& shadow_frame,
- uint32_t dex_pc,
- const instrumentation::Instrumentation* instrumentation) {
+uint32_t FindNextInstructionFollowingException(
+ Thread* self, ShadowFrame& shadow_frame, uint32_t dex_pc,
+ const instrumentation::Instrumentation* instrumentation) {
self->VerifyStack();
- StackHandleScope<3> hs(self);
+ StackHandleScope<2> hs(self);
Handle<mirror::Throwable> exception(hs.NewHandle(self->GetException()));
if (instrumentation->HasExceptionCaughtListeners()
&& self->IsExceptionThrownByCurrentMethod(exception.Get())) {
instrumentation->ExceptionCaughtEvent(self, exception.Get());
}
bool clear_exception = false;
- uint32_t found_dex_pc;
- {
- Handle<mirror::Class> exception_class(hs.NewHandle(exception->GetClass()));
- Handle<mirror::ArtMethod> h_method(hs.NewHandle(shadow_frame.GetMethod()));
- found_dex_pc = mirror::ArtMethod::FindCatchBlock(h_method, exception_class, dex_pc,
- &clear_exception);
- }
+ uint32_t found_dex_pc = shadow_frame.GetMethod()->FindCatchBlock(
+ hs.NewHandle(exception->GetClass()), dex_pc, &clear_exception);
if (found_dex_pc == DexFile::kDexNoIndex) {
// Exception is not caught by the current method. We will unwind to the
// caller. Notify any instrumentation listener.
@@ -651,7 +645,7 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame,
UNREACHABLE();
}
// Force the use of interpreter when it is required by the debugger.
- mirror::EntryPointFromInterpreter* entry;
+ EntryPointFromInterpreter* entry;
if (UNLIKELY(Dbg::IsForcedInterpreterNeededForCalling(self, new_shadow_frame->GetMethod()))) {
entry = &art::artInterpreterToInterpreterBridge;
} else {
@@ -668,7 +662,7 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame,
shadow_frame.SetVRegReference(vregC, result->GetL());
// Overwrite all potential copies of the original result of the new-instance of string with the
// new result of the StringFactory. Use the verifier to find this set of registers.
- mirror::ArtMethod* method = shadow_frame.GetMethod();
+ ArtMethod* method = shadow_frame.GetMethod();
MethodReference method_ref = method->ToMethodReference();
SafeMap<uint32_t, std::set<uint32_t>> string_init_map;
SafeMap<uint32_t, std::set<uint32_t>>* string_init_map_ptr;
@@ -788,13 +782,17 @@ void RecordArrayElementsInTransaction(mirror::Array* array, int32_t count)
RecordArrayElementsInTransactionImpl(array->AsShortArray(), count);
break;
case Primitive::kPrimInt:
- case Primitive::kPrimFloat:
RecordArrayElementsInTransactionImpl(array->AsIntArray(), count);
break;
+ case Primitive::kPrimFloat:
+ RecordArrayElementsInTransactionImpl(array->AsFloatArray(), count);
+ break;
case Primitive::kPrimLong:
- case Primitive::kPrimDouble:
RecordArrayElementsInTransactionImpl(array->AsLongArray(), count);
break;
+ case Primitive::kPrimDouble:
+ RecordArrayElementsInTransactionImpl(array->AsDoubleArray(), count);
+ break;
default:
LOG(FATAL) << "Unsupported primitive type " << primitive_component_type
<< " in fill-array-data";