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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 471 } |
472 VisitSharedFunctionInfoStrongCode(heap, object); | 472 VisitSharedFunctionInfoStrongCode(heap, object); |
473 } | 473 } |
474 | 474 |
475 | 475 |
476 template<typename StaticVisitor> | 476 template<typename StaticVisitor> |
477 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( | 477 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
478 Map* map, HeapObject* object) { | 478 Map* map, HeapObject* object) { |
479 Heap* heap = map->GetHeap(); | 479 Heap* heap = map->GetHeap(); |
480 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); | 480 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); |
481 int first_ptr_offset = constant_pool->OffsetOfElementAt( | 481 if (constant_pool->count_of_ptr_entries() > 0) { |
482 constant_pool->first_ptr_index()); | 482 int first_ptr_offset = constant_pool->OffsetOfElementAt( |
483 int last_ptr_offset = constant_pool->OffsetOfElementAt( | 483 constant_pool->first_ptr_index()); |
484 constant_pool->first_ptr_index() + constant_pool->count_of_ptr_entries()); | 484 int last_ptr_offset = constant_pool->OffsetOfElementAt( |
485 StaticVisitor::VisitPointers( | 485 constant_pool->first_ptr_index() + |
486 heap, | 486 constant_pool->count_of_ptr_entries()); |
487 HeapObject::RawField(object, first_ptr_offset), | 487 StaticVisitor::VisitPointers( |
488 HeapObject::RawField(object, last_ptr_offset)); | 488 heap, |
| 489 HeapObject::RawField(object, first_ptr_offset), |
| 490 HeapObject::RawField(object, last_ptr_offset)); |
| 491 } |
489 } | 492 } |
490 | 493 |
491 | 494 |
492 template<typename StaticVisitor> | 495 template<typename StaticVisitor> |
493 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( | 496 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( |
494 Map* map, HeapObject* object) { | 497 Map* map, HeapObject* object) { |
495 Heap* heap = map->GetHeap(); | 498 Heap* heap = map->GetHeap(); |
496 JSFunction* function = JSFunction::cast(object); | 499 JSFunction* function = JSFunction::cast(object); |
497 MarkCompactCollector* collector = heap->mark_compact_collector(); | 500 MarkCompactCollector* collector = heap->mark_compact_collector(); |
498 if (collector->is_code_flushing_enabled()) { | 501 if (collector->is_code_flushing_enabled()) { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 RelocIterator it(this, mode_mask); | 924 RelocIterator it(this, mode_mask); |
922 for (; !it.done(); it.next()) { | 925 for (; !it.done(); it.next()) { |
923 it.rinfo()->template Visit<StaticVisitor>(heap); | 926 it.rinfo()->template Visit<StaticVisitor>(heap); |
924 } | 927 } |
925 } | 928 } |
926 | 929 |
927 | 930 |
928 } } // namespace v8::internal | 931 } } // namespace v8::internal |
929 | 932 |
930 #endif // V8_OBJECTS_VISITING_INL_H_ | 933 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |