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

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

Issue 183883011: Differentate between code target pointers and heap pointers in constant pools. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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-printer.cc ('k') | test/cctest/test-constantpool.cc » ('j') | 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 index = constant_pool->first_code_ptr_index() + i;
494 constant_pool->first_ptr_index()); 494 Address code_entry =
495 int last_ptr_offset = constant_pool->OffsetOfElementAt( 495 reinterpret_cast<Address>(constant_pool->RawFieldOfElementAt(index));
496 constant_pool->first_ptr_index() + 496 StaticVisitor::VisitCodeEntry(heap, code_entry);
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 index = constant_pool->first_heap_ptr_index() + i;
500 HeapObject::RawField(object, first_ptr_offset), 500 StaticVisitor::VisitPointer(heap,
501 HeapObject::RawField(object, last_ptr_offset)); 501 constant_pool->RawFieldOfElementAt(index));
502 } 502 }
503 } 503 }
504 504
505 505
506 template<typename StaticVisitor> 506 template<typename StaticVisitor>
507 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction( 507 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(
508 Map* map, HeapObject* object) { 508 Map* map, HeapObject* object) {
509 Heap* heap = map->GetHeap(); 509 Heap* heap = map->GetHeap();
510 JSFunction* function = JSFunction::cast(object); 510 JSFunction* function = JSFunction::cast(object);
511 MarkCompactCollector* collector = heap->mark_compact_collector(); 511 MarkCompactCollector* collector = heap->mark_compact_collector();
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 RelocIterator it(this, mode_mask); 940 RelocIterator it(this, mode_mask);
941 for (; !it.done(); it.next()) { 941 for (; !it.done(); it.next()) {
942 it.rinfo()->template Visit<StaticVisitor>(heap); 942 it.rinfo()->template Visit<StaticVisitor>(heap);
943 } 943 }
944 } 944 }
945 945
946 946
947 } } // namespace v8::internal 947 } } // namespace v8::internal
948 948
949 #endif // V8_OBJECTS_VISITING_INL_H_ 949 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | test/cctest/test-constantpool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698