OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 87 matching lines...) Loading... | |
98 contexts_disposed_(0), | 98 contexts_disposed_(0), |
99 global_ic_age_(0), | 99 global_ic_age_(0), |
100 flush_monomorphic_ics_(false), | 100 flush_monomorphic_ics_(false), |
101 scan_on_scavenge_pages_(0), | 101 scan_on_scavenge_pages_(0), |
102 new_space_(this), | 102 new_space_(this), |
103 old_pointer_space_(NULL), | 103 old_pointer_space_(NULL), |
104 old_data_space_(NULL), | 104 old_data_space_(NULL), |
105 code_space_(NULL), | 105 code_space_(NULL), |
106 map_space_(NULL), | 106 map_space_(NULL), |
107 cell_space_(NULL), | 107 cell_space_(NULL), |
108 js_global_property_cell_space_(NULL), | |
108 lo_space_(NULL), | 109 lo_space_(NULL), |
109 gc_state_(NOT_IN_GC), | 110 gc_state_(NOT_IN_GC), |
110 gc_post_processing_depth_(0), | 111 gc_post_processing_depth_(0), |
111 ms_count_(0), | 112 ms_count_(0), |
112 gc_count_(0), | 113 gc_count_(0), |
113 remembered_unmapped_pages_index_(0), | 114 remembered_unmapped_pages_index_(0), |
114 unflattened_strings_length_(0), | 115 unflattened_strings_length_(0), |
115 #ifdef DEBUG | 116 #ifdef DEBUG |
116 allocation_timeout_(0), | 117 allocation_timeout_(0), |
117 disallow_allocation_failure_(false), | 118 disallow_allocation_failure_(false), |
(...skipping 74 matching lines...) Loading... | |
192 | 193 |
193 | 194 |
194 intptr_t Heap::Capacity() { | 195 intptr_t Heap::Capacity() { |
195 if (!HasBeenSetUp()) return 0; | 196 if (!HasBeenSetUp()) return 0; |
196 | 197 |
197 return new_space_.Capacity() + | 198 return new_space_.Capacity() + |
198 old_pointer_space_->Capacity() + | 199 old_pointer_space_->Capacity() + |
199 old_data_space_->Capacity() + | 200 old_data_space_->Capacity() + |
200 code_space_->Capacity() + | 201 code_space_->Capacity() + |
201 map_space_->Capacity() + | 202 map_space_->Capacity() + |
202 cell_space_->Capacity(); | 203 cell_space_->Capacity() + |
204 js_global_property_cell_space_->Capacity(); | |
203 } | 205 } |
204 | 206 |
205 | 207 |
206 intptr_t Heap::CommittedMemory() { | 208 intptr_t Heap::CommittedMemory() { |
207 if (!HasBeenSetUp()) return 0; | 209 if (!HasBeenSetUp()) return 0; |
208 | 210 |
209 return new_space_.CommittedMemory() + | 211 return new_space_.CommittedMemory() + |
210 old_pointer_space_->CommittedMemory() + | 212 old_pointer_space_->CommittedMemory() + |
211 old_data_space_->CommittedMemory() + | 213 old_data_space_->CommittedMemory() + |
212 code_space_->CommittedMemory() + | 214 code_space_->CommittedMemory() + |
213 map_space_->CommittedMemory() + | 215 map_space_->CommittedMemory() + |
214 cell_space_->CommittedMemory() + | 216 cell_space_->CommittedMemory() + |
217 js_global_property_cell_space_->CommittedMemory() + | |
215 lo_space_->Size(); | 218 lo_space_->Size(); |
216 } | 219 } |
217 | 220 |
218 | 221 |
219 size_t Heap::CommittedPhysicalMemory() { | 222 size_t Heap::CommittedPhysicalMemory() { |
220 if (!HasBeenSetUp()) return 0; | 223 if (!HasBeenSetUp()) return 0; |
221 | 224 |
222 return new_space_.CommittedPhysicalMemory() + | 225 return new_space_.CommittedPhysicalMemory() + |
223 old_pointer_space_->CommittedPhysicalMemory() + | 226 old_pointer_space_->CommittedPhysicalMemory() + |
224 old_data_space_->CommittedPhysicalMemory() + | 227 old_data_space_->CommittedPhysicalMemory() + |
225 code_space_->CommittedPhysicalMemory() + | 228 code_space_->CommittedPhysicalMemory() + |
226 map_space_->CommittedPhysicalMemory() + | 229 map_space_->CommittedPhysicalMemory() + |
227 cell_space_->CommittedPhysicalMemory() + | 230 cell_space_->CommittedPhysicalMemory() + |
231 js_global_property_cell_space_->CommittedPhysicalMemory() + | |
228 lo_space_->CommittedPhysicalMemory(); | 232 lo_space_->CommittedPhysicalMemory(); |
229 } | 233 } |
230 | 234 |
231 | 235 |
232 intptr_t Heap::CommittedMemoryExecutable() { | 236 intptr_t Heap::CommittedMemoryExecutable() { |
233 if (!HasBeenSetUp()) return 0; | 237 if (!HasBeenSetUp()) return 0; |
234 | 238 |
235 return isolate()->memory_allocator()->SizeExecutable(); | 239 return isolate()->memory_allocator()->SizeExecutable(); |
236 } | 240 } |
237 | 241 |
238 | 242 |
239 intptr_t Heap::Available() { | 243 intptr_t Heap::Available() { |
240 if (!HasBeenSetUp()) return 0; | 244 if (!HasBeenSetUp()) return 0; |
241 | 245 |
242 return new_space_.Available() + | 246 return new_space_.Available() + |
243 old_pointer_space_->Available() + | 247 old_pointer_space_->Available() + |
244 old_data_space_->Available() + | 248 old_data_space_->Available() + |
245 code_space_->Available() + | 249 code_space_->Available() + |
246 map_space_->Available() + | 250 map_space_->Available() + |
247 cell_space_->Available(); | 251 cell_space_->Available() + |
252 js_global_property_cell_space_->Available(); | |
248 } | 253 } |
249 | 254 |
250 | 255 |
251 bool Heap::HasBeenSetUp() { | 256 bool Heap::HasBeenSetUp() { |
252 return old_pointer_space_ != NULL && | 257 return old_pointer_space_ != NULL && |
253 old_data_space_ != NULL && | 258 old_data_space_ != NULL && |
254 code_space_ != NULL && | 259 code_space_ != NULL && |
255 map_space_ != NULL && | 260 map_space_ != NULL && |
256 cell_space_ != NULL && | 261 cell_space_ != NULL && |
262 js_global_property_cell_space_ != NULL && | |
257 lo_space_ != NULL; | 263 lo_space_ != NULL; |
258 } | 264 } |
259 | 265 |
260 | 266 |
261 int Heap::GcSafeSizeOfOldObject(HeapObject* object) { | 267 int Heap::GcSafeSizeOfOldObject(HeapObject* object) { |
262 if (IntrusiveMarking::IsMarked(object)) { | 268 if (IntrusiveMarking::IsMarked(object)) { |
263 return IntrusiveMarking::SizeOfMarkedObject(object); | 269 return IntrusiveMarking::SizeOfMarkedObject(object); |
264 } | 270 } |
265 return object->SizeFromMap(object->map()); | 271 return object->SizeFromMap(object->map()); |
266 } | 272 } |
(...skipping 109 matching lines...) Loading... | |
376 ", committed: %6" V8_PTR_PREFIX "d KB\n", | 382 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
377 map_space_->SizeOfObjects() / KB, | 383 map_space_->SizeOfObjects() / KB, |
378 map_space_->Available() / KB, | 384 map_space_->Available() / KB, |
379 map_space_->CommittedMemory() / KB); | 385 map_space_->CommittedMemory() / KB); |
380 PrintPID("Cell space, used: %6" V8_PTR_PREFIX "d KB" | 386 PrintPID("Cell space, used: %6" V8_PTR_PREFIX "d KB" |
381 ", available: %6" V8_PTR_PREFIX "d KB" | 387 ", available: %6" V8_PTR_PREFIX "d KB" |
382 ", committed: %6" V8_PTR_PREFIX "d KB\n", | 388 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
383 cell_space_->SizeOfObjects() / KB, | 389 cell_space_->SizeOfObjects() / KB, |
384 cell_space_->Available() / KB, | 390 cell_space_->Available() / KB, |
385 cell_space_->CommittedMemory() / KB); | 391 cell_space_->CommittedMemory() / KB); |
392 PrintPID("JSGlobalPropertyCell space, used: %6" V8_PTR_PREFIX "d KB" | |
Michael Starzinger
2013/06/12 13:23:25
Can we align this printf() format string so that i
danno
2013/06/12 14:24:28
Done.
| |
393 ", available: %6" V8_PTR_PREFIX "d KB" | |
394 ", committed: %6" V8_PTR_PREFIX "d KB\n", | |
395 js_global_property_cell_space_->SizeOfObjects() / KB, | |
396 js_global_property_cell_space_->Available() / KB, | |
397 js_global_property_cell_space_->CommittedMemory() / KB); | |
386 PrintPID("Large object space, used: %6" V8_PTR_PREFIX "d KB" | 398 PrintPID("Large object space, used: %6" V8_PTR_PREFIX "d KB" |
387 ", available: %6" V8_PTR_PREFIX "d KB" | 399 ", available: %6" V8_PTR_PREFIX "d KB" |
388 ", committed: %6" V8_PTR_PREFIX "d KB\n", | 400 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
389 lo_space_->SizeOfObjects() / KB, | 401 lo_space_->SizeOfObjects() / KB, |
390 lo_space_->Available() / KB, | 402 lo_space_->Available() / KB, |
391 lo_space_->CommittedMemory() / KB); | 403 lo_space_->CommittedMemory() / KB); |
392 PrintPID("All spaces, used: %6" V8_PTR_PREFIX "d KB" | 404 PrintPID("All spaces, used: %6" V8_PTR_PREFIX "d KB" |
393 ", available: %6" V8_PTR_PREFIX "d KB" | 405 ", available: %6" V8_PTR_PREFIX "d KB" |
394 ", committed: %6" V8_PTR_PREFIX "d KB\n", | 406 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
395 this->SizeOfObjects() / KB, | 407 this->SizeOfObjects() / KB, |
(...skipping 111 matching lines...) Loading... | |
507 if (CommittedMemory() > 0) { | 519 if (CommittedMemory() > 0) { |
508 isolate_->counters()->external_fragmentation_total()->AddSample( | 520 isolate_->counters()->external_fragmentation_total()->AddSample( |
509 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory())); | 521 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory())); |
510 | 522 |
511 isolate_->counters()->heap_fraction_map_space()->AddSample( | 523 isolate_->counters()->heap_fraction_map_space()->AddSample( |
512 static_cast<int>( | 524 static_cast<int>( |
513 (map_space()->CommittedMemory() * 100.0) / CommittedMemory())); | 525 (map_space()->CommittedMemory() * 100.0) / CommittedMemory())); |
514 isolate_->counters()->heap_fraction_cell_space()->AddSample( | 526 isolate_->counters()->heap_fraction_cell_space()->AddSample( |
515 static_cast<int>( | 527 static_cast<int>( |
516 (cell_space()->CommittedMemory() * 100.0) / CommittedMemory())); | 528 (cell_space()->CommittedMemory() * 100.0) / CommittedMemory())); |
529 isolate_->counters()->heap_fraction_js_global_property_cell_space()-> | |
530 AddSample(static_cast<int>( | |
531 (js_global_property_cell_space()->CommittedMemory() * 100.0) / | |
532 CommittedMemory())); | |
517 | 533 |
518 isolate_->counters()->heap_sample_total_committed()->AddSample( | 534 isolate_->counters()->heap_sample_total_committed()->AddSample( |
519 static_cast<int>(CommittedMemory() / KB)); | 535 static_cast<int>(CommittedMemory() / KB)); |
520 isolate_->counters()->heap_sample_total_used()->AddSample( | 536 isolate_->counters()->heap_sample_total_used()->AddSample( |
521 static_cast<int>(SizeOfObjects() / KB)); | 537 static_cast<int>(SizeOfObjects() / KB)); |
522 isolate_->counters()->heap_sample_map_space_committed()->AddSample( | 538 isolate_->counters()->heap_sample_map_space_committed()->AddSample( |
523 static_cast<int>(map_space()->CommittedMemory() / KB)); | 539 static_cast<int>(map_space()->CommittedMemory() / KB)); |
524 isolate_->counters()->heap_sample_cell_space_committed()->AddSample( | 540 isolate_->counters()->heap_sample_cell_space_committed()->AddSample( |
525 static_cast<int>(cell_space()->CommittedMemory() / KB)); | 541 static_cast<int>(cell_space()->CommittedMemory() / KB)); |
542 isolate_->counters()-> | |
543 heap_sample_js_global_property_cell_space_committed()-> | |
544 AddSample(static_cast<int>( | |
545 js_global_property_cell_space()->CommittedMemory() / KB)); | |
526 } | 546 } |
527 | 547 |
528 #define UPDATE_COUNTERS_FOR_SPACE(space) \ | 548 #define UPDATE_COUNTERS_FOR_SPACE(space) \ |
529 isolate_->counters()->space##_bytes_available()->Set( \ | 549 isolate_->counters()->space##_bytes_available()->Set( \ |
530 static_cast<int>(space()->Available())); \ | 550 static_cast<int>(space()->Available())); \ |
531 isolate_->counters()->space##_bytes_committed()->Set( \ | 551 isolate_->counters()->space##_bytes_committed()->Set( \ |
532 static_cast<int>(space()->CommittedMemory())); \ | 552 static_cast<int>(space()->CommittedMemory())); \ |
533 isolate_->counters()->space##_bytes_used()->Set( \ | 553 isolate_->counters()->space##_bytes_used()->Set( \ |
534 static_cast<int>(space()->SizeOfObjects())); | 554 static_cast<int>(space()->SizeOfObjects())); |
535 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \ | 555 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \ |
536 if (space()->CommittedMemory() > 0) { \ | 556 if (space()->CommittedMemory() > 0) { \ |
537 isolate_->counters()->external_fragmentation_##space()->AddSample( \ | 557 isolate_->counters()->external_fragmentation_##space()->AddSample( \ |
538 static_cast<int>(100 - \ | 558 static_cast<int>(100 - \ |
539 (space()->SizeOfObjects() * 100.0) / space()->CommittedMemory())); \ | 559 (space()->SizeOfObjects() * 100.0) / space()->CommittedMemory())); \ |
540 } | 560 } |
541 #define UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(space) \ | 561 #define UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(space) \ |
542 UPDATE_COUNTERS_FOR_SPACE(space) \ | 562 UPDATE_COUNTERS_FOR_SPACE(space) \ |
543 UPDATE_FRAGMENTATION_FOR_SPACE(space) | 563 UPDATE_FRAGMENTATION_FOR_SPACE(space) |
544 | 564 |
545 UPDATE_COUNTERS_FOR_SPACE(new_space) | 565 UPDATE_COUNTERS_FOR_SPACE(new_space) |
546 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_pointer_space) | 566 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_pointer_space) |
547 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_data_space) | 567 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_data_space) |
548 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(code_space) | 568 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(code_space) |
549 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(map_space) | 569 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(map_space) |
550 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(cell_space) | 570 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(cell_space) |
571 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(js_global_property_cell_space) | |
551 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(lo_space) | 572 UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(lo_space) |
552 #undef UPDATE_COUNTERS_FOR_SPACE | 573 #undef UPDATE_COUNTERS_FOR_SPACE |
553 #undef UPDATE_FRAGMENTATION_FOR_SPACE | 574 #undef UPDATE_FRAGMENTATION_FOR_SPACE |
554 #undef UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE | 575 #undef UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE |
555 | 576 |
556 #if defined(DEBUG) | 577 #if defined(DEBUG) |
557 ReportStatisticsAfterGC(); | 578 ReportStatisticsAfterGC(); |
558 #endif // DEBUG | 579 #endif // DEBUG |
559 #ifdef ENABLE_DEBUGGER_SUPPORT | 580 #ifdef ENABLE_DEBUGGER_SUPPORT |
560 isolate_->debug()->AfterGarbageCollection(); | 581 isolate_->debug()->AfterGarbageCollection(); |
(...skipping 785 matching lines...) Loading... | |
1346 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); | 1367 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); |
1347 | 1368 |
1348 // Copy objects reachable from the old generation. | 1369 // Copy objects reachable from the old generation. |
1349 { | 1370 { |
1350 StoreBufferRebuildScope scope(this, | 1371 StoreBufferRebuildScope scope(this, |
1351 store_buffer(), | 1372 store_buffer(), |
1352 &ScavengeStoreBufferCallback); | 1373 &ScavengeStoreBufferCallback); |
1353 store_buffer()->IteratePointersToNewSpace(&ScavengeObject); | 1374 store_buffer()->IteratePointersToNewSpace(&ScavengeObject); |
1354 } | 1375 } |
1355 | 1376 |
1356 // Copy objects reachable from cells by scavenging cell values directly. | 1377 // Copy objects reachable from simple cells by scavenging cell values |
1378 // directly. | |
1357 HeapObjectIterator cell_iterator(cell_space_); | 1379 HeapObjectIterator cell_iterator(cell_space_); |
1358 for (HeapObject* heap_object = cell_iterator.Next(); | 1380 for (HeapObject* heap_object = cell_iterator.Next(); |
1359 heap_object != NULL; | 1381 heap_object != NULL; |
1360 heap_object = cell_iterator.Next()) { | 1382 heap_object = cell_iterator.Next()) { |
1361 if (heap_object->IsJSGlobalPropertyCell()) { | 1383 if (heap_object->IsCell()) { |
1362 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object); | 1384 Cell* cell = Cell::cast(heap_object); |
1363 Address value_address = cell->ValueAddress(); | 1385 Address value_address = cell->ValueAddress(); |
1364 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); | 1386 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); |
1365 } | 1387 } |
1366 } | 1388 } |
1367 | 1389 |
1390 // Copy objects reachable from global property cells by scavenging global | |
1391 // property cell values directly. | |
1392 HeapObjectIterator js_global_property_cell_iterator( | |
1393 js_global_property_cell_space_); | |
1394 for (HeapObject* heap_object = js_global_property_cell_iterator.Next(); | |
1395 heap_object != NULL; | |
1396 heap_object = js_global_property_cell_iterator.Next()) { | |
1397 if (heap_object->IsJSGlobalPropertyCell()) { | |
1398 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object); | |
1399 Address value_address = cell->ValueAddress(); | |
1400 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); | |
1401 Address type_address = cell->TypeAddress(); | |
1402 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(type_address)); | |
1403 } | |
1404 } | |
1405 | |
1368 // Copy objects reachable from the code flushing candidates list. | 1406 // Copy objects reachable from the code flushing candidates list. |
1369 MarkCompactCollector* collector = mark_compact_collector(); | 1407 MarkCompactCollector* collector = mark_compact_collector(); |
1370 if (collector->is_code_flushing_enabled()) { | 1408 if (collector->is_code_flushing_enabled()) { |
1371 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor); | 1409 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor); |
1372 } | 1410 } |
1373 | 1411 |
1374 // Scavenge object reachable from the native contexts list directly. | 1412 // Scavenge object reachable from the native contexts list directly. |
1375 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_)); | 1413 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_)); |
1376 | 1414 |
1377 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); | 1415 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); |
(...skipping 1278 matching lines...) Loading... | |
2656 { MaybeObject* maybe_obj = AllocateEmptyExternalArray(kExternalPixelArray); | 2694 { MaybeObject* maybe_obj = AllocateEmptyExternalArray(kExternalPixelArray); |
2657 if (!maybe_obj->ToObject(&obj)) return false; | 2695 if (!maybe_obj->ToObject(&obj)) return false; |
2658 } | 2696 } |
2659 set_empty_external_pixel_array(ExternalArray::cast(obj)); | 2697 set_empty_external_pixel_array(ExternalArray::cast(obj)); |
2660 | 2698 |
2661 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); | 2699 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); |
2662 if (!maybe_obj->ToObject(&obj)) return false; | 2700 if (!maybe_obj->ToObject(&obj)) return false; |
2663 } | 2701 } |
2664 set_code_map(Map::cast(obj)); | 2702 set_code_map(Map::cast(obj)); |
2665 | 2703 |
2704 { MaybeObject* maybe_obj = AllocateMap(CELL_TYPE, Cell::kSize); | |
2705 if (!maybe_obj->ToObject(&obj)) return false; | |
2706 } | |
2707 set_cell_map(Map::cast(obj)); | |
2708 | |
2666 { MaybeObject* maybe_obj = AllocateMap(JS_GLOBAL_PROPERTY_CELL_TYPE, | 2709 { MaybeObject* maybe_obj = AllocateMap(JS_GLOBAL_PROPERTY_CELL_TYPE, |
2667 JSGlobalPropertyCell::kSize); | 2710 JSGlobalPropertyCell::kSize); |
2668 if (!maybe_obj->ToObject(&obj)) return false; | 2711 if (!maybe_obj->ToObject(&obj)) return false; |
2669 } | 2712 } |
2670 set_global_property_cell_map(Map::cast(obj)); | 2713 set_global_property_cell_map(Map::cast(obj)); |
2671 | 2714 |
2672 { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, kPointerSize); | 2715 { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, kPointerSize); |
2673 if (!maybe_obj->ToObject(&obj)) return false; | 2716 if (!maybe_obj->ToObject(&obj)) return false; |
2674 } | 2717 } |
2675 set_one_pointer_filler_map(Map::cast(obj)); | 2718 set_one_pointer_filler_map(Map::cast(obj)); |
(...skipping 115 matching lines...) Loading... | |
2791 Object* result; | 2834 Object* result; |
2792 { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize); | 2835 { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize); |
2793 if (!maybe_result->ToObject(&result)) return maybe_result; | 2836 if (!maybe_result->ToObject(&result)) return maybe_result; |
2794 } | 2837 } |
2795 HeapObject::cast(result)->set_map_no_write_barrier(heap_number_map()); | 2838 HeapObject::cast(result)->set_map_no_write_barrier(heap_number_map()); |
2796 HeapNumber::cast(result)->set_value(value); | 2839 HeapNumber::cast(result)->set_value(value); |
2797 return result; | 2840 return result; |
2798 } | 2841 } |
2799 | 2842 |
2800 | 2843 |
2844 MaybeObject* Heap::AllocateCell(Object* value) { | |
2845 Object* result; | |
2846 { MaybeObject* maybe_result = AllocateRawCell(); | |
2847 if (!maybe_result->ToObject(&result)) return maybe_result; | |
2848 } | |
2849 HeapObject::cast(result)->set_map_no_write_barrier(cell_map()); | |
2850 Cell::cast(result)->set_value(value); | |
2851 return result; | |
2852 } | |
2853 | |
2854 | |
2801 MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) { | 2855 MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) { |
2802 Object* result; | 2856 Object* result; |
2803 { MaybeObject* maybe_result = AllocateRawCell(); | 2857 { MaybeObject* maybe_result = AllocateRawJSGlobalPropertyCell(); |
2804 if (!maybe_result->ToObject(&result)) return maybe_result; | 2858 if (!maybe_result->ToObject(&result)) return maybe_result; |
2805 } | 2859 } |
2806 HeapObject::cast(result)->set_map_no_write_barrier( | 2860 HeapObject::cast(result)->set_map_no_write_barrier( |
2807 global_property_cell_map()); | 2861 global_property_cell_map()); |
2808 JSGlobalPropertyCell::cast(result)->set_value(value); | 2862 JSGlobalPropertyCell::cast(result)->set_value(value); |
2863 JSGlobalPropertyCell::cast(result)->set_type(Type::None()); | |
2809 return result; | 2864 return result; |
2810 } | 2865 } |
2811 | 2866 |
2812 | 2867 |
2813 MaybeObject* Heap::AllocateBox(Object* value, PretenureFlag pretenure) { | 2868 MaybeObject* Heap::AllocateBox(Object* value, PretenureFlag pretenure) { |
2814 Box* result; | 2869 Box* result; |
2815 MaybeObject* maybe_result = AllocateStruct(BOX_TYPE); | 2870 MaybeObject* maybe_result = AllocateStruct(BOX_TYPE); |
2816 if (!maybe_result->To(&result)) return maybe_result; | 2871 if (!maybe_result->To(&result)) return maybe_result; |
2817 result->set_value(value); | 2872 result->set_value(value); |
2818 return result; | 2873 return result; |
(...skipping 1643 matching lines...) Loading... | |
4462 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); | 4517 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); |
4463 if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; | 4518 if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; |
4464 } | 4519 } |
4465 constructor->set_initial_map(Map::cast(initial_map)); | 4520 constructor->set_initial_map(Map::cast(initial_map)); |
4466 Map::cast(initial_map)->set_constructor(constructor); | 4521 Map::cast(initial_map)->set_constructor(constructor); |
4467 } | 4522 } |
4468 // Allocate the object based on the constructors initial map, or the payload | 4523 // Allocate the object based on the constructors initial map, or the payload |
4469 // advice | 4524 // advice |
4470 Map* initial_map = constructor->initial_map(); | 4525 Map* initial_map = constructor->initial_map(); |
4471 | 4526 |
4472 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( | 4527 Cell* cell = Cell::cast(*allocation_site_info_payload); |
4473 *allocation_site_info_payload); | |
4474 Smi* smi = Smi::cast(cell->value()); | 4528 Smi* smi = Smi::cast(cell->value()); |
4475 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); | 4529 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); |
4476 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; | 4530 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; |
4477 if (to_kind != initial_map->elements_kind()) { | 4531 if (to_kind != initial_map->elements_kind()) { |
4478 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind); | 4532 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind); |
4479 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; | 4533 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; |
4480 // Possibly alter the mode, since we found an updated elements kind | 4534 // Possibly alter the mode, since we found an updated elements kind |
4481 // in the type info cell. | 4535 // in the type info cell. |
4482 mode = AllocationSiteInfo::GetMode(to_kind); | 4536 mode = AllocationSiteInfo::GetMode(to_kind); |
4483 } | 4537 } |
(...skipping 1561 matching lines...) Loading... | |
6045 PrintF("Old pointer space : "); | 6099 PrintF("Old pointer space : "); |
6046 old_pointer_space_->ReportStatistics(); | 6100 old_pointer_space_->ReportStatistics(); |
6047 PrintF("Old data space : "); | 6101 PrintF("Old data space : "); |
6048 old_data_space_->ReportStatistics(); | 6102 old_data_space_->ReportStatistics(); |
6049 PrintF("Code space : "); | 6103 PrintF("Code space : "); |
6050 code_space_->ReportStatistics(); | 6104 code_space_->ReportStatistics(); |
6051 PrintF("Map space : "); | 6105 PrintF("Map space : "); |
6052 map_space_->ReportStatistics(); | 6106 map_space_->ReportStatistics(); |
6053 PrintF("Cell space : "); | 6107 PrintF("Cell space : "); |
6054 cell_space_->ReportStatistics(); | 6108 cell_space_->ReportStatistics(); |
6109 PrintF("JSGlobalPropertyCell space : "); | |
6110 js_global_property_cell_space_->ReportStatistics(); | |
6055 PrintF("Large object space : "); | 6111 PrintF("Large object space : "); |
6056 lo_space_->ReportStatistics(); | 6112 lo_space_->ReportStatistics(); |
6057 PrintF(">>>>>> ========================================= >>>>>>\n"); | 6113 PrintF(">>>>>> ========================================= >>>>>>\n"); |
6058 } | 6114 } |
6059 | 6115 |
6060 #endif // DEBUG | 6116 #endif // DEBUG |
6061 | 6117 |
6062 bool Heap::Contains(HeapObject* value) { | 6118 bool Heap::Contains(HeapObject* value) { |
6063 return Contains(value->address()); | 6119 return Contains(value->address()); |
6064 } | 6120 } |
6065 | 6121 |
6066 | 6122 |
6067 bool Heap::Contains(Address addr) { | 6123 bool Heap::Contains(Address addr) { |
6068 if (OS::IsOutsideAllocatedSpace(addr)) return false; | 6124 if (OS::IsOutsideAllocatedSpace(addr)) return false; |
6069 return HasBeenSetUp() && | 6125 return HasBeenSetUp() && |
6070 (new_space_.ToSpaceContains(addr) || | 6126 (new_space_.ToSpaceContains(addr) || |
6071 old_pointer_space_->Contains(addr) || | 6127 old_pointer_space_->Contains(addr) || |
6072 old_data_space_->Contains(addr) || | 6128 old_data_space_->Contains(addr) || |
6073 code_space_->Contains(addr) || | 6129 code_space_->Contains(addr) || |
6074 map_space_->Contains(addr) || | 6130 map_space_->Contains(addr) || |
6075 cell_space_->Contains(addr) || | 6131 cell_space_->Contains(addr) || |
6132 js_global_property_cell_space_->Contains(addr) || | |
6076 lo_space_->SlowContains(addr)); | 6133 lo_space_->SlowContains(addr)); |
6077 } | 6134 } |
6078 | 6135 |
6079 | 6136 |
6080 bool Heap::InSpace(HeapObject* value, AllocationSpace space) { | 6137 bool Heap::InSpace(HeapObject* value, AllocationSpace space) { |
6081 return InSpace(value->address(), space); | 6138 return InSpace(value->address(), space); |
6082 } | 6139 } |
6083 | 6140 |
6084 | 6141 |
6085 bool Heap::InSpace(Address addr, AllocationSpace space) { | 6142 bool Heap::InSpace(Address addr, AllocationSpace space) { |
6086 if (OS::IsOutsideAllocatedSpace(addr)) return false; | 6143 if (OS::IsOutsideAllocatedSpace(addr)) return false; |
6087 if (!HasBeenSetUp()) return false; | 6144 if (!HasBeenSetUp()) return false; |
6088 | 6145 |
6089 switch (space) { | 6146 switch (space) { |
6090 case NEW_SPACE: | 6147 case NEW_SPACE: |
6091 return new_space_.ToSpaceContains(addr); | 6148 return new_space_.ToSpaceContains(addr); |
6092 case OLD_POINTER_SPACE: | 6149 case OLD_POINTER_SPACE: |
6093 return old_pointer_space_->Contains(addr); | 6150 return old_pointer_space_->Contains(addr); |
6094 case OLD_DATA_SPACE: | 6151 case OLD_DATA_SPACE: |
6095 return old_data_space_->Contains(addr); | 6152 return old_data_space_->Contains(addr); |
6096 case CODE_SPACE: | 6153 case CODE_SPACE: |
6097 return code_space_->Contains(addr); | 6154 return code_space_->Contains(addr); |
6098 case MAP_SPACE: | 6155 case MAP_SPACE: |
6099 return map_space_->Contains(addr); | 6156 return map_space_->Contains(addr); |
6100 case CELL_SPACE: | 6157 case CELL_SPACE: |
6101 return cell_space_->Contains(addr); | 6158 return cell_space_->Contains(addr); |
6159 case JS_GLOBAL_PROPERTY_CELL_SPACE: | |
6160 return js_global_property_cell_space_->Contains(addr); | |
6102 case LO_SPACE: | 6161 case LO_SPACE: |
6103 return lo_space_->SlowContains(addr); | 6162 return lo_space_->SlowContains(addr); |
6104 } | 6163 } |
6105 | 6164 |
6106 return false; | 6165 return false; |
6107 } | 6166 } |
6108 | 6167 |
6109 | 6168 |
6110 #ifdef VERIFY_HEAP | 6169 #ifdef VERIFY_HEAP |
6111 void Heap::Verify() { | 6170 void Heap::Verify() { |
6112 CHECK(HasBeenSetUp()); | 6171 CHECK(HasBeenSetUp()); |
6113 | 6172 |
6114 store_buffer()->Verify(); | 6173 store_buffer()->Verify(); |
6115 | 6174 |
6116 VerifyPointersVisitor visitor; | 6175 VerifyPointersVisitor visitor; |
6117 IterateRoots(&visitor, VISIT_ONLY_STRONG); | 6176 IterateRoots(&visitor, VISIT_ONLY_STRONG); |
6118 | 6177 |
6119 new_space_.Verify(); | 6178 new_space_.Verify(); |
6120 | 6179 |
6121 old_pointer_space_->Verify(&visitor); | 6180 old_pointer_space_->Verify(&visitor); |
6122 map_space_->Verify(&visitor); | 6181 map_space_->Verify(&visitor); |
6123 | 6182 |
6124 VerifyPointersVisitor no_dirty_regions_visitor; | 6183 VerifyPointersVisitor no_dirty_regions_visitor; |
6125 old_data_space_->Verify(&no_dirty_regions_visitor); | 6184 old_data_space_->Verify(&no_dirty_regions_visitor); |
6126 code_space_->Verify(&no_dirty_regions_visitor); | 6185 code_space_->Verify(&no_dirty_regions_visitor); |
6127 cell_space_->Verify(&no_dirty_regions_visitor); | 6186 cell_space_->Verify(&no_dirty_regions_visitor); |
6187 js_global_property_cell_space_->Verify(&no_dirty_regions_visitor); | |
6128 | 6188 |
6129 lo_space_->Verify(); | 6189 lo_space_->Verify(); |
6130 } | 6190 } |
6131 #endif | 6191 #endif |
6132 | 6192 |
6133 | 6193 |
6134 MaybeObject* Heap::InternalizeUtf8String(Vector<const char> string) { | 6194 MaybeObject* Heap::InternalizeUtf8String(Vector<const char> string) { |
6135 Object* result = NULL; | 6195 Object* result = NULL; |
6136 Object* new_table; | 6196 Object* new_table; |
6137 { MaybeObject* maybe_new_table = | 6197 { MaybeObject* maybe_new_table = |
(...skipping 479 matching lines...) Loading... | |
6617 *stats->old_pointer_space_size = old_pointer_space_->SizeOfObjects(); | 6677 *stats->old_pointer_space_size = old_pointer_space_->SizeOfObjects(); |
6618 *stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); | 6678 *stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); |
6619 *stats->old_data_space_size = old_data_space_->SizeOfObjects(); | 6679 *stats->old_data_space_size = old_data_space_->SizeOfObjects(); |
6620 *stats->old_data_space_capacity = old_data_space_->Capacity(); | 6680 *stats->old_data_space_capacity = old_data_space_->Capacity(); |
6621 *stats->code_space_size = code_space_->SizeOfObjects(); | 6681 *stats->code_space_size = code_space_->SizeOfObjects(); |
6622 *stats->code_space_capacity = code_space_->Capacity(); | 6682 *stats->code_space_capacity = code_space_->Capacity(); |
6623 *stats->map_space_size = map_space_->SizeOfObjects(); | 6683 *stats->map_space_size = map_space_->SizeOfObjects(); |
6624 *stats->map_space_capacity = map_space_->Capacity(); | 6684 *stats->map_space_capacity = map_space_->Capacity(); |
6625 *stats->cell_space_size = cell_space_->SizeOfObjects(); | 6685 *stats->cell_space_size = cell_space_->SizeOfObjects(); |
6626 *stats->cell_space_capacity = cell_space_->Capacity(); | 6686 *stats->cell_space_capacity = cell_space_->Capacity(); |
6687 *stats->js_global_property_cell_space_size = | |
6688 js_global_property_cell_space_->SizeOfObjects(); | |
6689 *stats->js_global_property_cell_space_capacity = | |
6690 js_global_property_cell_space_->Capacity(); | |
6627 *stats->lo_space_size = lo_space_->Size(); | 6691 *stats->lo_space_size = lo_space_->Size(); |
6628 isolate_->global_handles()->RecordStats(stats); | 6692 isolate_->global_handles()->RecordStats(stats); |
6629 *stats->memory_allocator_size = isolate()->memory_allocator()->Size(); | 6693 *stats->memory_allocator_size = isolate()->memory_allocator()->Size(); |
6630 *stats->memory_allocator_capacity = | 6694 *stats->memory_allocator_capacity = |
6631 isolate()->memory_allocator()->Size() + | 6695 isolate()->memory_allocator()->Size() + |
6632 isolate()->memory_allocator()->Available(); | 6696 isolate()->memory_allocator()->Available(); |
6633 *stats->os_error = OS::GetLastError(); | 6697 *stats->os_error = OS::GetLastError(); |
6634 isolate()->memory_allocator()->Available(); | 6698 isolate()->memory_allocator()->Available(); |
6635 if (take_snapshot) { | 6699 if (take_snapshot) { |
6636 HeapIterator iterator(this); | 6700 HeapIterator iterator(this); |
6637 for (HeapObject* obj = iterator.next(); | 6701 for (HeapObject* obj = iterator.next(); |
6638 obj != NULL; | 6702 obj != NULL; |
6639 obj = iterator.next()) { | 6703 obj = iterator.next()) { |
6640 InstanceType type = obj->map()->instance_type(); | 6704 InstanceType type = obj->map()->instance_type(); |
6641 ASSERT(0 <= type && type <= LAST_TYPE); | 6705 ASSERT(0 <= type && type <= LAST_TYPE); |
6642 stats->objects_per_type[type]++; | 6706 stats->objects_per_type[type]++; |
6643 stats->size_per_type[type] += obj->Size(); | 6707 stats->size_per_type[type] += obj->Size(); |
6644 } | 6708 } |
6645 } | 6709 } |
6646 } | 6710 } |
6647 | 6711 |
6648 | 6712 |
6649 intptr_t Heap::PromotedSpaceSizeOfObjects() { | 6713 intptr_t Heap::PromotedSpaceSizeOfObjects() { |
6650 return old_pointer_space_->SizeOfObjects() | 6714 return old_pointer_space_->SizeOfObjects() |
6651 + old_data_space_->SizeOfObjects() | 6715 + old_data_space_->SizeOfObjects() |
6652 + code_space_->SizeOfObjects() | 6716 + code_space_->SizeOfObjects() |
6653 + map_space_->SizeOfObjects() | 6717 + map_space_->SizeOfObjects() |
6654 + cell_space_->SizeOfObjects() | 6718 + cell_space_->SizeOfObjects() |
6719 + js_global_property_cell_space_->SizeOfObjects() | |
6655 + lo_space_->SizeOfObjects(); | 6720 + lo_space_->SizeOfObjects(); |
6656 } | 6721 } |
6657 | 6722 |
6658 | 6723 |
6659 intptr_t Heap::PromotedExternalMemorySize() { | 6724 intptr_t Heap::PromotedExternalMemorySize() { |
6660 if (amount_of_external_allocated_memory_ | 6725 if (amount_of_external_allocated_memory_ |
6661 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; | 6726 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; |
6662 return amount_of_external_allocated_memory_ | 6727 return amount_of_external_allocated_memory_ |
6663 - amount_of_external_allocated_memory_at_last_global_gc_; | 6728 - amount_of_external_allocated_memory_at_last_global_gc_; |
6664 } | 6729 } |
(...skipping 68 matching lines...) Loading... | |
6733 code_space_ = | 6798 code_space_ = |
6734 new OldSpace(this, max_old_generation_size_, CODE_SPACE, EXECUTABLE); | 6799 new OldSpace(this, max_old_generation_size_, CODE_SPACE, EXECUTABLE); |
6735 if (code_space_ == NULL) return false; | 6800 if (code_space_ == NULL) return false; |
6736 if (!code_space_->SetUp()) return false; | 6801 if (!code_space_->SetUp()) return false; |
6737 | 6802 |
6738 // Initialize map space. | 6803 // Initialize map space. |
6739 map_space_ = new MapSpace(this, max_old_generation_size_, MAP_SPACE); | 6804 map_space_ = new MapSpace(this, max_old_generation_size_, MAP_SPACE); |
6740 if (map_space_ == NULL) return false; | 6805 if (map_space_ == NULL) return false; |
6741 if (!map_space_->SetUp()) return false; | 6806 if (!map_space_->SetUp()) return false; |
6742 | 6807 |
6743 // Initialize global property cell space. | 6808 // Initialize simple cell space. |
6744 cell_space_ = new CellSpace(this, max_old_generation_size_, CELL_SPACE); | 6809 cell_space_ = new CellSpace(this, max_old_generation_size_, CELL_SPACE); |
6745 if (cell_space_ == NULL) return false; | 6810 if (cell_space_ == NULL) return false; |
6746 if (!cell_space_->SetUp()) return false; | 6811 if (!cell_space_->SetUp()) return false; |
6747 | 6812 |
6813 // Initialize global property cell space. | |
6814 js_global_property_cell_space_ = | |
6815 new JSGlobalPropertyCellSpace(this, max_old_generation_size_, CELL_SPACE); | |
Michael Starzinger
2013/06/12 13:23:25
The CELL_SPACE allocation id here is bogus.
danno
2013/06/12 14:24:28
Done.
| |
6816 if (js_global_property_cell_space_ == NULL) return false; | |
6817 if (!js_global_property_cell_space_->SetUp()) return false; | |
6818 | |
6748 // The large object code space may contain code or data. We set the memory | 6819 // The large object code space may contain code or data. We set the memory |
6749 // to be non-executable here for safety, but this means we need to enable it | 6820 // to be non-executable here for safety, but this means we need to enable it |
6750 // explicitly when allocating large code objects. | 6821 // explicitly when allocating large code objects. |
6751 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE); | 6822 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE); |
6752 if (lo_space_ == NULL) return false; | 6823 if (lo_space_ == NULL) return false; |
6753 if (!lo_space_->SetUp()) return false; | 6824 if (!lo_space_->SetUp()) return false; |
6754 | 6825 |
6755 // Set up the seed that is used to randomize the string hash function. | 6826 // Set up the seed that is used to randomize the string hash function. |
6756 ASSERT(hash_seed() == 0); | 6827 ASSERT(hash_seed() == 0); |
6757 if (FLAG_randomize_hashes) { | 6828 if (FLAG_randomize_hashes) { |
(...skipping 100 matching lines...) Loading... | |
6858 delete map_space_; | 6929 delete map_space_; |
6859 map_space_ = NULL; | 6930 map_space_ = NULL; |
6860 } | 6931 } |
6861 | 6932 |
6862 if (cell_space_ != NULL) { | 6933 if (cell_space_ != NULL) { |
6863 cell_space_->TearDown(); | 6934 cell_space_->TearDown(); |
6864 delete cell_space_; | 6935 delete cell_space_; |
6865 cell_space_ = NULL; | 6936 cell_space_ = NULL; |
6866 } | 6937 } |
6867 | 6938 |
6939 if (js_global_property_cell_space_ != NULL) { | |
6940 js_global_property_cell_space_->TearDown(); | |
6941 delete js_global_property_cell_space_; | |
6942 js_global_property_cell_space_ = NULL; | |
6943 } | |
6944 | |
6868 if (lo_space_ != NULL) { | 6945 if (lo_space_ != NULL) { |
6869 lo_space_->TearDown(); | 6946 lo_space_->TearDown(); |
6870 delete lo_space_; | 6947 delete lo_space_; |
6871 lo_space_ = NULL; | 6948 lo_space_ = NULL; |
6872 } | 6949 } |
6873 | 6950 |
6874 store_buffer()->TearDown(); | 6951 store_buffer()->TearDown(); |
6875 incremental_marking()->TearDown(); | 6952 incremental_marking()->TearDown(); |
6876 | 6953 |
6877 isolate_->memory_allocator()->TearDown(); | 6954 isolate_->memory_allocator()->TearDown(); |
(...skipping 70 matching lines...) Loading... | |
6948 case OLD_POINTER_SPACE: | 7025 case OLD_POINTER_SPACE: |
6949 return heap_->old_pointer_space(); | 7026 return heap_->old_pointer_space(); |
6950 case OLD_DATA_SPACE: | 7027 case OLD_DATA_SPACE: |
6951 return heap_->old_data_space(); | 7028 return heap_->old_data_space(); |
6952 case CODE_SPACE: | 7029 case CODE_SPACE: |
6953 return heap_->code_space(); | 7030 return heap_->code_space(); |
6954 case MAP_SPACE: | 7031 case MAP_SPACE: |
6955 return heap_->map_space(); | 7032 return heap_->map_space(); |
6956 case CELL_SPACE: | 7033 case CELL_SPACE: |
6957 return heap_->cell_space(); | 7034 return heap_->cell_space(); |
7035 case JS_GLOBAL_PROPERTY_CELL_SPACE: | |
7036 return heap_->js_global_property_cell_space(); | |
6958 case LO_SPACE: | 7037 case LO_SPACE: |
6959 return heap_->lo_space(); | 7038 return heap_->lo_space(); |
6960 default: | 7039 default: |
6961 return NULL; | 7040 return NULL; |
6962 } | 7041 } |
6963 } | 7042 } |
6964 | 7043 |
6965 | 7044 |
6966 PagedSpace* PagedSpaces::next() { | 7045 PagedSpace* PagedSpaces::next() { |
6967 switch (counter_++) { | 7046 switch (counter_++) { |
6968 case OLD_POINTER_SPACE: | 7047 case OLD_POINTER_SPACE: |
6969 return heap_->old_pointer_space(); | 7048 return heap_->old_pointer_space(); |
6970 case OLD_DATA_SPACE: | 7049 case OLD_DATA_SPACE: |
6971 return heap_->old_data_space(); | 7050 return heap_->old_data_space(); |
6972 case CODE_SPACE: | 7051 case CODE_SPACE: |
6973 return heap_->code_space(); | 7052 return heap_->code_space(); |
6974 case MAP_SPACE: | 7053 case MAP_SPACE: |
6975 return heap_->map_space(); | 7054 return heap_->map_space(); |
6976 case CELL_SPACE: | 7055 case CELL_SPACE: |
6977 return heap_->cell_space(); | 7056 return heap_->cell_space(); |
7057 case JS_GLOBAL_PROPERTY_CELL_SPACE: | |
7058 return heap_->js_global_property_cell_space(); | |
6978 default: | 7059 default: |
6979 return NULL; | 7060 return NULL; |
6980 } | 7061 } |
6981 } | 7062 } |
6982 | 7063 |
6983 | 7064 |
6984 | 7065 |
6985 OldSpace* OldSpaces::next() { | 7066 OldSpace* OldSpaces::next() { |
6986 switch (counter_++) { | 7067 switch (counter_++) { |
6987 case OLD_POINTER_SPACE: | 7068 case OLD_POINTER_SPACE: |
(...skipping 69 matching lines...) Loading... | |
7057 break; | 7138 break; |
7058 case CODE_SPACE: | 7139 case CODE_SPACE: |
7059 iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_); | 7140 iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_); |
7060 break; | 7141 break; |
7061 case MAP_SPACE: | 7142 case MAP_SPACE: |
7062 iterator_ = new HeapObjectIterator(heap_->map_space(), size_func_); | 7143 iterator_ = new HeapObjectIterator(heap_->map_space(), size_func_); |
7063 break; | 7144 break; |
7064 case CELL_SPACE: | 7145 case CELL_SPACE: |
7065 iterator_ = new HeapObjectIterator(heap_->cell_space(), size_func_); | 7146 iterator_ = new HeapObjectIterator(heap_->cell_space(), size_func_); |
7066 break; | 7147 break; |
7148 case JS_GLOBAL_PROPERTY_CELL_SPACE: | |
7149 iterator_ = new HeapObjectIterator(heap_->js_global_property_cell_space(), | |
7150 size_func_); | |
7151 break; | |
7067 case LO_SPACE: | 7152 case LO_SPACE: |
7068 iterator_ = new LargeObjectIterator(heap_->lo_space(), size_func_); | 7153 iterator_ = new LargeObjectIterator(heap_->lo_space(), size_func_); |
7069 break; | 7154 break; |
7070 } | 7155 } |
7071 | 7156 |
7072 // Return the newly allocated iterator; | 7157 // Return the newly allocated iterator; |
7073 ASSERT(iterator_ != NULL); | 7158 ASSERT(iterator_ != NULL); |
7074 return iterator_; | 7159 return iterator_; |
7075 } | 7160 } |
7076 | 7161 |
(...skipping 937 matching lines...) Loading... | |
8014 if (FLAG_parallel_recompilation) { | 8099 if (FLAG_parallel_recompilation) { |
8015 heap_->relocation_mutex_->Lock(); | 8100 heap_->relocation_mutex_->Lock(); |
8016 #ifdef DEBUG | 8101 #ifdef DEBUG |
8017 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8102 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
8018 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8103 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
8019 #endif // DEBUG | 8104 #endif // DEBUG |
8020 } | 8105 } |
8021 } | 8106 } |
8022 | 8107 |
8023 } } // namespace v8::internal | 8108 } } // namespace v8::internal |
OLD | NEW |