diff options
author | 2014-03-31 09:15:30 +0000 | |
---|---|---|
committer | 2014-03-31 09:15:31 +0000 | |
commit | 7f466c08888129a9923cb973a4dc73ee4a71574e (patch) | |
tree | 6119b98fce1ca8754acaa01ae89677b24782fbff /compiler/optimizing/builder.cc | |
parent | dd3c9a0f4bf07f3347b2ef25e795492abaaaecde (diff) | |
parent | 8ccc3f5d06fd217cdaabd37e743adab2031d3720 (diff) |
Merge "Add support for invoke-static in optimizing compiler."
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 39535e953b..db77feef63 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -16,10 +16,12 @@ */ #include "dex_file.h" +#include "dex_file-inl.h" #include "dex_instruction.h" #include "dex_instruction-inl.h" #include "builder.h" #include "nodes.h" +#include "primitive.h" namespace art { @@ -192,6 +194,23 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ break; } + case Instruction::INVOKE_STATIC: { + uint32_t method_idx = instruction.VRegB_35c(); + const DexFile::MethodId& method_id = dex_file_->GetMethodId(method_idx); + uint32_t return_type_idx = dex_file_->GetProtoId(method_id.proto_idx_).return_type_idx_; + const char* descriptor = dex_file_->StringByTypeIdx(return_type_idx); + const size_t number_of_arguments = instruction.VRegA_35c(); + if (number_of_arguments != 0) { + return false; + } + if (Primitive::GetType(descriptor[0]) != Primitive::kPrimVoid) { + return false; + } + current_block_->AddInstruction(new (arena_) HInvokeStatic( + arena_, number_of_arguments, dex_offset, method_idx)); + break; + } + case Instruction::NOP: break; |