summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-09-09 13:51:09 -0700
committerMathieu Chartier <mathieuc@google.com>2014-09-09 13:51:09 -0700
commitcd48f2d86197d4fe87cc88077bc4af5ba66e5295 (patch)
treea678a9eafd72d80cb6d7581b99cc11bc9cf64911 /compiler
parent5bc47ebe278af65e8e2a2d6b603ac94a020285f7 (diff)
downloadart-cd48f2d86197d4fe87cc88077bc4af5ba66e5295.zip
art-cd48f2d86197d4fe87cc88077bc4af5ba66e5295.tar.gz
art-cd48f2d86197d4fe87cc88077bc4af5ba66e5295.tar.bz2
Change Reference.get() intrinsic to Reference.getReferent().
The reference intrinsic was incorrectly inlining PhantomReference.get(). We now get around this by adding a layer of indirection. Reference.get() now calls getReferent() which is intrinsified and inlined. Requires: https://android-review.googlesource.com/#/c/107100/ Bug: 17429865 Change-Id: Ie91e70abf43cedf3c707c7bb8a5059e19d2a2577
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dex/quick/dex_file_method_inliner.cc12
-rw-r--r--compiler/dex/quick/dex_file_method_inliner.h2
-rwxr-xr-xcompiler/dex/quick/gen_invoke.cc2
-rw-r--r--compiler/dex/quick/mir_to_lir.h2
4 files changed, 9 insertions, 9 deletions
diff --git a/compiler/dex/quick/dex_file_method_inliner.cc b/compiler/dex/quick/dex_file_method_inliner.cc
index ffcce7d..2523380 100644
--- a/compiler/dex/quick/dex_file_method_inliner.cc
+++ b/compiler/dex/quick/dex_file_method_inliner.cc
@@ -55,7 +55,7 @@ static constexpr bool kIntrinsicIsStatic[] = {
true, // kIntrinsicRint
true, // kIntrinsicRoundFloat
true, // kIntrinsicRoundDouble
- false, // kIntrinsicReferenceGet
+ false, // kIntrinsicReferenceGetReferent
false, // kIntrinsicCharAt
false, // kIntrinsicCompareTo
false, // kIntrinsicIsEmptyOrLength
@@ -87,7 +87,7 @@ COMPILE_ASSERT(kIntrinsicIsStatic[kIntrinsicFloor], Floor_must_be_static);
COMPILE_ASSERT(kIntrinsicIsStatic[kIntrinsicRint], Rint_must_be_static);
COMPILE_ASSERT(kIntrinsicIsStatic[kIntrinsicRoundFloat], RoundFloat_must_be_static);
COMPILE_ASSERT(kIntrinsicIsStatic[kIntrinsicRoundDouble], RoundDouble_must_be_static);
-COMPILE_ASSERT(!kIntrinsicIsStatic[kIntrinsicReferenceGet], Get_must_not_be_static);
+COMPILE_ASSERT(!kIntrinsicIsStatic[kIntrinsicReferenceGetReferent], Get_must_not_be_static);
COMPILE_ASSERT(!kIntrinsicIsStatic[kIntrinsicCharAt], CharAt_must_not_be_static);
COMPILE_ASSERT(!kIntrinsicIsStatic[kIntrinsicCompareTo], CompareTo_must_not_be_static);
COMPILE_ASSERT(!kIntrinsicIsStatic[kIntrinsicIsEmptyOrLength], IsEmptyOrLength_must_not_be_static);
@@ -171,7 +171,7 @@ const char* const DexFileMethodInliner::kNameCacheNames[] = {
"floor", // kNameCacheFloor
"rint", // kNameCacheRint
"round", // kNameCacheRound
- "get", // kNameCacheReferenceGet
+ "getReferent", // kNameCacheReferenceGet
"charAt", // kNameCacheCharAt
"compareTo", // kNameCacheCompareTo
"isEmpty", // kNameCacheIsEmpty
@@ -341,7 +341,7 @@ const DexFileMethodInliner::IntrinsicDef DexFileMethodInliner::kIntrinsicMethods
INTRINSIC(JavaLangMath, Round, D_J, kIntrinsicRoundDouble, 0),
INTRINSIC(JavaLangStrictMath, Round, D_J, kIntrinsicRoundDouble, 0),
- INTRINSIC(JavaLangRefReference, ReferenceGet, _Object, kIntrinsicReferenceGet, 0),
+ INTRINSIC(JavaLangRefReference, ReferenceGetReferent, _Object, kIntrinsicReferenceGetReferent, 0),
INTRINSIC(JavaLangString, CharAt, I_C, kIntrinsicCharAt, 0),
INTRINSIC(JavaLangString, CompareTo, String_I, kIntrinsicCompareTo, 0),
@@ -473,8 +473,8 @@ bool DexFileMethodInliner::GenIntrinsic(Mir2Lir* backend, CallInfo* info) {
return backend->GenInlinedRound(info, false /* is_double */);
case kIntrinsicRoundDouble:
return backend->GenInlinedRound(info, true /* is_double */);
- case kIntrinsicReferenceGet:
- return backend->GenInlinedReferenceGet(info);
+ case kIntrinsicReferenceGetReferent:
+ return backend->GenInlinedReferenceGetReferent(info);
case kIntrinsicCharAt:
return backend->GenInlinedCharAt(info);
case kIntrinsicCompareTo:
diff --git a/compiler/dex/quick/dex_file_method_inliner.h b/compiler/dex/quick/dex_file_method_inliner.h
index b875e2b..30a2d90 100644
--- a/compiler/dex/quick/dex_file_method_inliner.h
+++ b/compiler/dex/quick/dex_file_method_inliner.h
@@ -145,7 +145,7 @@ class DexFileMethodInliner {
kNameCacheFloor,
kNameCacheRint,
kNameCacheRound,
- kNameCacheReferenceGet,
+ kNameCacheReferenceGetReferent,
kNameCacheCharAt,
kNameCacheCompareTo,
kNameCacheIsEmpty,
diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc
index 78f5c73..8ce696c 100755
--- a/compiler/dex/quick/gen_invoke.cc
+++ b/compiler/dex/quick/gen_invoke.cc
@@ -1130,7 +1130,7 @@ RegLocation Mir2Lir::InlineTargetWide(CallInfo* info) {
return res;
}
-bool Mir2Lir::GenInlinedReferenceGet(CallInfo* info) {
+bool Mir2Lir::GenInlinedReferenceGetReferent(CallInfo* info) {
if (cu_->instruction_set == kMips) {
// TODO - add Mips implementation
return false;
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h
index d6fc2e9..ea722ab 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -941,7 +941,7 @@ class Mir2Lir : public Backend {
*/
RegLocation InlineTargetWide(CallInfo* info);
- bool GenInlinedReferenceGet(CallInfo* info);
+ bool GenInlinedReferenceGetReferent(CallInfo* info);
virtual bool GenInlinedCharAt(CallInfo* info);
bool GenInlinedStringIsEmptyOrLength(CallInfo* info, bool is_empty);
virtual bool GenInlinedReverseBits(CallInfo* info, OpSize size);