| OLD | NEW |
| 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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 HashMap::Entry* entry = | 1055 HashMap::Entry* entry = |
| 1056 saved_addresses_.Lookup(obj, HeapObjectHash(obj), true); | 1056 saved_addresses_.Lookup(obj, HeapObjectHash(obj), true); |
| 1057 entry->value = addr; | 1057 entry->value = addr; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 | 1060 |
| 1061 void Serializer::Serialize() { | 1061 void Serializer::Serialize() { |
| 1062 // No active threads. | 1062 // No active threads. |
| 1063 CHECK_EQ(NULL, ThreadState::FirstInUse()); | 1063 CHECK_EQ(NULL, ThreadState::FirstInUse()); |
| 1064 // No active or weak handles. | 1064 // No active or weak handles. |
| 1065 CHECK(HandleScopeImplementer::instance()->Blocks()->is_empty()); | 1065 CHECK(HandleScopeImplementer::instance()->blocks()->is_empty()); |
| 1066 CHECK_EQ(0, GlobalHandles::NumberOfWeakHandles()); | 1066 CHECK_EQ(0, GlobalHandles::NumberOfWeakHandles()); |
| 1067 // We need a counter function during serialization to resolve the | 1067 // We need a counter function during serialization to resolve the |
| 1068 // references to counters in the code on the heap. | 1068 // references to counters in the code on the heap. |
| 1069 CHECK(StatsTable::HasCounterFunction()); | 1069 CHECK(StatsTable::HasCounterFunction()); |
| 1070 CHECK(enabled()); | 1070 CHECK(enabled()); |
| 1071 InitializeAllocators(); | 1071 InitializeAllocators(); |
| 1072 reference_encoder_ = new ExternalReferenceEncoder(); | 1072 reference_encoder_ = new ExternalReferenceEncoder(); |
| 1073 PutHeader(); | 1073 PutHeader(); |
| 1074 Heap::IterateRoots(this); | 1074 Heap::IterateRoots(this); |
| 1075 PutLog(); | 1075 PutLog(); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 ASSERT(strncmp(tag, buf, length) == 0); | 1388 ASSERT(strncmp(tag, buf, length) == 0); |
| 1389 } | 1389 } |
| 1390 } | 1390 } |
| 1391 #endif | 1391 #endif |
| 1392 | 1392 |
| 1393 | 1393 |
| 1394 void Deserializer::Deserialize() { | 1394 void Deserializer::Deserialize() { |
| 1395 // No active threads. | 1395 // No active threads. |
| 1396 ASSERT_EQ(NULL, ThreadState::FirstInUse()); | 1396 ASSERT_EQ(NULL, ThreadState::FirstInUse()); |
| 1397 // No active handles. | 1397 // No active handles. |
| 1398 ASSERT(HandleScopeImplementer::instance()->Blocks()->is_empty()); | 1398 ASSERT(HandleScopeImplementer::instance()->blocks()->is_empty()); |
| 1399 reference_decoder_ = new ExternalReferenceDecoder(); | 1399 reference_decoder_ = new ExternalReferenceDecoder(); |
| 1400 // By setting linear allocation only, we forbid the use of free list | 1400 // By setting linear allocation only, we forbid the use of free list |
| 1401 // allocation which is not predicted by SimulatedAddress. | 1401 // allocation which is not predicted by SimulatedAddress. |
| 1402 GetHeader(); | 1402 GetHeader(); |
| 1403 Heap::IterateRoots(this); | 1403 Heap::IterateRoots(this); |
| 1404 GetContextStack(); | 1404 GetContextStack(); |
| 1405 } | 1405 } |
| 1406 | 1406 |
| 1407 | 1407 |
| 1408 void Deserializer::VisitPointers(Object** start, Object** end) { | 1408 void Deserializer::VisitPointers(Object** start, Object** end) { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 ASSERT(index < large_objects_.length()); | 1708 ASSERT(index < large_objects_.length()); |
| 1709 } | 1709 } |
| 1710 return large_objects_[index]; // s.page_offset() is ignored. | 1710 return large_objects_[index]; // s.page_offset() is ignored. |
| 1711 } | 1711 } |
| 1712 UNREACHABLE(); | 1712 UNREACHABLE(); |
| 1713 return NULL; | 1713 return NULL; |
| 1714 } | 1714 } |
| 1715 | 1715 |
| 1716 | 1716 |
| 1717 } } // namespace v8::internal | 1717 } } // namespace v8::internal |
| OLD | NEW |