Chromium Code Reviews| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 } | 482 } |
| 483 VisitSharedFunctionInfoStrongCode(heap, object); | 483 VisitSharedFunctionInfoStrongCode(heap, object); |
| 484 } | 484 } |
| 485 | 485 |
| 486 | 486 |
| 487 template<typename StaticVisitor> | 487 template<typename StaticVisitor> |
| 488 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( | 488 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
| 489 Map* map, HeapObject* object) { | 489 Map* map, HeapObject* object) { |
| 490 Heap* heap = map->GetHeap(); | 490 Heap* heap = map->GetHeap(); |
| 491 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); | 491 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); |
| 492 if (constant_pool->count_of_ptr_entries() > 0) { | 492 for (int i = 0; i < constant_pool->count_of_code_ptr_entries(); i++) { |
| 493 int first_ptr_offset = constant_pool->OffsetOfElementAt( | 493 int offset = constant_pool->OffsetOfElementAt( |
|
Michael Starzinger
2014/03/07 15:07:47
nit: Two white-spaces after equal sign.
rmcilroy
2014/03/10 14:03:05
Done.
| |
| 494 constant_pool->first_ptr_index()); | 494 constant_pool->first_code_ptr_index() + i); |
| 495 int last_ptr_offset = constant_pool->OffsetOfElementAt( | 495 StaticVisitor::VisitCodeEntry(heap, |
| 496 constant_pool->first_ptr_index() + | 496 reinterpret_cast<Address>(HeapObject::RawField(constant_pool, offset))); |
| 497 constant_pool->count_of_ptr_entries() - 1); | 497 } |
| 498 StaticVisitor::VisitPointers( | 498 for (int i = 0; i < constant_pool->count_of_heap_ptr_entries(); i++) { |
| 499 heap, | 499 int offset = constant_pool->OffsetOfElementAt( |
|
Michael Starzinger
2014/03/07 15:07:47
nit: Two white-spaces after equal sign.
rmcilroy
2014/03/10 14:03:05
Done.
| |
| 500 HeapObject::RawField(object, first_ptr_offset), | 500 constant_pool->first_heap_ptr_index() + i); |
| 501 HeapObject::RawField(object, last_ptr_offset)); | 501 StaticVisitor::VisitPointer(heap, |
| 502 HeapObject::RawField(constant_pool, offset)); | |
| 502 } | 503 } |
| 503 } | 504 } |
| 504 | 505 |
| 505 | 506 |
| 506 template<typename StaticVisitor> | 507 template<typename StaticVisitor> |
| 507 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( | 508 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( |
| 508 Map* map, HeapObject* object) { | 509 Map* map, HeapObject* object) { |
| 509 Heap* heap = map->GetHeap(); | 510 Heap* heap = map->GetHeap(); |
| 510 JSFunction* function = JSFunction::cast(object); | 511 JSFunction* function = JSFunction::cast(object); |
| 511 MarkCompactCollector* collector = heap->mark_compact_collector(); | 512 MarkCompactCollector* collector = heap->mark_compact_collector(); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 940 RelocIterator it(this, mode_mask); | 941 RelocIterator it(this, mode_mask); |
| 941 for (; !it.done(); it.next()) { | 942 for (; !it.done(); it.next()) { |
| 942 it.rinfo()->template Visit<StaticVisitor>(heap); | 943 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 943 } | 944 } |
| 944 } | 945 } |
| 945 | 946 |
| 946 | 947 |
| 947 } } // namespace v8::internal | 948 } } // namespace v8::internal |
| 948 | 949 |
| 949 #endif // V8_OBJECTS_VISITING_INL_H_ | 950 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |