OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 | 1892 |
1893 AllocationSpace Serializer::SpaceOfObject(HeapObject* object) { | 1893 AllocationSpace Serializer::SpaceOfObject(HeapObject* object) { |
1894 for (int i = FIRST_SPACE; i <= LAST_SPACE; i++) { | 1894 for (int i = FIRST_SPACE; i <= LAST_SPACE; i++) { |
1895 AllocationSpace s = static_cast<AllocationSpace>(i); | 1895 AllocationSpace s = static_cast<AllocationSpace>(i); |
1896 if (object->GetHeap()->InSpace(object, s)) { | 1896 if (object->GetHeap()->InSpace(object, s)) { |
1897 DCHECK(i < kNumberOfSpaces); | 1897 DCHECK(i < kNumberOfSpaces); |
1898 return s; | 1898 return s; |
1899 } | 1899 } |
1900 } | 1900 } |
1901 UNREACHABLE(); | 1901 UNREACHABLE(); |
1902 return INVALID_SPACE; | 1902 return FIRST_SPACE; |
1903 } | 1903 } |
1904 | 1904 |
1905 | 1905 |
1906 BackReference Serializer::AllocateLargeObject(int size) { | 1906 BackReference Serializer::AllocateLargeObject(int size) { |
1907 // Large objects are allocated one-by-one when deserializing. We do not | 1907 // Large objects are allocated one-by-one when deserializing. We do not |
1908 // have to keep track of multiple chunks. | 1908 // have to keep track of multiple chunks. |
1909 pending_chunk_[LO_SPACE] += size; | 1909 pending_chunk_[LO_SPACE] += size; |
1910 return BackReference::LargeObjectReference(seen_large_objects_index_++); | 1910 return BackReference::LargeObjectReference(seen_large_objects_index_++); |
1911 } | 1911 } |
1912 | 1912 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 | 2324 |
2325 int SerializedCodeData::CheckSum(String* string) { | 2325 int SerializedCodeData::CheckSum(String* string) { |
2326 int checksum = Version::Hash(); | 2326 int checksum = Version::Hash(); |
2327 #ifdef DEBUG | 2327 #ifdef DEBUG |
2328 uint32_t seed = static_cast<uint32_t>(checksum); | 2328 uint32_t seed = static_cast<uint32_t>(checksum); |
2329 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 2329 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
2330 #endif // DEBUG | 2330 #endif // DEBUG |
2331 return checksum; | 2331 return checksum; |
2332 } | 2332 } |
2333 } } // namespace v8::internal | 2333 } } // namespace v8::internal |
OLD | NEW |