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

Issue 555072: Merge ObjectIterator::has_next and ObjectIterator::next methods.... (Closed)

Created:
10 years, 11 months ago by antonm
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

Merge ObjectIterator::has_next and ObjectIterator::next methods. This reduces chances of improper usage, see http://code.google.com/p/v8/issues/detail?id=586 for more details. BUG=586 Committed: http://code.google.com/p/v8/source/detail?r=3696

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -171 lines) Patch
M src/debug.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M src/heap.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/heap.cc View 1 9 chunks +27 lines, -29 lines 0 comments Download
M src/heap-profiler.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M src/log.cc View 1 3 chunks +3 lines, -9 lines 0 comments Download
M src/mark-compact.cc View 1 2 12 chunks +22 lines, -21 lines 0 comments Download
M src/runtime.cc View 1 4 chunks +8 lines, -9 lines 0 comments Download
M src/spaces.h View 7 chunks +21 lines, -17 lines 0 comments Download
M src/spaces.cc View 1 13 chunks +21 lines, -22 lines 0 comments Download
M src/spaces-inl.h View 1 chunk +0 lines, -26 lines 0 comments Download
M test/cctest/test-api.cc View 1 3 chunks +10 lines, -19 lines 0 comments Download
M test/cctest/test-debug.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M test/cctest/test-heap.cc View 1 1 chunk +1 line, -4 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
antonm
Just FYI. I tried to unify PageIterator, but there are couple of places where has_next ...
10 years, 11 months ago (2010-01-25 10:17:12 UTC) #1
Søren Thygesen Gjesse
LGTM with a style comment: In the V8 code base we always have explicit check ...
10 years, 11 months ago (2010-01-25 13:01:40 UTC) #2
Søren Thygesen Gjesse
10 years, 11 months ago (2010-01-25 13:39:20 UTC) #3
On 2010/01/25 13:01:40, Søren Gjesse wrote:
> LGTM with a style comment:
> 
> In the V8 code base we always have explicit check against NULL, so
> 
>   while (HeapObject* obj = it.next()) {
> 
> needs to be 
> 
>   while ((HeapObject* obj = it.next()) != NULL) {

As the while with != NULL check requires hoisting the declaration of obj out of
the while scope using a for loop

  for (HeapObject* obj = it.next(); obj != NULL; obj = it.next()) {

is probably the best choice.

Powered by Google App Engine
This is Rietveld 408576698