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

Side by Side Diff: src/spaces.cc

Issue 1175001: Fix LargeObjectSpace::Contains to check if addr is in new space. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « no previous file | test/cctest/test-heap.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 page_count_--; 2742 page_count_--;
2743 MemoryAllocator::FreeRawMemory(chunk_address, chunk_size); 2743 MemoryAllocator::FreeRawMemory(chunk_address, chunk_size);
2744 LOG(DeleteEvent("LargeObjectChunk", chunk_address)); 2744 LOG(DeleteEvent("LargeObjectChunk", chunk_address));
2745 } 2745 }
2746 } 2746 }
2747 } 2747 }
2748 2748
2749 2749
2750 bool LargeObjectSpace::Contains(HeapObject* object) { 2750 bool LargeObjectSpace::Contains(HeapObject* object) {
2751 Address address = object->address(); 2751 Address address = object->address();
2752 if (Heap::new_space()->Contains(address)) {
2753 return false;
2754 }
2752 Page* page = Page::FromAddress(address); 2755 Page* page = Page::FromAddress(address);
2753 2756
2754 SLOW_ASSERT(!page->IsLargeObjectPage() 2757 SLOW_ASSERT(!page->IsLargeObjectPage()
2755 || !FindObject(address)->IsFailure()); 2758 || !FindObject(address)->IsFailure());
2756 2759
2757 return page->IsLargeObjectPage(); 2760 return page->IsLargeObjectPage();
2758 } 2761 }
2759 2762
2760 2763
2761 #ifdef DEBUG 2764 #ifdef DEBUG
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2870 reinterpret_cast<Object**>(object->address() 2873 reinterpret_cast<Object**>(object->address()
2871 + Page::kObjectAreaSize), 2874 + Page::kObjectAreaSize),
2872 allocation_top); 2875 allocation_top);
2873 PrintF("\n"); 2876 PrintF("\n");
2874 } 2877 }
2875 } 2878 }
2876 } 2879 }
2877 #endif // DEBUG 2880 #endif // DEBUG
2878 2881
2879 } } // namespace v8::internal 2882 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698