| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |