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

Issue 10692107: Add forward iterator to iterate instructions inside a basic block. (Closed)

Created:
8 years, 5 months ago by Florian Schneider
Modified:
8 years, 5 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add forward iterator to iterate instructions inside a basic block. It is currently only used in SSA renaming. Committed: https://code.google.com/p/dart/source/detail?r=9438

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 3

Patch Set 3 : added another use of the iterator #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -62 lines) Patch
M vm/flow_graph_allocator.cc View 1 2 2 chunks +2 lines, -4 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 2 3 chunks +3 lines, -7 lines 0 comments Download
M vm/il_printer.cc View 1 2 3 2 chunks +18 lines, -16 lines 0 comments Download
M vm/intermediate_language.h View 1 2 2 chunks +50 lines, -4 lines 0 comments Download
M vm/intermediate_language.cc View 1 2 1 chunk +0 lines, -31 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Florian Schneider
8 years, 5 months ago (2012-07-06 10:30:29 UTC) #1
Kevin Millikin (Google)
https://chromiumcodereview.appspot.com/10692107/diff/1/vm/intermediate_language.cc File vm/intermediate_language.cc (right): https://chromiumcodereview.appspot.com/10692107/diff/1/vm/intermediate_language.cc#newcode530 vm/intermediate_language.cc:530: Instruction* Instruction::RemoveFromGraph(RemoveReturnValue ret) { Do you think we could ...
8 years, 5 months ago (2012-07-06 10:44:29 UTC) #2
Florian Schneider
Addressed comments. I used the iterator in two more places. I'll add a backward iterator ...
8 years, 5 months ago (2012-07-06 11:38:38 UTC) #3
Kevin Millikin (Google)
LGTM if you address or choose to ignore the small issue noted below. https://chromiumcodereview.appspot.com/10692107/diff/6001/vm/il_printer.cc File ...
8 years, 5 months ago (2012-07-06 11:58:42 UTC) #4
Florian Schneider
8 years, 5 months ago (2012-07-06 12:31:51 UTC) #5
https://chromiumcodereview.appspot.com/10692107/diff/6001/vm/il_printer.cc
File vm/il_printer.cc (right):

https://chromiumcodereview.appspot.com/10692107/diff/6001/vm/il_printer.cc#ne...
vm/il_printer.cc:43: ForwardInstructionIterator it(block_order_[i]);
On 2012/07/06 11:58:42, kmillikin wrote:
> I'm a bit uncomfortable with calling Current() on an iterator that is Done()
--
> it seems ill defined and relies on implementation details.  We could try:
> 
> Instruction* current = block_order_[i];
> for (ForwardInstructionIterator it(current), !id.Done(), it.Advance()) {
>   current = it.Current();
>   // ...
> }
> if (current->successor() != NULL) {
>   ASSERT(current->successor()->IsBlockEntry());
>   OS::Print(" goto %d", current->successor()->AsBlockEntry()->block_id());
> }
> 
> Is that equivalent?

Done.

Powered by Google App Engine
This is Rietveld 408576698