diff options
| author | 2015-05-28 10:10:24 +0000 | |
|---|---|---|
| committer | 2015-05-28 10:10:24 +0000 | |
| commit | b4e2fbbed28c3bcdb8fd0fee5a201ba78e1edf28 (patch) | |
| tree | 2da8c563cca7c9e7e125819ba3022915dca18ca9 /compiler/optimizing/nodes.cc | |
| parent | 31db3432157caac55584a59827c69b303ba09d13 (diff) | |
| parent | 76b1e1799a713a19218de26b171b0aef48a59e98 (diff) | |
Merge "Add a HCurrentMethod node."
Diffstat (limited to 'compiler/optimizing/nodes.cc')
| -rw-r--r-- | compiler/optimizing/nodes.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 483c09e5a9..80d4b4a863 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -295,6 +295,19 @@ HNullConstant* HGraph::GetNullConstant() { return cached_null_constant_; } +HCurrentMethod* HGraph::GetCurrentMethod() { + if (cached_current_method_ == nullptr) { + cached_current_method_ = new (arena_) HCurrentMethod(); + if (entry_block_->GetFirstInstruction() == nullptr) { + entry_block_->AddInstruction(cached_current_method_); + } else { + entry_block_->InsertInstructionBefore( + cached_current_method_, entry_block_->GetFirstInstruction()); + } + } + return cached_current_method_; +} + HConstant* HGraph::GetConstant(Primitive::Type type, int64_t value) { switch (type) { case Primitive::Type::kPrimBoolean: @@ -1461,6 +1474,8 @@ void HGraph::InlineInto(HGraph* outer_graph, HInvoke* invoke) { DCHECK(parameter_index != last_input_index); } current->ReplaceWith(invoke->InputAt(parameter_index++)); + } else if (current->IsCurrentMethod()) { + current->ReplaceWith(outer_graph->GetCurrentMethod()); } else { DCHECK(current->IsGoto() || current->IsSuspendCheck()); entry_block_->RemoveInstruction(current); |