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 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 } | 1331 } |
1332 | 1332 |
1333 | 1333 |
1334 void StartupSerializer::SerializeObject( | 1334 void StartupSerializer::SerializeObject( |
1335 Object* o, | 1335 Object* o, |
1336 HowToCode how_to_code, | 1336 HowToCode how_to_code, |
1337 WhereToPoint where_to_point, | 1337 WhereToPoint where_to_point, |
1338 int skip) { | 1338 int skip) { |
1339 CHECK(o->IsHeapObject()); | 1339 CHECK(o->IsHeapObject()); |
1340 HeapObject* heap_object = HeapObject::cast(o); | 1340 HeapObject* heap_object = HeapObject::cast(o); |
| 1341 DCHECK(!heap_object->IsJSFunction()); |
1341 | 1342 |
1342 int root_index; | 1343 int root_index; |
1343 if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) { | 1344 if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) { |
1344 PutRoot(root_index, heap_object, how_to_code, where_to_point, skip); | 1345 PutRoot(root_index, heap_object, how_to_code, where_to_point, skip); |
1345 return; | 1346 return; |
1346 } | 1347 } |
1347 | 1348 |
1348 if (address_mapper_.IsMapped(heap_object)) { | 1349 if (address_mapper_.IsMapped(heap_object)) { |
1349 int space = SpaceOfObject(heap_object); | 1350 int space = SpaceOfObject(heap_object); |
1350 int address = address_mapper_.MappedTo(heap_object); | 1351 int address = address_mapper_.MappedTo(heap_object); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 | 1945 |
1945 int SerializedCodeData::CheckSum(String* string) { | 1946 int SerializedCodeData::CheckSum(String* string) { |
1946 int checksum = Version::Hash(); | 1947 int checksum = Version::Hash(); |
1947 #ifdef DEBUG | 1948 #ifdef DEBUG |
1948 uint32_t seed = static_cast<uint32_t>(checksum); | 1949 uint32_t seed = static_cast<uint32_t>(checksum); |
1949 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 1950 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
1950 #endif // DEBUG | 1951 #endif // DEBUG |
1951 return checksum; | 1952 return checksum; |
1952 } | 1953 } |
1953 } } // namespace v8::internal | 1954 } } // namespace v8::internal |
OLD | NEW |