Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10808008: Revert "Introduce Goto instructions to the flow graph." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index f250a5761ff8a421ae53a4f3974c22043f6e1634..8cc93e3e980e69d44179ac9d65a0f14058d86dec 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -258,22 +258,6 @@ void ThrowInstr::SetInputAt(intptr_t i, Value* value) {
}
-intptr_t GotoInstr::InputCount() const {
- return 0;
-}
-
-
-Value* GotoInstr::InputAt(intptr_t i) const {
- UNREACHABLE();
- return NULL;
-}
-
-
-void GotoInstr::SetInputAt(intptr_t i, Value* value) {
- UNREACHABLE();
-}
-
-
intptr_t ReturnInstr::InputCount() const {
return 1;
}
@@ -503,9 +487,7 @@ void BlockEntryInstr::DiscoverBlocks(
!next_instr->IsBranch()) {
if (vars != NULL) next_instr->RecordAssignedVars(vars);
set_last_instruction(next_instr);
- GotoInstr* goto_instr = next_instr->AsGoto();
- next_instr =
- (goto_instr != NULL) ? goto_instr->successor() : next_instr->next();
+ next_instr = next_instr->next();
}
}
if (next_instr != NULL) {
@@ -557,15 +539,13 @@ void JoinEntryInstr::InsertPhi(intptr_t var_index, intptr_t var_count) {
intptr_t Instruction::SuccessorCount() const {
- return 0;
+ ASSERT(next() == NULL || next()->IsBlockEntry());
+ return (next() != NULL) ? 1 : 0;
}
BlockEntryInstr* Instruction::SuccessorAt(intptr_t index) const {
- // Called only if index is in range. Only control-transfer instructions
- // can have non-zero successor counts and they override this function.
- UNREACHABLE();
- return NULL;
+ return next()->AsBlockEntry();
}
@@ -593,22 +573,6 @@ BlockEntryInstr* BranchInstr::SuccessorAt(intptr_t index) const {
}
-intptr_t GotoInstr::SuccessorCount() const {
- return 1;
-}
-
-
-BlockEntryInstr* GotoInstr::SuccessorAt(intptr_t index) const {
- ASSERT(index == 0);
- return successor();
-}
-
-
-void Instruction::Goto(JoinEntryInstr* entry) {
- set_next(new GotoInstr(entry));
-}
-
-
// ==== Support for propagating static type.
RawAbstractType* ConstantVal::StaticType() const {
if (value().IsInstance()) {
@@ -1023,20 +987,6 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* GotoInstr::MakeLocationSummary() const {
- return new LocationSummary(0, 0);
-}
-
-
-void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- // We can fall through if the successor is the next block in the list.
- // Otherwise, we need a jump.
- if (!compiler->IsNextBlock(successor())) {
- __ jmp(compiler->GetBlockLabel(successor()));
- }
-}
-
-
LocationSummary* BranchInstr::MakeLocationSummary() const {
if (is_fused_with_comparison()) {
return fused_with_comparison_->locs();
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698