Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: src/serialize.cc

Issue 21133006: introduce eternal handles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: returns handles, added tests Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-global-handles.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 } 1297 }
1298 1298
1299 1299
1300 void StartupSerializer::SerializeStrongReferences() { 1300 void StartupSerializer::SerializeStrongReferences() {
1301 Isolate* isolate = Isolate::Current(); 1301 Isolate* isolate = Isolate::Current();
1302 // No active threads. 1302 // No active threads.
1303 CHECK_EQ(NULL, Isolate::Current()->thread_manager()->FirstThreadStateInUse()); 1303 CHECK_EQ(NULL, Isolate::Current()->thread_manager()->FirstThreadStateInUse());
1304 // No active or weak handles. 1304 // No active or weak handles.
1305 CHECK(isolate->handle_scope_implementer()->blocks()->is_empty()); 1305 CHECK(isolate->handle_scope_implementer()->blocks()->is_empty());
1306 CHECK_EQ(0, isolate->global_handles()->NumberOfWeakHandles()); 1306 CHECK_EQ(0, isolate->global_handles()->NumberOfWeakHandles());
1307 CHECK_EQ(0, isolate->eternal_handles()->NumberOfHandles());
1307 // We don't support serializing installed extensions. 1308 // We don't support serializing installed extensions.
1308 CHECK(!isolate->has_installed_extensions()); 1309 CHECK(!isolate->has_installed_extensions());
1309 1310
1310 HEAP->IterateStrongRoots(this, VISIT_ONLY_STRONG); 1311 HEAP->IterateStrongRoots(this, VISIT_ONLY_STRONG);
1311 } 1312 }
1312 1313
1313 1314
1314 void PartialSerializer::Serialize(Object** object) { 1315 void PartialSerializer::Serialize(Object** object) {
1315 this->VisitPointer(object); 1316 this->VisitPointer(object);
1316 Pad(); 1317 Pad();
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 1857
1857 bool SnapshotByteSource::AtEOF() { 1858 bool SnapshotByteSource::AtEOF() {
1858 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; 1859 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false;
1859 for (int x = position_; x < length_; x++) { 1860 for (int x = position_; x < length_; x++) {
1860 if (data_[x] != SerializerDeserializer::nop()) return false; 1861 if (data_[x] != SerializerDeserializer::nop()) return false;
1861 } 1862 }
1862 return true; 1863 return true;
1863 } 1864 }
1864 1865
1865 } } // namespace v8::internal 1866 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698