OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 | 1125 |
1126 | 1126 |
1127 void StartupSerializer::SerializeStrongReferences() { | 1127 void StartupSerializer::SerializeStrongReferences() { |
1128 Isolate* isolate = Isolate::Current(); | 1128 Isolate* isolate = Isolate::Current(); |
1129 // No active threads. | 1129 // No active threads. |
1130 CHECK_EQ(NULL, Isolate::Current()->thread_manager()->FirstThreadStateInUse()); | 1130 CHECK_EQ(NULL, Isolate::Current()->thread_manager()->FirstThreadStateInUse()); |
1131 // No active or weak handles. | 1131 // No active or weak handles. |
1132 CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); | 1132 CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); |
1133 CHECK_EQ(0, isolate->global_handles()->NumberOfWeakHandles()); | 1133 CHECK_EQ(0, isolate->global_handles()->NumberOfWeakHandles()); |
1134 // We don't support serializing installed extensions. | 1134 // We don't support serializing installed extensions. |
1135 for (RegisteredExtension* ext = v8::RegisteredExtension::first_extension(); | 1135 CHECK(!isolate->has_installed_extensions()); |
1136 ext != NULL; | 1136 |
1137 ext = ext->next()) { | |
1138 CHECK_NE(v8::INSTALLED, ext->state()); | |
1139 } | |
1140 HEAP->IterateStrongRoots(this, VISIT_ONLY_STRONG); | 1137 HEAP->IterateStrongRoots(this, VISIT_ONLY_STRONG); |
1141 } | 1138 } |
1142 | 1139 |
1143 | 1140 |
1144 void PartialSerializer::Serialize(Object** object) { | 1141 void PartialSerializer::Serialize(Object** object) { |
1145 this->VisitPointer(object); | 1142 this->VisitPointer(object); |
1146 Isolate* isolate = Isolate::Current(); | 1143 Isolate* isolate = Isolate::Current(); |
1147 | 1144 |
1148 // After we have done the partial serialization the partial snapshot cache | 1145 // After we have done the partial serialization the partial snapshot cache |
1149 // will contain some references needed to decode the partial snapshot. We | 1146 // will contain some references needed to decode the partial snapshot. We |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1663 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1667 } | 1664 } |
1668 } | 1665 } |
1669 int allocation_address = fullness_[space]; | 1666 int allocation_address = fullness_[space]; |
1670 fullness_[space] = allocation_address + size; | 1667 fullness_[space] = allocation_address + size; |
1671 return allocation_address; | 1668 return allocation_address; |
1672 } | 1669 } |
1673 | 1670 |
1674 | 1671 |
1675 } } // namespace v8::internal | 1672 } } // namespace v8::internal |
OLD | NEW |