summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-04-04 18:02:04 -0700
committerMathieu Chartier <mathieuc@google.com>2014-04-04 18:02:04 -0700
commit389e11db6ef350b806f7a3f0d7b7df23b0ab6e0c (patch)
treefdeb0bd312f57bc57c244658660e00cc23453c45
parent818b4cf753d6e8a294f0fbe2e3bd9168eea9f762 (diff)
downloadart-389e11db6ef350b806f7a3f0d7b7df23b0ab6e0c.zip
art-389e11db6ef350b806f7a3f0d7b7df23b0ab6e0c.tar.gz
art-389e11db6ef350b806f7a3f0d7b7df23b0ab6e0c.tar.bz2
Revert "Inlining synthetic accessors."
This reverts commit 505ebb0e7b42e7facc8354515b06333ee8b84b10.
-rw-r--r--compiler/dex/quick/dex_file_method_inliner.cc12
-rw-r--r--runtime/quick/inline_method_analyser.cc28
-rw-r--r--runtime/quick/inline_method_analyser.h4
3 files changed, 10 insertions, 34 deletions
diff --git a/compiler/dex/quick/dex_file_method_inliner.cc b/compiler/dex/quick/dex_file_method_inliner.cc
index 06eff4e..2d738c5 100644
--- a/compiler/dex/quick/dex_file_method_inliner.cc
+++ b/compiler/dex/quick/dex_file_method_inliner.cc
@@ -647,11 +647,7 @@ bool DexFileMethodInliner::GenInlineIGet(MIRGraph* mir_graph, BasicBlock* bb, MI
bool object_is_this = (data.method_is_static == 0u && data.object_arg == 0u);
if (!object_is_this) {
// TODO: Implement inlining of IGET on non-"this" registers (needs correct stack trace for NPE).
- // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
- if (!InlineMethodAnalyser::IsSyntheticAccessor(
- mir_graph->GetMethodLoweringInfo(invoke).GetTargetMethod())) {
- return false;
- }
+ return false;
}
if (object_is_this) {
@@ -710,11 +706,7 @@ bool DexFileMethodInliner::GenInlineIPut(MIRGraph* mir_graph, BasicBlock* bb, MI
bool object_is_this = (data.method_is_static == 0u && data.object_arg == 0u);
if (!object_is_this) {
// TODO: Implement inlining of IPUT on non-"this" registers (needs correct stack trace for NPE).
- // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
- if (!InlineMethodAnalyser::IsSyntheticAccessor(
- mir_graph->GetMethodLoweringInfo(invoke).GetTargetMethod())) {
- return false;
- }
+ return false;
}
if (object_is_this) {
diff --git a/runtime/quick/inline_method_analyser.cc b/runtime/quick/inline_method_analyser.cc
index 8bd8dba..0a1b72e 100644
--- a/runtime/quick/inline_method_analyser.cc
+++ b/runtime/quick/inline_method_analyser.cc
@@ -135,12 +135,6 @@ bool InlineMethodAnalyser::AnalyseMethodCode(verifier::MethodVerifier* verifier,
}
}
-bool InlineMethodAnalyser::IsSyntheticAccessor(MethodReference ref) {
- const DexFile::MethodId& method_id = ref.dex_file->GetMethodId(ref.dex_method_index);
- const char* method_name = ref.dex_file->GetMethodName(method_id);
- return strncmp(method_name, "access$", strlen("access$")) == 0;
-}
-
bool InlineMethodAnalyser::AnalyseReturnMethod(const DexFile::CodeItem* code_item,
InlineMethod* result) {
const Instruction* return_instruction = Instruction::At(code_item->insns_);
@@ -232,11 +226,8 @@ bool InlineMethodAnalyser::AnalyseIGetMethod(verifier::MethodVerifier* verifier,
}
if ((verifier->GetAccessFlags() & kAccStatic) != 0u || object_arg != 0u) {
- // TODO: Implement inlining of IGET on non-"this" registers (needs correct stack trace for NPE).
- // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
- if (!IsSyntheticAccessor(verifier->GetMethodReference())) {
- return false;
- }
+ // TODO: Support inlining IGET on other register than "this".
+ return false;
}
// InlineIGetIPutData::object_arg is only 4 bits wide.
@@ -253,9 +244,9 @@ bool InlineMethodAnalyser::AnalyseIGetMethod(verifier::MethodVerifier* verifier,
result->opcode = kInlineOpIGet;
result->flags = kInlineSpecial;
data->op_variant = IGetVariant(opcode);
- data->method_is_static = (verifier->GetAccessFlags() & kAccStatic) != 0u ? 1u : 0u;
+ data->method_is_static = (verifier->GetAccessFlags() & kAccStatic) != 0 ? 1u : 0u;
data->object_arg = object_arg; // Allow IGET on any register, not just "this".
- data->src_arg = 0u;
+ data->src_arg = 0;
data->return_arg_plus1 = 0u;
}
return true;
@@ -296,12 +287,9 @@ bool InlineMethodAnalyser::AnalyseIPutMethod(verifier::MethodVerifier* verifier,
uint32_t object_arg = object_reg - arg_start;
uint32_t src_arg = src_reg - arg_start;
- if ((verifier->GetAccessFlags() & kAccStatic) != 0u || object_arg != 0u) {
- // TODO: Implement inlining of IPUT on non-"this" registers (needs correct stack trace for NPE).
- // Allow synthetic accessors. We don't care about losing their stack frame in NPE.
- if (!IsSyntheticAccessor(verifier->GetMethodReference())) {
- return false;
- }
+ if ((verifier->GetAccessFlags() & kAccStatic) != 0 || object_arg != 0) {
+ // TODO: Support inlining IPUT on other register than "this".
+ return false;
}
// InlineIGetIPutData::object_arg/src_arg/return_arg_plus1 are each only 4 bits wide.
@@ -320,7 +308,7 @@ bool InlineMethodAnalyser::AnalyseIPutMethod(verifier::MethodVerifier* verifier,
result->opcode = kInlineOpIPut;
result->flags = kInlineSpecial;
data->op_variant = IPutVariant(opcode);
- data->method_is_static = (verifier->GetAccessFlags() & kAccStatic) != 0u ? 1u : 0u;
+ data->method_is_static = (verifier->GetAccessFlags() & kAccStatic) != 0 ? 1u : 0u;
data->object_arg = object_arg; // Allow IPUT on any register, not just "this".
data->src_arg = src_arg;
data->return_arg_plus1 = return_arg_plus1;
diff --git a/runtime/quick/inline_method_analyser.h b/runtime/quick/inline_method_analyser.h
index ddee89b..277a01e 100644
--- a/runtime/quick/inline_method_analyser.h
+++ b/runtime/quick/inline_method_analyser.h
@@ -21,7 +21,6 @@
#include "base/mutex.h"
#include "dex_file.h"
#include "dex_instruction.h"
-#include "method_reference.h"
/*
* NOTE: This code is part of the quick compiler. It lives in the runtime
@@ -157,9 +156,6 @@ class InlineMethodAnalyser {
return opcode - Instruction::IPUT;
}
- // Determines whether the method is a synthetic accessor (method name starts with "access$").
- static bool IsSyntheticAccessor(MethodReference ref);
-
private:
static bool AnalyseReturnMethod(const DexFile::CodeItem* code_item, InlineMethod* result);
static bool AnalyseConstMethod(const DexFile::CodeItem* code_item, InlineMethod* result);