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

Side by Side Diff: src/serialize.cc

Issue 238353015: Simplify v8/Isolate teardown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Tiny serializer fix after recent changes. Created 6 years, 8 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/mksnapshot.cc ('k') | src/v8.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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 ASSERT(NoBarrier_Load(&serialization_state_) == 778 ASSERT(NoBarrier_Load(&serialization_state_) ==
779 SERIALIZER_STATE_UNINITIALIZED); 779 SERIALIZER_STATE_UNINITIALIZED);
780 SerializationState state = code_address_map_ 780 SerializationState state = code_address_map_
781 ? SERIALIZER_STATE_ENABLED 781 ? SERIALIZER_STATE_ENABLED
782 : SERIALIZER_STATE_DISABLED; 782 : SERIALIZER_STATE_DISABLED;
783 NoBarrier_Store(&serialization_state_, state); 783 NoBarrier_Store(&serialization_state_, state);
784 } 784 }
785 785
786 786
787 void Serializer::TearDown() { 787 void Serializer::TearDown() {
788 // TearDown is called by V8::TearDown() for the default isolate. It's safe
789 // to shut down the serializer by that point. Just to be safe, we restore
790 // serialization_state_ to uninitialized.
791 ASSERT(NoBarrier_Load(&serialization_state_) != 788 ASSERT(NoBarrier_Load(&serialization_state_) !=
792 SERIALIZER_STATE_UNINITIALIZED); 789 SERIALIZER_STATE_UNINITIALIZED);
793 if (code_address_map_) { 790 if (code_address_map_) {
794 ASSERT(NoBarrier_Load(&serialization_state_) == 791 ASSERT(NoBarrier_Load(&serialization_state_) ==
795 SERIALIZER_STATE_ENABLED); 792 SERIALIZER_STATE_ENABLED);
796 delete code_address_map_; 793 delete code_address_map_;
797 code_address_map_ = NULL; 794 code_address_map_ = NULL;
798 } 795 }
799 796
800 NoBarrier_Store(&serialization_state_, SERIALIZER_STATE_UNINITIALIZED); 797 NoBarrier_Store(&serialization_state_, SERIALIZER_STATE_UNINITIALIZED);
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 1898
1902 bool SnapshotByteSource::AtEOF() { 1899 bool SnapshotByteSource::AtEOF() {
1903 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; 1900 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false;
1904 for (int x = position_; x < length_; x++) { 1901 for (int x = position_; x < length_; x++) {
1905 if (data_[x] != SerializerDeserializer::nop()) return false; 1902 if (data_[x] != SerializerDeserializer::nop()) return false;
1906 } 1903 }
1907 return true; 1904 return true;
1908 } 1905 }
1909 1906
1910 } } // namespace v8::internal 1907 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mksnapshot.cc ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698