diff options
author | 2016-01-07 15:42:47 +0000 | |
---|---|---|
committer | 2016-01-26 10:23:06 -0800 | |
commit | 9724c636467d56632a45fdf6353e3d57d1925501 (patch) | |
tree | f28f6ff8146088eef28405a55a7f6ab517120ae0 /compiler/dex/quick/quick_compiler.cc | |
parent | 4fe6ce5f48687cf24c91ac9865dbad497ed6c074 (diff) |
Enable interface default methods by default.
This also enables interface static methods.
This removes the -Xexperimental:default-methods flag and all places
where we explicitly check for its presence.
Bug: 24618811
Change-Id: Icd91e377bd6e1a45a1645f810d15de1b0312e31d
Diffstat (limited to 'compiler/dex/quick/quick_compiler.cc')
-rw-r--r-- | compiler/dex/quick/quick_compiler.cc | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc index ebc9a2c9ea..027290f9b1 100644 --- a/compiler/dex/quick/quick_compiler.cc +++ b/compiler/dex/quick/quick_compiler.cc @@ -486,11 +486,6 @@ static const size_t kUnsupportedOpcodesSize[] = { static_assert(sizeof(kUnsupportedOpcodesSize) == 8 * sizeof(size_t), "kUnsupportedOpcodesSize unexpected"); -static bool IsUnsupportedExperimentalLambdasOnly(size_t i) { - DCHECK_LE(i, arraysize(kUnsupportedOpcodes)); - return kUnsupportedOpcodes[i] == kUnsupportedLambdaOpcodes; -} - // The maximum amount of Dalvik register in a method for which we will start compiling. Tries to // avoid an abort when we need to manage more SSA registers than we can. static constexpr size_t kMaxAllowedDalvikRegisters = INT16_MAX / 2; @@ -513,36 +508,6 @@ static bool CanCompileShorty(const char* shorty, InstructionSet instruction_set) return true; } -// If the ISA has unsupported opcodes, should we skip scanning over them? -// -// Most of the time we're compiling non-experimental files, so scanning just slows -// performance down by as much as 6% with 4 threads. -// In the rare cases we compile experimental opcodes, the runtime has an option to enable it, -// which will force scanning for any unsupported opcodes. -static bool SkipScanningUnsupportedOpcodes(InstructionSet instruction_set) { - Runtime* runtime = Runtime::Current(); - if (UNLIKELY(runtime->AreExperimentalFlagsEnabled(ExperimentalFlags::kDefaultMethods))) { - // Always need to scan opcodes if we have default methods since invoke-super for interface - // methods is never going to be supported in the quick compiler. - return false; - } else if (UNLIKELY(kUnsupportedOpcodesSize[instruction_set] == 0U)) { - // All opcodes are supported no matter what. Usually not the case - // since experimental opcodes are not implemented in the quick compiler. - return true; - } else if (LIKELY(!Runtime::Current()-> - AreExperimentalFlagsEnabled(ExperimentalFlags::kLambdas))) { - // Experimental opcodes are disabled. - // - // If all unsupported opcodes are experimental we don't need to do scanning. - return IsUnsupportedExperimentalLambdasOnly(instruction_set); - } else { - // Experimental opcodes are enabled. - // - // Do the opcode scanning if the ISA has any unsupported opcodes. - return false; - } -} - bool QuickCompiler::CanCompileInstruction(const MIR* mir, const DexFile& dex_file) const { switch (mir->dalvikInsn.opcode) { @@ -572,11 +537,8 @@ bool QuickCompiler::CanCompileMethod(uint32_t method_idx, return false; } - // Check whether we do have limitations at all. - if (kSupportedTypes[cu->instruction_set] == nullptr && - SkipScanningUnsupportedOpcodes(cu->instruction_set)) { - return true; - } + // Since the quick compiler doesn't (and never will) support default methods we always need to + // scan opcodes. // Check if we can compile the prototype. const char* shorty = dex_file.GetMethodShorty(dex_file.GetMethodId(method_idx)); |