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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 table_.Register(kVisitSymbol, | 179 table_.Register(kVisitSymbol, |
180 &FixedBodyVisitor<StaticVisitor, | 180 &FixedBodyVisitor<StaticVisitor, |
181 Symbol::BodyDescriptor, | 181 Symbol::BodyDescriptor, |
182 void>::Visit); | 182 void>::Visit); |
183 | 183 |
184 table_.Register(kVisitFixedArray, &FixedArrayVisitor::Visit); | 184 table_.Register(kVisitFixedArray, &FixedArrayVisitor::Visit); |
185 | 185 |
186 table_.Register(kVisitFixedDoubleArray, &DataObjectVisitor::Visit); | 186 table_.Register(kVisitFixedDoubleArray, &DataObjectVisitor::Visit); |
187 | 187 |
| 188 table_.Register(kVisitConstantPoolArray, &VisitConstantPoolArray); |
| 189 |
188 table_.Register(kVisitNativeContext, &VisitNativeContext); | 190 table_.Register(kVisitNativeContext, &VisitNativeContext); |
189 | 191 |
190 table_.Register(kVisitAllocationSite, | 192 table_.Register(kVisitAllocationSite, |
191 &FixedBodyVisitor<StaticVisitor, | 193 &FixedBodyVisitor<StaticVisitor, |
192 AllocationSite::BodyDescriptor, | 194 AllocationSite::BodyDescriptor, |
193 void>::Visit); | 195 void>::Visit); |
194 | 196 |
195 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); | 197 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); |
196 | 198 |
197 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); | 199 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Flush optimized code map on major GCs without code flushing, | 445 // Flush optimized code map on major GCs without code flushing, |
444 // needed because cached code doesn't contain breakpoints. | 446 // needed because cached code doesn't contain breakpoints. |
445 shared->ClearOptimizedCodeMap(); | 447 shared->ClearOptimizedCodeMap(); |
446 } | 448 } |
447 } | 449 } |
448 VisitSharedFunctionInfoStrongCode(heap, object); | 450 VisitSharedFunctionInfoStrongCode(heap, object); |
449 } | 451 } |
450 | 452 |
451 | 453 |
452 template<typename StaticVisitor> | 454 template<typename StaticVisitor> |
| 455 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
| 456 Map* map, HeapObject* object) { |
| 457 Heap* heap = map->GetHeap(); |
| 458 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); |
| 459 int first_ptr_offset = constant_pool->OffsetOfElementAt( |
| 460 constant_pool->first_ptr_index()); |
| 461 int last_ptr_offset = constant_pool->OffsetOfElementAt( |
| 462 constant_pool->first_ptr_index() + constant_pool->count_of_ptr_entries()); |
| 463 StaticVisitor::VisitPointers( |
| 464 heap, |
| 465 HeapObject::RawField(object, first_ptr_offset), |
| 466 HeapObject::RawField(object, last_ptr_offset)); |
| 467 } |
| 468 |
| 469 |
| 470 template<typename StaticVisitor> |
453 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( | 471 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( |
454 Map* map, HeapObject* object) { | 472 Map* map, HeapObject* object) { |
455 Heap* heap = map->GetHeap(); | 473 Heap* heap = map->GetHeap(); |
456 JSFunction* function = JSFunction::cast(object); | 474 JSFunction* function = JSFunction::cast(object); |
457 MarkCompactCollector* collector = heap->mark_compact_collector(); | 475 MarkCompactCollector* collector = heap->mark_compact_collector(); |
458 if (collector->is_code_flushing_enabled()) { | 476 if (collector->is_code_flushing_enabled()) { |
459 if (IsFlushable(heap, function)) { | 477 if (IsFlushable(heap, function)) { |
460 // This function's code looks flushable. But we have to postpone | 478 // This function's code looks flushable. But we have to postpone |
461 // the decision until we see all functions that point to the same | 479 // the decision until we see all functions that point to the same |
462 // SharedFunctionInfo because some of them might be optimized. | 480 // SharedFunctionInfo because some of them might be optimized. |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 RelocIterator it(this, mode_mask); | 899 RelocIterator it(this, mode_mask); |
882 for (; !it.done(); it.next()) { | 900 for (; !it.done(); it.next()) { |
883 it.rinfo()->template Visit<StaticVisitor>(heap); | 901 it.rinfo()->template Visit<StaticVisitor>(heap); |
884 } | 902 } |
885 } | 903 } |
886 | 904 |
887 | 905 |
888 } } // namespace v8::internal | 906 } } // namespace v8::internal |
889 | 907 |
890 #endif // V8_OBJECTS_VISITING_INL_H_ | 908 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |