diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-03 18:49:58 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-04 09:59:06 +0100 |
commit | 2e7038ac5848468740d6a419434d3dde8c585a53 (patch) | |
tree | 465940d5cc57b28c4f5b5ad588f6d86ee72097ed /compiler/optimizing/builder.cc | |
parent | a7b2826fa469c626ff2c3ff26fd848c28bccc092 (diff) | |
download | art-2e7038ac5848468740d6a419434d3dde8c585a53.zip art-2e7038ac5848468740d6a419434d3dde8c585a53.tar.gz art-2e7038ac5848468740d6a419434d3dde8c585a53.tar.bz2 |
Add support for new-instance and invoke-direct.
Change-Id: I2daed646904f7711972a7da15d88be7573426932
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 0554876..d90405a 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -193,7 +193,8 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ break; } - case Instruction::INVOKE_STATIC: { + case Instruction::INVOKE_STATIC: + case Instruction::INVOKE_DIRECT: { 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_; @@ -204,6 +205,7 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ return false; } + // Treat invoke-direct like static calls for now. HInvokeStatic* invoke = new (arena_) HInvokeStatic( arena_, number_of_arguments, dex_offset, method_idx); @@ -221,7 +223,8 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ break; } - case Instruction::INVOKE_STATIC_RANGE: { + case Instruction::INVOKE_STATIC_RANGE: + case Instruction::INVOKE_DIRECT_RANGE: { uint32_t method_idx = instruction.VRegB_3rc(); 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_; @@ -232,6 +235,7 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ return false; } + // Treat invoke-direct like static calls for now. HInvokeStatic* invoke = new (arena_) HInvokeStatic( arena_, number_of_arguments, dex_offset, method_idx); int32_t register_index = instruction.VRegC(); @@ -277,6 +281,13 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ break; } + case Instruction::NEW_INSTANCE: { + current_block_->AddInstruction( + new (arena_) HNewInstance(dex_offset, instruction.VRegB_21c())); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); + break; + } + case Instruction::NOP: break; |