Commit b2564755 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

It should break out while loop once page_has_scan_on_scavenge_flag is found,...

It should break out while loop once page_has_scan_on_scavenge_flag is found, there is no need check all of the items in the list.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/23597017

Patch from Bangfu Tao <bangfu.tao@samsung.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f5f47208
......@@ -170,7 +170,10 @@ void StoreBuffer::EnsureSpace(intptr_t space_needed) {
PointerChunkIterator it(heap_);
MemoryChunk* chunk;
while ((chunk = it.next()) != NULL) {
if (chunk->scan_on_scavenge()) page_has_scan_on_scavenge_flag = true;
if (chunk->scan_on_scavenge()) {
page_has_scan_on_scavenge_flag = true;
break;
}
}
if (page_has_scan_on_scavenge_flag) {
......@@ -279,7 +282,10 @@ bool StoreBuffer::PrepareForIteration() {
MemoryChunk* chunk;
bool page_has_scan_on_scavenge_flag = false;
while ((chunk = it.next()) != NULL) {
if (chunk->scan_on_scavenge()) page_has_scan_on_scavenge_flag = true;
if (chunk->scan_on_scavenge()) {
page_has_scan_on_scavenge_flag = true;
break;
}
}
if (page_has_scan_on_scavenge_flag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment