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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 VisitSharedFunctionInfoStrongCode(heap, object); | 471 VisitSharedFunctionInfoStrongCode(heap, object); |
472 } | 472 } |
473 | 473 |
474 | 474 |
475 template<typename StaticVisitor> | 475 template<typename StaticVisitor> |
476 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( | 476 void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
477 Map* map, HeapObject* object) { | 477 Map* map, HeapObject* object) { |
478 Heap* heap = map->GetHeap(); | 478 Heap* heap = map->GetHeap(); |
479 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); | 479 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); |
480 int first_ptr_offset = constant_pool->OffsetOfElementAt( | 480 if (constant_pool->count_of_ptr_entries() > 0) { |
481 constant_pool->first_ptr_index()); | 481 int first_ptr_offset = constant_pool->OffsetOfElementAt( |
482 int last_ptr_offset = constant_pool->OffsetOfElementAt( | 482 constant_pool->first_ptr_index()); |
483 constant_pool->first_ptr_index() + constant_pool->count_of_ptr_entries()); | 483 int last_ptr_offset = constant_pool->OffsetOfElementAt( |
484 StaticVisitor::VisitPointers( | 484 constant_pool->first_ptr_index() + |
485 heap, | 485 constant_pool->count_of_ptr_entries()); |
486 HeapObject::RawField(object, first_ptr_offset), | 486 StaticVisitor::VisitPointers( |
487 HeapObject::RawField(object, last_ptr_offset)); | 487 heap, |
| 488 HeapObject::RawField(object, first_ptr_offset), |
| 489 HeapObject::RawField(object, last_ptr_offset)); |
| 490 } |
488 } | 491 } |
489 | 492 |
490 | 493 |
491 template<typename StaticVisitor> | 494 template<typename StaticVisitor> |
492 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( | 495 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( |
493 Map* map, HeapObject* object) { | 496 Map* map, HeapObject* object) { |
494 Heap* heap = map->GetHeap(); | 497 Heap* heap = map->GetHeap(); |
495 JSFunction* function = JSFunction::cast(object); | 498 JSFunction* function = JSFunction::cast(object); |
496 MarkCompactCollector* collector = heap->mark_compact_collector(); | 499 MarkCompactCollector* collector = heap->mark_compact_collector(); |
497 if (collector->is_code_flushing_enabled()) { | 500 if (collector->is_code_flushing_enabled()) { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | | 879 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | |
877 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | | 880 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | |
878 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | 881 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); |
879 | 882 |
880 // There are two places where we iterate code bodies: here and the | 883 // There are two places where we iterate code bodies: here and the |
881 // templated CodeIterateBody (below). They should be kept in sync. | 884 // templated CodeIterateBody (below). They should be kept in sync. |
882 IteratePointer(v, kRelocationInfoOffset); | 885 IteratePointer(v, kRelocationInfoOffset); |
883 IteratePointer(v, kHandlerTableOffset); | 886 IteratePointer(v, kHandlerTableOffset); |
884 IteratePointer(v, kDeoptimizationDataOffset); | 887 IteratePointer(v, kDeoptimizationDataOffset); |
885 IteratePointer(v, kTypeFeedbackInfoOffset); | 888 IteratePointer(v, kTypeFeedbackInfoOffset); |
| 889 IteratePointer(v, kConstantPoolOffset); |
886 | 890 |
887 RelocIterator it(this, mode_mask); | 891 RelocIterator it(this, mode_mask); |
888 Isolate* isolate = this->GetIsolate(); | 892 Isolate* isolate = this->GetIsolate(); |
889 for (; !it.done(); it.next()) { | 893 for (; !it.done(); it.next()) { |
890 it.rinfo()->Visit(isolate, v); | 894 it.rinfo()->Visit(isolate, v); |
891 } | 895 } |
892 } | 896 } |
893 | 897 |
894 | 898 |
895 template<typename StaticVisitor> | 899 template<typename StaticVisitor> |
(...skipping 13 matching lines...) Expand all Loading... |
909 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); | 913 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); |
910 StaticVisitor::VisitPointer( | 914 StaticVisitor::VisitPointer( |
911 heap, | 915 heap, |
912 reinterpret_cast<Object**>(this->address() + kHandlerTableOffset)); | 916 reinterpret_cast<Object**>(this->address() + kHandlerTableOffset)); |
913 StaticVisitor::VisitPointer( | 917 StaticVisitor::VisitPointer( |
914 heap, | 918 heap, |
915 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset)); | 919 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset)); |
916 StaticVisitor::VisitPointer( | 920 StaticVisitor::VisitPointer( |
917 heap, | 921 heap, |
918 reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset)); | 922 reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset)); |
| 923 StaticVisitor::VisitPointer( |
| 924 heap, |
| 925 reinterpret_cast<Object**>(this->address() + kConstantPoolOffset)); |
| 926 |
919 | 927 |
920 RelocIterator it(this, mode_mask); | 928 RelocIterator it(this, mode_mask); |
921 for (; !it.done(); it.next()) { | 929 for (; !it.done(); it.next()) { |
922 it.rinfo()->template Visit<StaticVisitor>(heap); | 930 it.rinfo()->template Visit<StaticVisitor>(heap); |
923 } | 931 } |
924 } | 932 } |
925 | 933 |
926 | 934 |
927 } } // namespace v8::internal | 935 } } // namespace v8::internal |
928 | 936 |
929 #endif // V8_OBJECTS_VISITING_INL_H_ | 937 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |