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...) Expand 10 before | Expand all | Expand 10 after 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 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...) Expand 10 before | Expand all | Expand 10 after 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 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 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 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 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 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...) Expand 10 before | Expand all | Expand 10 after 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("PropertyCell space, used: %6" V8_PTR_PREFIX "d KB" |
| 393 ", available: %6" V8_PTR_PREFIX "d KB" |
| 394 ", committed: %6" V8_PTR_PREFIX "d KB\n", |
| 395 property_cell_space_->SizeOfObjects() / KB, |
| 396 property_cell_space_->Available() / KB, |
| 397 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...) Expand 10 before | Expand all | Expand 10 after 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_property_cell_space()-> |
| 530 AddSample(static_cast<int>( |
| 531 (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_property_cell_space_committed()-> |
| 544 AddSample(static_cast<int>( |
| 545 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(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...) Expand 10 before | Expand all | Expand 10 after 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(property_cell_space_); |
| 1393 for (HeapObject* heap_object = js_global_property_cell_iterator.Next(); |
| 1394 heap_object != NULL; |
| 1395 heap_object = js_global_property_cell_iterator.Next()) { |
| 1396 if (heap_object->IsJSGlobalPropertyCell()) { |
| 1397 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object); |
| 1398 Address value_address = cell->ValueAddress(); |
| 1399 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); |
| 1400 Address type_address = cell->TypeAddress(); |
| 1401 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(type_address)); |
| 1402 } |
| 1403 } |
| 1404 |
1368 // Copy objects reachable from the code flushing candidates list. | 1405 // Copy objects reachable from the code flushing candidates list. |
1369 MarkCompactCollector* collector = mark_compact_collector(); | 1406 MarkCompactCollector* collector = mark_compact_collector(); |
1370 if (collector->is_code_flushing_enabled()) { | 1407 if (collector->is_code_flushing_enabled()) { |
1371 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor); | 1408 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor); |
1372 } | 1409 } |
1373 | 1410 |
1374 // Scavenge object reachable from the native contexts list directly. | 1411 // Scavenge object reachable from the native contexts list directly. |
1375 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_)); | 1412 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_)); |
1376 | 1413 |
1377 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); | 1414 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 { MaybeObject* maybe_obj = AllocateEmptyExternalArray(kExternalPixelArray); | 2693 { MaybeObject* maybe_obj = AllocateEmptyExternalArray(kExternalPixelArray); |
2657 if (!maybe_obj->ToObject(&obj)) return false; | 2694 if (!maybe_obj->ToObject(&obj)) return false; |
2658 } | 2695 } |
2659 set_empty_external_pixel_array(ExternalArray::cast(obj)); | 2696 set_empty_external_pixel_array(ExternalArray::cast(obj)); |
2660 | 2697 |
2661 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); | 2698 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); |
2662 if (!maybe_obj->ToObject(&obj)) return false; | 2699 if (!maybe_obj->ToObject(&obj)) return false; |
2663 } | 2700 } |
2664 set_code_map(Map::cast(obj)); | 2701 set_code_map(Map::cast(obj)); |
2665 | 2702 |
2666 { MaybeObject* maybe_obj = AllocateMap(JS_GLOBAL_PROPERTY_CELL_TYPE, | 2703 { MaybeObject* maybe_obj = AllocateMap(CELL_TYPE, Cell::kSize); |
| 2704 if (!maybe_obj->ToObject(&obj)) return false; |
| 2705 } |
| 2706 set_cell_map(Map::cast(obj)); |
| 2707 |
| 2708 { MaybeObject* maybe_obj = AllocateMap(PROPERTY_CELL_TYPE, |
2667 JSGlobalPropertyCell::kSize); | 2709 JSGlobalPropertyCell::kSize); |
2668 if (!maybe_obj->ToObject(&obj)) return false; | 2710 if (!maybe_obj->ToObject(&obj)) return false; |
2669 } | 2711 } |
2670 set_global_property_cell_map(Map::cast(obj)); | 2712 set_global_property_cell_map(Map::cast(obj)); |
2671 | 2713 |
2672 { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, kPointerSize); | 2714 { MaybeObject* maybe_obj = AllocateMap(FILLER_TYPE, kPointerSize); |
2673 if (!maybe_obj->ToObject(&obj)) return false; | 2715 if (!maybe_obj->ToObject(&obj)) return false; |
2674 } | 2716 } |
2675 set_one_pointer_filler_map(Map::cast(obj)); | 2717 set_one_pointer_filler_map(Map::cast(obj)); |
2676 | 2718 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2791 Object* result; | 2833 Object* result; |
2792 { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize); | 2834 { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize); |
2793 if (!maybe_result->ToObject(&result)) return maybe_result; | 2835 if (!maybe_result->ToObject(&result)) return maybe_result; |
2794 } | 2836 } |
2795 HeapObject::cast(result)->set_map_no_write_barrier(heap_number_map()); | 2837 HeapObject::cast(result)->set_map_no_write_barrier(heap_number_map()); |
2796 HeapNumber::cast(result)->set_value(value); | 2838 HeapNumber::cast(result)->set_value(value); |
2797 return result; | 2839 return result; |
2798 } | 2840 } |
2799 | 2841 |
2800 | 2842 |
| 2843 MaybeObject* Heap::AllocateCell(Object* value) { |
| 2844 Object* result; |
| 2845 { MaybeObject* maybe_result = AllocateRawCell(); |
| 2846 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 2847 } |
| 2848 HeapObject::cast(result)->set_map_no_write_barrier(cell_map()); |
| 2849 Cell::cast(result)->set_value(value); |
| 2850 return result; |
| 2851 } |
| 2852 |
| 2853 |
2801 MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) { | 2854 MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) { |
2802 Object* result; | 2855 Object* result; |
2803 { MaybeObject* maybe_result = AllocateRawCell(); | 2856 { MaybeObject* maybe_result = AllocateRawJSGlobalPropertyCell(); |
2804 if (!maybe_result->ToObject(&result)) return maybe_result; | 2857 if (!maybe_result->ToObject(&result)) return maybe_result; |
2805 } | 2858 } |
2806 HeapObject::cast(result)->set_map_no_write_barrier( | 2859 HeapObject::cast(result)->set_map_no_write_barrier( |
2807 global_property_cell_map()); | 2860 global_property_cell_map()); |
2808 JSGlobalPropertyCell::cast(result)->set_value(value); | 2861 JSGlobalPropertyCell::cast(result)->set_value(value); |
| 2862 JSGlobalPropertyCell::cast(result)->set_type(Type::None()); |
2809 return result; | 2863 return result; |
2810 } | 2864 } |
2811 | 2865 |
2812 | 2866 |
2813 MaybeObject* Heap::AllocateBox(Object* value, PretenureFlag pretenure) { | 2867 MaybeObject* Heap::AllocateBox(Object* value, PretenureFlag pretenure) { |
2814 Box* result; | 2868 Box* result; |
2815 MaybeObject* maybe_result = AllocateStruct(BOX_TYPE); | 2869 MaybeObject* maybe_result = AllocateStruct(BOX_TYPE); |
2816 if (!maybe_result->To(&result)) return maybe_result; | 2870 if (!maybe_result->To(&result)) return maybe_result; |
2817 result->set_value(value); | 2871 result->set_value(value); |
2818 return result; | 2872 return result; |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4462 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); | 4516 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); |
4463 if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; | 4517 if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; |
4464 } | 4518 } |
4465 constructor->set_initial_map(Map::cast(initial_map)); | 4519 constructor->set_initial_map(Map::cast(initial_map)); |
4466 Map::cast(initial_map)->set_constructor(constructor); | 4520 Map::cast(initial_map)->set_constructor(constructor); |
4467 } | 4521 } |
4468 // Allocate the object based on the constructors initial map, or the payload | 4522 // Allocate the object based on the constructors initial map, or the payload |
4469 // advice | 4523 // advice |
4470 Map* initial_map = constructor->initial_map(); | 4524 Map* initial_map = constructor->initial_map(); |
4471 | 4525 |
4472 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( | 4526 Cell* cell = Cell::cast(*allocation_site_info_payload); |
4473 *allocation_site_info_payload); | |
4474 Smi* smi = Smi::cast(cell->value()); | 4527 Smi* smi = Smi::cast(cell->value()); |
4475 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); | 4528 ElementsKind to_kind = static_cast<ElementsKind>(smi->value()); |
4476 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; | 4529 AllocationSiteMode mode = TRACK_ALLOCATION_SITE; |
4477 if (to_kind != initial_map->elements_kind()) { | 4530 if (to_kind != initial_map->elements_kind()) { |
4478 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind); | 4531 MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind); |
4479 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; | 4532 if (!maybe_new_map->To(&initial_map)) return maybe_new_map; |
4480 // Possibly alter the mode, since we found an updated elements kind | 4533 // Possibly alter the mode, since we found an updated elements kind |
4481 // in the type info cell. | 4534 // in the type info cell. |
4482 mode = AllocationSiteInfo::GetMode(to_kind); | 4535 mode = AllocationSiteInfo::GetMode(to_kind); |
4483 } | 4536 } |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6045 PrintF("Old pointer space : "); | 6098 PrintF("Old pointer space : "); |
6046 old_pointer_space_->ReportStatistics(); | 6099 old_pointer_space_->ReportStatistics(); |
6047 PrintF("Old data space : "); | 6100 PrintF("Old data space : "); |
6048 old_data_space_->ReportStatistics(); | 6101 old_data_space_->ReportStatistics(); |
6049 PrintF("Code space : "); | 6102 PrintF("Code space : "); |
6050 code_space_->ReportStatistics(); | 6103 code_space_->ReportStatistics(); |
6051 PrintF("Map space : "); | 6104 PrintF("Map space : "); |
6052 map_space_->ReportStatistics(); | 6105 map_space_->ReportStatistics(); |
6053 PrintF("Cell space : "); | 6106 PrintF("Cell space : "); |
6054 cell_space_->ReportStatistics(); | 6107 cell_space_->ReportStatistics(); |
| 6108 PrintF("JSGlobalPropertyCell space : "); |
| 6109 property_cell_space_->ReportStatistics(); |
6055 PrintF("Large object space : "); | 6110 PrintF("Large object space : "); |
6056 lo_space_->ReportStatistics(); | 6111 lo_space_->ReportStatistics(); |
6057 PrintF(">>>>>> ========================================= >>>>>>\n"); | 6112 PrintF(">>>>>> ========================================= >>>>>>\n"); |
6058 } | 6113 } |
6059 | 6114 |
6060 #endif // DEBUG | 6115 #endif // DEBUG |
6061 | 6116 |
6062 bool Heap::Contains(HeapObject* value) { | 6117 bool Heap::Contains(HeapObject* value) { |
6063 return Contains(value->address()); | 6118 return Contains(value->address()); |
6064 } | 6119 } |
6065 | 6120 |
6066 | 6121 |
6067 bool Heap::Contains(Address addr) { | 6122 bool Heap::Contains(Address addr) { |
6068 if (OS::IsOutsideAllocatedSpace(addr)) return false; | 6123 if (OS::IsOutsideAllocatedSpace(addr)) return false; |
6069 return HasBeenSetUp() && | 6124 return HasBeenSetUp() && |
6070 (new_space_.ToSpaceContains(addr) || | 6125 (new_space_.ToSpaceContains(addr) || |
6071 old_pointer_space_->Contains(addr) || | 6126 old_pointer_space_->Contains(addr) || |
6072 old_data_space_->Contains(addr) || | 6127 old_data_space_->Contains(addr) || |
6073 code_space_->Contains(addr) || | 6128 code_space_->Contains(addr) || |
6074 map_space_->Contains(addr) || | 6129 map_space_->Contains(addr) || |
6075 cell_space_->Contains(addr) || | 6130 cell_space_->Contains(addr) || |
| 6131 property_cell_space_->Contains(addr) || |
6076 lo_space_->SlowContains(addr)); | 6132 lo_space_->SlowContains(addr)); |
6077 } | 6133 } |
6078 | 6134 |
6079 | 6135 |
6080 bool Heap::InSpace(HeapObject* value, AllocationSpace space) { | 6136 bool Heap::InSpace(HeapObject* value, AllocationSpace space) { |
6081 return InSpace(value->address(), space); | 6137 return InSpace(value->address(), space); |
6082 } | 6138 } |
6083 | 6139 |
6084 | 6140 |
6085 bool Heap::InSpace(Address addr, AllocationSpace space) { | 6141 bool Heap::InSpace(Address addr, AllocationSpace space) { |
6086 if (OS::IsOutsideAllocatedSpace(addr)) return false; | 6142 if (OS::IsOutsideAllocatedSpace(addr)) return false; |
6087 if (!HasBeenSetUp()) return false; | 6143 if (!HasBeenSetUp()) return false; |
6088 | 6144 |
6089 switch (space) { | 6145 switch (space) { |
6090 case NEW_SPACE: | 6146 case NEW_SPACE: |
6091 return new_space_.ToSpaceContains(addr); | 6147 return new_space_.ToSpaceContains(addr); |
6092 case OLD_POINTER_SPACE: | 6148 case OLD_POINTER_SPACE: |
6093 return old_pointer_space_->Contains(addr); | 6149 return old_pointer_space_->Contains(addr); |
6094 case OLD_DATA_SPACE: | 6150 case OLD_DATA_SPACE: |
6095 return old_data_space_->Contains(addr); | 6151 return old_data_space_->Contains(addr); |
6096 case CODE_SPACE: | 6152 case CODE_SPACE: |
6097 return code_space_->Contains(addr); | 6153 return code_space_->Contains(addr); |
6098 case MAP_SPACE: | 6154 case MAP_SPACE: |
6099 return map_space_->Contains(addr); | 6155 return map_space_->Contains(addr); |
6100 case CELL_SPACE: | 6156 case CELL_SPACE: |
6101 return cell_space_->Contains(addr); | 6157 return cell_space_->Contains(addr); |
| 6158 case PROPERTY_CELL_SPACE: |
| 6159 return property_cell_space_->Contains(addr); |
6102 case LO_SPACE: | 6160 case LO_SPACE: |
6103 return lo_space_->SlowContains(addr); | 6161 return lo_space_->SlowContains(addr); |
6104 } | 6162 } |
6105 | 6163 |
6106 return false; | 6164 return false; |
6107 } | 6165 } |
6108 | 6166 |
6109 | 6167 |
6110 #ifdef VERIFY_HEAP | 6168 #ifdef VERIFY_HEAP |
6111 void Heap::Verify() { | 6169 void Heap::Verify() { |
6112 CHECK(HasBeenSetUp()); | 6170 CHECK(HasBeenSetUp()); |
6113 | 6171 |
6114 store_buffer()->Verify(); | 6172 store_buffer()->Verify(); |
6115 | 6173 |
6116 VerifyPointersVisitor visitor; | 6174 VerifyPointersVisitor visitor; |
6117 IterateRoots(&visitor, VISIT_ONLY_STRONG); | 6175 IterateRoots(&visitor, VISIT_ONLY_STRONG); |
6118 | 6176 |
6119 new_space_.Verify(); | 6177 new_space_.Verify(); |
6120 | 6178 |
6121 old_pointer_space_->Verify(&visitor); | 6179 old_pointer_space_->Verify(&visitor); |
6122 map_space_->Verify(&visitor); | 6180 map_space_->Verify(&visitor); |
6123 | 6181 |
6124 VerifyPointersVisitor no_dirty_regions_visitor; | 6182 VerifyPointersVisitor no_dirty_regions_visitor; |
6125 old_data_space_->Verify(&no_dirty_regions_visitor); | 6183 old_data_space_->Verify(&no_dirty_regions_visitor); |
6126 code_space_->Verify(&no_dirty_regions_visitor); | 6184 code_space_->Verify(&no_dirty_regions_visitor); |
6127 cell_space_->Verify(&no_dirty_regions_visitor); | 6185 cell_space_->Verify(&no_dirty_regions_visitor); |
| 6186 property_cell_space_->Verify(&no_dirty_regions_visitor); |
6128 | 6187 |
6129 lo_space_->Verify(); | 6188 lo_space_->Verify(); |
6130 } | 6189 } |
6131 #endif | 6190 #endif |
6132 | 6191 |
6133 | 6192 |
6134 MaybeObject* Heap::InternalizeUtf8String(Vector<const char> string) { | 6193 MaybeObject* Heap::InternalizeUtf8String(Vector<const char> string) { |
6135 Object* result = NULL; | 6194 Object* result = NULL; |
6136 Object* new_table; | 6195 Object* new_table; |
6137 { MaybeObject* maybe_new_table = | 6196 { MaybeObject* maybe_new_table = |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6617 *stats->old_pointer_space_size = old_pointer_space_->SizeOfObjects(); | 6676 *stats->old_pointer_space_size = old_pointer_space_->SizeOfObjects(); |
6618 *stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); | 6677 *stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); |
6619 *stats->old_data_space_size = old_data_space_->SizeOfObjects(); | 6678 *stats->old_data_space_size = old_data_space_->SizeOfObjects(); |
6620 *stats->old_data_space_capacity = old_data_space_->Capacity(); | 6679 *stats->old_data_space_capacity = old_data_space_->Capacity(); |
6621 *stats->code_space_size = code_space_->SizeOfObjects(); | 6680 *stats->code_space_size = code_space_->SizeOfObjects(); |
6622 *stats->code_space_capacity = code_space_->Capacity(); | 6681 *stats->code_space_capacity = code_space_->Capacity(); |
6623 *stats->map_space_size = map_space_->SizeOfObjects(); | 6682 *stats->map_space_size = map_space_->SizeOfObjects(); |
6624 *stats->map_space_capacity = map_space_->Capacity(); | 6683 *stats->map_space_capacity = map_space_->Capacity(); |
6625 *stats->cell_space_size = cell_space_->SizeOfObjects(); | 6684 *stats->cell_space_size = cell_space_->SizeOfObjects(); |
6626 *stats->cell_space_capacity = cell_space_->Capacity(); | 6685 *stats->cell_space_capacity = cell_space_->Capacity(); |
| 6686 *stats->property_cell_space_size = property_cell_space_->SizeOfObjects(); |
| 6687 *stats->property_cell_space_capacity = property_cell_space_->Capacity(); |
6627 *stats->lo_space_size = lo_space_->Size(); | 6688 *stats->lo_space_size = lo_space_->Size(); |
6628 isolate_->global_handles()->RecordStats(stats); | 6689 isolate_->global_handles()->RecordStats(stats); |
6629 *stats->memory_allocator_size = isolate()->memory_allocator()->Size(); | 6690 *stats->memory_allocator_size = isolate()->memory_allocator()->Size(); |
6630 *stats->memory_allocator_capacity = | 6691 *stats->memory_allocator_capacity = |
6631 isolate()->memory_allocator()->Size() + | 6692 isolate()->memory_allocator()->Size() + |
6632 isolate()->memory_allocator()->Available(); | 6693 isolate()->memory_allocator()->Available(); |
6633 *stats->os_error = OS::GetLastError(); | 6694 *stats->os_error = OS::GetLastError(); |
6634 isolate()->memory_allocator()->Available(); | 6695 isolate()->memory_allocator()->Available(); |
6635 if (take_snapshot) { | 6696 if (take_snapshot) { |
6636 HeapIterator iterator(this); | 6697 HeapIterator iterator(this); |
6637 for (HeapObject* obj = iterator.next(); | 6698 for (HeapObject* obj = iterator.next(); |
6638 obj != NULL; | 6699 obj != NULL; |
6639 obj = iterator.next()) { | 6700 obj = iterator.next()) { |
6640 InstanceType type = obj->map()->instance_type(); | 6701 InstanceType type = obj->map()->instance_type(); |
6641 ASSERT(0 <= type && type <= LAST_TYPE); | 6702 ASSERT(0 <= type && type <= LAST_TYPE); |
6642 stats->objects_per_type[type]++; | 6703 stats->objects_per_type[type]++; |
6643 stats->size_per_type[type] += obj->Size(); | 6704 stats->size_per_type[type] += obj->Size(); |
6644 } | 6705 } |
6645 } | 6706 } |
6646 } | 6707 } |
6647 | 6708 |
6648 | 6709 |
6649 intptr_t Heap::PromotedSpaceSizeOfObjects() { | 6710 intptr_t Heap::PromotedSpaceSizeOfObjects() { |
6650 return old_pointer_space_->SizeOfObjects() | 6711 return old_pointer_space_->SizeOfObjects() |
6651 + old_data_space_->SizeOfObjects() | 6712 + old_data_space_->SizeOfObjects() |
6652 + code_space_->SizeOfObjects() | 6713 + code_space_->SizeOfObjects() |
6653 + map_space_->SizeOfObjects() | 6714 + map_space_->SizeOfObjects() |
6654 + cell_space_->SizeOfObjects() | 6715 + cell_space_->SizeOfObjects() |
| 6716 + property_cell_space_->SizeOfObjects() |
6655 + lo_space_->SizeOfObjects(); | 6717 + lo_space_->SizeOfObjects(); |
6656 } | 6718 } |
6657 | 6719 |
6658 | 6720 |
6659 intptr_t Heap::PromotedExternalMemorySize() { | 6721 intptr_t Heap::PromotedExternalMemorySize() { |
6660 if (amount_of_external_allocated_memory_ | 6722 if (amount_of_external_allocated_memory_ |
6661 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; | 6723 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; |
6662 return amount_of_external_allocated_memory_ | 6724 return amount_of_external_allocated_memory_ |
6663 - amount_of_external_allocated_memory_at_last_global_gc_; | 6725 - amount_of_external_allocated_memory_at_last_global_gc_; |
6664 } | 6726 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6733 code_space_ = | 6795 code_space_ = |
6734 new OldSpace(this, max_old_generation_size_, CODE_SPACE, EXECUTABLE); | 6796 new OldSpace(this, max_old_generation_size_, CODE_SPACE, EXECUTABLE); |
6735 if (code_space_ == NULL) return false; | 6797 if (code_space_ == NULL) return false; |
6736 if (!code_space_->SetUp()) return false; | 6798 if (!code_space_->SetUp()) return false; |
6737 | 6799 |
6738 // Initialize map space. | 6800 // Initialize map space. |
6739 map_space_ = new MapSpace(this, max_old_generation_size_, MAP_SPACE); | 6801 map_space_ = new MapSpace(this, max_old_generation_size_, MAP_SPACE); |
6740 if (map_space_ == NULL) return false; | 6802 if (map_space_ == NULL) return false; |
6741 if (!map_space_->SetUp()) return false; | 6803 if (!map_space_->SetUp()) return false; |
6742 | 6804 |
6743 // Initialize global property cell space. | 6805 // Initialize simple cell space. |
6744 cell_space_ = new CellSpace(this, max_old_generation_size_, CELL_SPACE); | 6806 cell_space_ = new CellSpace(this, max_old_generation_size_, CELL_SPACE); |
6745 if (cell_space_ == NULL) return false; | 6807 if (cell_space_ == NULL) return false; |
6746 if (!cell_space_->SetUp()) return false; | 6808 if (!cell_space_->SetUp()) return false; |
6747 | 6809 |
| 6810 // Initialize global property cell space. |
| 6811 property_cell_space_ = new PropertyCellSpace(this, max_old_generation_size_, |
| 6812 PROPERTY_CELL_SPACE); |
| 6813 if (property_cell_space_ == NULL) return false; |
| 6814 if (!property_cell_space_->SetUp()) return false; |
| 6815 |
6748 // The large object code space may contain code or data. We set the memory | 6816 // 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 | 6817 // to be non-executable here for safety, but this means we need to enable it |
6750 // explicitly when allocating large code objects. | 6818 // explicitly when allocating large code objects. |
6751 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE); | 6819 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE); |
6752 if (lo_space_ == NULL) return false; | 6820 if (lo_space_ == NULL) return false; |
6753 if (!lo_space_->SetUp()) return false; | 6821 if (!lo_space_->SetUp()) return false; |
6754 | 6822 |
6755 // Set up the seed that is used to randomize the string hash function. | 6823 // Set up the seed that is used to randomize the string hash function. |
6756 ASSERT(hash_seed() == 0); | 6824 ASSERT(hash_seed() == 0); |
6757 if (FLAG_randomize_hashes) { | 6825 if (FLAG_randomize_hashes) { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6858 delete map_space_; | 6926 delete map_space_; |
6859 map_space_ = NULL; | 6927 map_space_ = NULL; |
6860 } | 6928 } |
6861 | 6929 |
6862 if (cell_space_ != NULL) { | 6930 if (cell_space_ != NULL) { |
6863 cell_space_->TearDown(); | 6931 cell_space_->TearDown(); |
6864 delete cell_space_; | 6932 delete cell_space_; |
6865 cell_space_ = NULL; | 6933 cell_space_ = NULL; |
6866 } | 6934 } |
6867 | 6935 |
| 6936 if (property_cell_space_ != NULL) { |
| 6937 property_cell_space_->TearDown(); |
| 6938 delete property_cell_space_; |
| 6939 property_cell_space_ = NULL; |
| 6940 } |
| 6941 |
6868 if (lo_space_ != NULL) { | 6942 if (lo_space_ != NULL) { |
6869 lo_space_->TearDown(); | 6943 lo_space_->TearDown(); |
6870 delete lo_space_; | 6944 delete lo_space_; |
6871 lo_space_ = NULL; | 6945 lo_space_ = NULL; |
6872 } | 6946 } |
6873 | 6947 |
6874 store_buffer()->TearDown(); | 6948 store_buffer()->TearDown(); |
6875 incremental_marking()->TearDown(); | 6949 incremental_marking()->TearDown(); |
6876 | 6950 |
6877 isolate_->memory_allocator()->TearDown(); | 6951 isolate_->memory_allocator()->TearDown(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6948 case OLD_POINTER_SPACE: | 7022 case OLD_POINTER_SPACE: |
6949 return heap_->old_pointer_space(); | 7023 return heap_->old_pointer_space(); |
6950 case OLD_DATA_SPACE: | 7024 case OLD_DATA_SPACE: |
6951 return heap_->old_data_space(); | 7025 return heap_->old_data_space(); |
6952 case CODE_SPACE: | 7026 case CODE_SPACE: |
6953 return heap_->code_space(); | 7027 return heap_->code_space(); |
6954 case MAP_SPACE: | 7028 case MAP_SPACE: |
6955 return heap_->map_space(); | 7029 return heap_->map_space(); |
6956 case CELL_SPACE: | 7030 case CELL_SPACE: |
6957 return heap_->cell_space(); | 7031 return heap_->cell_space(); |
| 7032 case PROPERTY_CELL_SPACE: |
| 7033 return heap_->property_cell_space(); |
6958 case LO_SPACE: | 7034 case LO_SPACE: |
6959 return heap_->lo_space(); | 7035 return heap_->lo_space(); |
6960 default: | 7036 default: |
6961 return NULL; | 7037 return NULL; |
6962 } | 7038 } |
6963 } | 7039 } |
6964 | 7040 |
6965 | 7041 |
6966 PagedSpace* PagedSpaces::next() { | 7042 PagedSpace* PagedSpaces::next() { |
6967 switch (counter_++) { | 7043 switch (counter_++) { |
6968 case OLD_POINTER_SPACE: | 7044 case OLD_POINTER_SPACE: |
6969 return heap_->old_pointer_space(); | 7045 return heap_->old_pointer_space(); |
6970 case OLD_DATA_SPACE: | 7046 case OLD_DATA_SPACE: |
6971 return heap_->old_data_space(); | 7047 return heap_->old_data_space(); |
6972 case CODE_SPACE: | 7048 case CODE_SPACE: |
6973 return heap_->code_space(); | 7049 return heap_->code_space(); |
6974 case MAP_SPACE: | 7050 case MAP_SPACE: |
6975 return heap_->map_space(); | 7051 return heap_->map_space(); |
6976 case CELL_SPACE: | 7052 case CELL_SPACE: |
6977 return heap_->cell_space(); | 7053 return heap_->cell_space(); |
| 7054 case PROPERTY_CELL_SPACE: |
| 7055 return heap_->property_cell_space(); |
6978 default: | 7056 default: |
6979 return NULL; | 7057 return NULL; |
6980 } | 7058 } |
6981 } | 7059 } |
6982 | 7060 |
6983 | 7061 |
6984 | 7062 |
6985 OldSpace* OldSpaces::next() { | 7063 OldSpace* OldSpaces::next() { |
6986 switch (counter_++) { | 7064 switch (counter_++) { |
6987 case OLD_POINTER_SPACE: | 7065 case OLD_POINTER_SPACE: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7057 break; | 7135 break; |
7058 case CODE_SPACE: | 7136 case CODE_SPACE: |
7059 iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_); | 7137 iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_); |
7060 break; | 7138 break; |
7061 case MAP_SPACE: | 7139 case MAP_SPACE: |
7062 iterator_ = new HeapObjectIterator(heap_->map_space(), size_func_); | 7140 iterator_ = new HeapObjectIterator(heap_->map_space(), size_func_); |
7063 break; | 7141 break; |
7064 case CELL_SPACE: | 7142 case CELL_SPACE: |
7065 iterator_ = new HeapObjectIterator(heap_->cell_space(), size_func_); | 7143 iterator_ = new HeapObjectIterator(heap_->cell_space(), size_func_); |
7066 break; | 7144 break; |
| 7145 case PROPERTY_CELL_SPACE: |
| 7146 iterator_ = new HeapObjectIterator(heap_->property_cell_space(), |
| 7147 size_func_); |
| 7148 break; |
7067 case LO_SPACE: | 7149 case LO_SPACE: |
7068 iterator_ = new LargeObjectIterator(heap_->lo_space(), size_func_); | 7150 iterator_ = new LargeObjectIterator(heap_->lo_space(), size_func_); |
7069 break; | 7151 break; |
7070 } | 7152 } |
7071 | 7153 |
7072 // Return the newly allocated iterator; | 7154 // Return the newly allocated iterator; |
7073 ASSERT(iterator_ != NULL); | 7155 ASSERT(iterator_ != NULL); |
7074 return iterator_; | 7156 return iterator_; |
7075 } | 7157 } |
7076 | 7158 |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8014 if (FLAG_parallel_recompilation) { | 8096 if (FLAG_parallel_recompilation) { |
8015 heap_->relocation_mutex_->Lock(); | 8097 heap_->relocation_mutex_->Lock(); |
8016 #ifdef DEBUG | 8098 #ifdef DEBUG |
8017 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8099 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
8018 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8100 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
8019 #endif // DEBUG | 8101 #endif // DEBUG |
8020 } | 8102 } |
8021 } | 8103 } |
8022 | 8104 |
8023 } } // namespace v8::internal | 8105 } } // namespace v8::internal |
OLD | NEW |