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

Side by Side Diff: src/snapshot/deserializer.cc

Issue 2088223002: [heap] Modernize all *Page iterators to be proper C++ iterators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unify w/ LargePageIterator Created 4 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 unified diff | Download patch
« no previous file with comments | « src/heap/spaces-inl.h ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/snapshot/deserializer.h" 5 #include "src/snapshot/deserializer.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/external-reference-table.h" 8 #include "src/external-reference-table.h"
9 #include "src/heap/heap.h" 9 #include "src/heap/heap.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 13 matching lines...) Expand all
24 reservations_[current_space].Add({r.chunk_size(), NULL, NULL}); 24 reservations_[current_space].Add({r.chunk_size(), NULL, NULL});
25 if (r.is_last()) current_space++; 25 if (r.is_last()) current_space++;
26 } 26 }
27 DCHECK_EQ(kNumberOfSpaces, current_space); 27 DCHECK_EQ(kNumberOfSpaces, current_space);
28 for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) current_chunk_[i] = 0; 28 for (int i = 0; i < kNumberOfPreallocatedSpaces; i++) current_chunk_[i] = 0;
29 } 29 }
30 30
31 void Deserializer::FlushICacheForNewIsolate() { 31 void Deserializer::FlushICacheForNewIsolate() {
32 DCHECK(!deserializing_user_code_); 32 DCHECK(!deserializing_user_code_);
33 // The entire isolate is newly deserialized. Simply flush all code pages. 33 // The entire isolate is newly deserialized. Simply flush all code pages.
34 PageIterator it(isolate_->heap()->code_space()); 34 for (Page* p : *isolate_->heap()->code_space()) {
35 while (it.has_next()) {
36 Page* p = it.next();
37 Assembler::FlushICache(isolate_, p->area_start(), 35 Assembler::FlushICache(isolate_, p->area_start(),
38 p->area_end() - p->area_start()); 36 p->area_end() - p->area_start());
39 } 37 }
40 } 38 }
41 39
42 void Deserializer::FlushICacheForNewCodeObjects() { 40 void Deserializer::FlushICacheForNewCodeObjects() {
43 DCHECK(deserializing_user_code_); 41 DCHECK(deserializing_user_code_);
44 for (Code* code : new_code_objects_) { 42 for (Code* code : new_code_objects_) {
45 if (FLAG_serialize_age_code) code->PreAge(isolate_); 43 if (FLAG_serialize_age_code) code->PreAge(isolate_);
46 Assembler::FlushICache(isolate_, code->instruction_start(), 44 Assembler::FlushICache(isolate_, code->instruction_start(),
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 805
808 default: 806 default:
809 CHECK(false); 807 CHECK(false);
810 } 808 }
811 } 809 }
812 CHECK_EQ(limit, current); 810 CHECK_EQ(limit, current);
813 return true; 811 return true;
814 } 812 }
815 } // namespace internal 813 } // namespace internal
816 } // namespace v8 814 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces-inl.h ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698