Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: src/objects-visiting-inl.h

Issue 209473006: Ensure that we don't mark weak heap references in the constant pool array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: replace with CHECK Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 Heap* heap = map->GetHeap(); 491 Heap* heap = map->GetHeap();
492 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); 492 ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object);
493 for (int i = 0; i < constant_pool->count_of_code_ptr_entries(); i++) { 493 for (int i = 0; i < constant_pool->count_of_code_ptr_entries(); i++) {
494 int index = constant_pool->first_code_ptr_index() + i; 494 int index = constant_pool->first_code_ptr_index() + i;
495 Address code_entry = 495 Address code_entry =
496 reinterpret_cast<Address>(constant_pool->RawFieldOfElementAt(index)); 496 reinterpret_cast<Address>(constant_pool->RawFieldOfElementAt(index));
497 StaticVisitor::VisitCodeEntry(heap, code_entry); 497 StaticVisitor::VisitCodeEntry(heap, code_entry);
498 } 498 }
499 for (int i = 0; i < constant_pool->count_of_heap_ptr_entries(); i++) { 499 for (int i = 0; i < constant_pool->count_of_heap_ptr_entries(); i++) {
500 int index = constant_pool->first_heap_ptr_index() + i; 500 int index = constant_pool->first_heap_ptr_index() + i;
501 StaticVisitor::VisitPointer(heap, 501 Object** slot = constant_pool->RawFieldOfElementAt(index);
502 constant_pool->RawFieldOfElementAt(index)); 502 HeapObject* object = HeapObject::cast(*slot);
503 heap->mark_compact_collector()->RecordSlot(slot, slot, object);
504 if (!(constant_pool->get_weak_object_state() ==
505 ConstantPoolArray::WEAK_OBJECTS_IN_OPTIMIZED_CODE &&
506 Code::IsWeakObjectInOptimizedCode(object))) {
507 StaticVisitor::MarkObject(heap, object);
508 }
503 } 509 }
504 } 510 }
505 511
506 512
507 template<typename StaticVisitor> 513 template<typename StaticVisitor>
508 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( 514 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(
509 Map* map, HeapObject* object) { 515 Map* map, HeapObject* object) {
510 Heap* heap = map->GetHeap(); 516 Heap* heap = map->GetHeap();
511 JSFunction* function = JSFunction::cast(object); 517 JSFunction* function = JSFunction::cast(object);
512 MarkCompactCollector* collector = heap->mark_compact_collector(); 518 MarkCompactCollector* collector = heap->mark_compact_collector();
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 RelocIterator it(this, mode_mask); 948 RelocIterator it(this, mode_mask);
943 for (; !it.done(); it.next()) { 949 for (; !it.done(); it.next()) {
944 it.rinfo()->template Visit<StaticVisitor>(heap); 950 it.rinfo()->template Visit<StaticVisitor>(heap);
945 } 951 }
946 } 952 }
947 953
948 954
949 } } // namespace v8::internal 955 } } // namespace v8::internal
950 956
951 #endif // V8_OBJECTS_VISITING_INL_H_ 957 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698