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

Side by Side Diff: src/spaces.cc

Issue 115073: Changed size of pointers stored as numbers to intptr_t in spaces.h. (Closed)
Patch Set: Created 11 years, 7 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 | « src/spaces.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 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 } 804 }
805 if (!from_space_.Setup(start + maximum_capacity_, 805 if (!from_space_.Setup(start + maximum_capacity_,
806 capacity_, 806 capacity_,
807 maximum_capacity_)) { 807 maximum_capacity_)) {
808 return false; 808 return false;
809 } 809 }
810 810
811 start_ = start; 811 start_ = start;
812 address_mask_ = ~(size - 1); 812 address_mask_ = ~(size - 1);
813 object_mask_ = address_mask_ | kHeapObjectTag; 813 object_mask_ = address_mask_ | kHeapObjectTag;
814 object_expected_ = reinterpret_cast<uint32_t>(start) | kHeapObjectTag; 814 object_expected_ = reinterpret_cast<uintptr_t>(start) | kHeapObjectTag;
815 815
816 allocation_info_.top = to_space_.low(); 816 allocation_info_.top = to_space_.low();
817 allocation_info_.limit = to_space_.high(); 817 allocation_info_.limit = to_space_.high();
818 mc_forwarding_info_.top = NULL; 818 mc_forwarding_info_.top = NULL;
819 mc_forwarding_info_.limit = NULL; 819 mc_forwarding_info_.limit = NULL;
820 820
821 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); 821 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
822 return true; 822 return true;
823 } 823 }
824 824
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 capacity_ = initial_capacity; 963 capacity_ = initial_capacity;
964 maximum_capacity_ = maximum_capacity; 964 maximum_capacity_ = maximum_capacity;
965 965
966 if (!MemoryAllocator::CommitBlock(start, capacity_, executable())) { 966 if (!MemoryAllocator::CommitBlock(start, capacity_, executable())) {
967 return false; 967 return false;
968 } 968 }
969 969
970 start_ = start; 970 start_ = start;
971 address_mask_ = ~(maximum_capacity - 1); 971 address_mask_ = ~(maximum_capacity - 1);
972 object_mask_ = address_mask_ | kHeapObjectTag; 972 object_mask_ = address_mask_ | kHeapObjectTag;
973 object_expected_ = reinterpret_cast<uint32_t>(start) | kHeapObjectTag; 973 object_expected_ = reinterpret_cast<uintptr_t>(start) | kHeapObjectTag;
974 974
975 age_mark_ = start_; 975 age_mark_ = start_;
976 return true; 976 return true;
977 } 977 }
978 978
979 979
980 void SemiSpace::TearDown() { 980 void SemiSpace::TearDown() {
981 start_ = NULL; 981 start_ = NULL;
982 capacity_ = 0; 982 capacity_ = 0;
983 } 983 }
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 // to the pointers starting at object_p. The allocation_top is an object 1883 // to the pointers starting at object_p. The allocation_top is an object
1884 // pointer which should not be read past. This is important for large object 1884 // pointer which should not be read past. This is important for large object
1885 // pages, where some bits in the remembered set range do not correspond to 1885 // pages, where some bits in the remembered set range do not correspond to
1886 // allocated addresses. 1886 // allocated addresses.
1887 static void PrintRSetRange(Address start, Address end, Object** object_p, 1887 static void PrintRSetRange(Address start, Address end, Object** object_p,
1888 Address allocation_top) { 1888 Address allocation_top) {
1889 Address rset_address = start; 1889 Address rset_address = start;
1890 1890
1891 // If the range starts on on odd numbered word (eg, for large object extra 1891 // If the range starts on on odd numbered word (eg, for large object extra
1892 // remembered set ranges), print some spaces. 1892 // remembered set ranges), print some spaces.
1893 if ((reinterpret_cast<uint32_t>(start) / kIntSize) % 2 == 1) { 1893 if ((reinterpret_cast<uintptr_t>(start) / kIntSize) % 2 == 1) {
1894 PrintF(" "); 1894 PrintF(" ");
1895 } 1895 }
1896 1896
1897 // Loop over all the words in the range. 1897 // Loop over all the words in the range.
1898 while (rset_address < end) { 1898 while (rset_address < end) {
1899 uint32_t rset_word = Memory::uint32_at(rset_address); 1899 uint32_t rset_word = Memory::uint32_at(rset_address);
1900 int bit_position = 0; 1900 int bit_position = 0;
1901 1901
1902 // Loop over all the bits in the word. 1902 // Loop over all the bits in the word.
1903 while (bit_position < kBitsPerInt) { 1903 while (bit_position < kBitsPerInt) {
(...skipping 18 matching lines...) Expand all
1922 if (bit_position % 8 == 7 && bit_position != (kBitsPerInt - 1)) { 1922 if (bit_position % 8 == 7 && bit_position != (kBitsPerInt - 1)) {
1923 PrintF(" "); 1923 PrintF(" ");
1924 } 1924 }
1925 1925
1926 // Advance to next bit. 1926 // Advance to next bit.
1927 bit_position++; 1927 bit_position++;
1928 object_p++; 1928 object_p++;
1929 } 1929 }
1930 1930
1931 // Print a newline after every odd numbered word, otherwise a space. 1931 // Print a newline after every odd numbered word, otherwise a space.
1932 if ((reinterpret_cast<uint32_t>(rset_address) / kIntSize) % 2 == 1) { 1932 if ((reinterpret_cast<uintptr_t>(rset_address) / kIntSize) % 2 == 1) {
1933 PrintF("\n"); 1933 PrintF("\n");
1934 } else { 1934 } else {
1935 PrintF(" "); 1935 PrintF(" ");
1936 } 1936 }
1937 1937
1938 // Advance to next remembered set word. 1938 // Advance to next remembered set word.
1939 rset_address += kIntSize; 1939 rset_address += kIntSize;
1940 } 1940 }
1941 } 1941 }
1942 1942
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 reinterpret_cast<Object**>(object->address() 2590 reinterpret_cast<Object**>(object->address()
2591 + Page::kObjectAreaSize), 2591 + Page::kObjectAreaSize),
2592 allocation_top); 2592 allocation_top);
2593 PrintF("\n"); 2593 PrintF("\n");
2594 } 2594 }
2595 } 2595 }
2596 } 2596 }
2597 #endif // DEBUG 2597 #endif // DEBUG
2598 2598
2599 } } // namespace v8::internal 2599 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698