summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_switch_impl.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-08 15:35:22 -0700
committerIan Rogers <irogers@google.com>2014-10-08 16:00:31 -0700
commit832336b3c9eb892045a8de1bb12c9361112ca3c5 (patch)
tree0e8696869a28ee0dee34d130b586b1bf6f072d6e /runtime/interpreter/interpreter_switch_impl.cc
parentf1f05d303988a5c071c87b760056be8358276c94 (diff)
downloadandroid_art-832336b3c9eb892045a8de1bb12c9361112ca3c5.tar.gz
android_art-832336b3c9eb892045a8de1bb12c9361112ca3c5.tar.bz2
android_art-832336b3c9eb892045a8de1bb12c9361112ca3c5.zip
Don't copy fill array data to quick literal pool.
Currently quick copies the fill array data from the dex file to the literal pool. It then has to go through hoops to pass this PC relative address down to out-of-line code. Instead, pass the offset of the table to the out-of-line code and use the CodeItem data associated with the ArtMethod. This reduces the size of oat code while greatly simplifying it. Unify the FillArrayData implementation in quick, portable and the interpreters. Change-Id: I9c6971cf46285fbf197856627368c0185fdc98ca
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl.cc')
-rw-r--r--runtime/interpreter/interpreter_switch_impl.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index c6cef6a648..fe0af27f00 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -484,30 +484,18 @@ JValue ExecuteSwitchImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem
}
case Instruction::FILL_ARRAY_DATA: {
PREAMBLE();
- Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
- if (UNLIKELY(obj == NULL)) {
- ThrowNullPointerException(NULL, "null array in FILL_ARRAY_DATA");
- HANDLE_PENDING_EXCEPTION();
- break;
- }
- Array* array = obj->AsArray();
- DCHECK(array->IsArrayInstance() && !array->IsObjectArray());
const uint16_t* payload_addr = reinterpret_cast<const uint16_t*>(inst) + inst->VRegB_31t();
const Instruction::ArrayDataPayload* payload =
reinterpret_cast<const Instruction::ArrayDataPayload*>(payload_addr);
- if (UNLIKELY(static_cast<int32_t>(payload->element_count) > array->GetLength())) {
- self->ThrowNewExceptionF(shadow_frame.GetCurrentLocationForThrow(),
- "Ljava/lang/ArrayIndexOutOfBoundsException;",
- "failed FILL_ARRAY_DATA; length=%d, index=%d",
- array->GetLength(), payload->element_count);
+ Object* obj = shadow_frame.GetVRegReference(inst->VRegA_31t(inst_data));
+ bool success = FillArrayData(obj, payload);
+ if (!success) {
HANDLE_PENDING_EXCEPTION();
break;
}
if (transaction_active) {
- RecordArrayElementsInTransaction(array, payload->element_count);
+ RecordArrayElementsInTransaction(obj->AsArray(), payload->element_count);
}
- uint32_t size_in_bytes = payload->element_count * payload->element_width;
- memcpy(array->GetRawData(payload->element_width, 0), payload->data, size_in_bytes);
inst = inst->Next_3xx();
break;
}