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 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 : owns_script_data_(true) { | 2206 : owns_script_data_(true) { |
2207 DisallowHeapAllocation no_gc; | 2207 DisallowHeapAllocation no_gc; |
2208 List<uint32_t>* stub_keys = cs->stub_keys(); | 2208 List<uint32_t>* stub_keys = cs->stub_keys(); |
2209 | 2209 |
2210 // Gather reservation chunk sizes. | 2210 // Gather reservation chunk sizes. |
2211 List<uint32_t> reservations(SerializerDeserializer::kNumberOfSpaces); | 2211 List<uint32_t> reservations(SerializerDeserializer::kNumberOfSpaces); |
2212 STATIC_ASSERT(NEW_SPACE == 0); | 2212 STATIC_ASSERT(NEW_SPACE == 0); |
2213 for (int i = 0; i < SerializerDeserializer::kNumberOfSpaces; i++) { | 2213 for (int i = 0; i < SerializerDeserializer::kNumberOfSpaces; i++) { |
2214 Vector<const uint32_t> chunks = cs->FinalAllocationChunks(i); | 2214 Vector<const uint32_t> chunks = cs->FinalAllocationChunks(i); |
2215 for (int j = 0; j < chunks.length(); j++) { | 2215 for (int j = 0; j < chunks.length(); j++) { |
2216 DCHECK(i == LO_SPACE || chunks[j] < Page::kMaxRegularHeapObjectSize); | 2216 DCHECK(i == LO_SPACE || |
| 2217 chunks[j] < |
| 2218 static_cast<uint32_t>(Page::kMaxRegularHeapObjectSize)); |
2217 uint32_t chunk = ChunkSizeBits::encode(chunks[j]) | | 2219 uint32_t chunk = ChunkSizeBits::encode(chunks[j]) | |
2218 IsLastChunkBits::encode(j == chunks.length() - 1); | 2220 IsLastChunkBits::encode(j == chunks.length() - 1); |
2219 reservations.Add(chunk); | 2221 reservations.Add(chunk); |
2220 } | 2222 } |
2221 } | 2223 } |
2222 | 2224 |
2223 // Calculate sizes. | 2225 // Calculate sizes. |
2224 int reservation_size = reservations.length() * kInt32Size; | 2226 int reservation_size = reservations.length() * kInt32Size; |
2225 int num_stub_keys = stub_keys->length(); | 2227 int num_stub_keys = stub_keys->length(); |
2226 int stub_keys_size = stub_keys->length() * kInt32Size; | 2228 int stub_keys_size = stub_keys->length() * kInt32Size; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 | 2263 |
2262 int SerializedCodeData::CheckSum(String* string) { | 2264 int SerializedCodeData::CheckSum(String* string) { |
2263 int checksum = Version::Hash(); | 2265 int checksum = Version::Hash(); |
2264 #ifdef DEBUG | 2266 #ifdef DEBUG |
2265 uint32_t seed = static_cast<uint32_t>(checksum); | 2267 uint32_t seed = static_cast<uint32_t>(checksum); |
2266 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 2268 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
2267 #endif // DEBUG | 2269 #endif // DEBUG |
2268 return checksum; | 2270 return checksum; |
2269 } | 2271 } |
2270 } } // namespace v8::internal | 2272 } } // namespace v8::internal |
OLD | NEW |