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

Side by Side Diff: src/serialize.cc

Issue 194023: Fixed serializer issue. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 void Serializer::PutContextStack() { 1203 void Serializer::PutContextStack() {
1204 List<Context*> contexts(2); 1204 List<Context*> contexts(2);
1205 while (HandleScopeImplementer::instance()->HasSavedContexts()) { 1205 while (HandleScopeImplementer::instance()->HasSavedContexts()) {
1206 Context* context = 1206 Context* context =
1207 HandleScopeImplementer::instance()->RestoreContext(); 1207 HandleScopeImplementer::instance()->RestoreContext();
1208 contexts.Add(context); 1208 contexts.Add(context);
1209 } 1209 }
1210 for (int i = contexts.length() - 1; i >= 0; i--) { 1210 for (int i = contexts.length() - 1; i >= 0; i--) {
1211 HandleScopeImplementer::instance()->SaveContext(contexts[i]); 1211 HandleScopeImplementer::instance()->SaveContext(contexts[i]);
1212 } 1212 }
1213 writer_->PutC('C');
1213 writer_->PutC('['); 1214 writer_->PutC('[');
1214 writer_->PutInt(contexts.length()); 1215 writer_->PutInt(contexts.length());
1215 if (!contexts.is_empty()) { 1216 if (!contexts.is_empty()) {
1216 Object** start = reinterpret_cast<Object**>(&contexts.first()); 1217 Object** start = reinterpret_cast<Object**>(&contexts.first());
1217 VisitPointers(start, start + contexts.length()); 1218 VisitPointers(start, start + contexts.length());
1218 } 1219 }
1219 writer_->PutC(']'); 1220 writer_->PutC(']');
1220 } 1221 }
1221 1222
1222 void Serializer::PutEncodedAddress(Address addr) { 1223 void Serializer::PutEncodedAddress(Address addr) {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 for (int i = 0; i < length; i++) { 1540 for (int i = 0; i < length; i++) {
1540 reader_.ExpectC('|'); 1541 reader_.ExpectC('|');
1541 int gh_index = reader_.GetInt(); 1542 int gh_index = reader_.GetInt();
1542 stack->Add(global_handles_[gh_index]); 1543 stack->Add(global_handles_[gh_index]);
1543 } 1544 }
1544 reader_.ExpectC(']'); 1545 reader_.ExpectC(']');
1545 } 1546 }
1546 1547
1547 1548
1548 void Deserializer::GetContextStack() { 1549 void Deserializer::GetContextStack() {
1549 reader_.ExpectC('['); 1550 reader_.ExpectC('C');
1551 CHECK(reader_.GetC() == '[');
1550 int count = reader_.GetInt(); 1552 int count = reader_.GetInt();
1551 List<Context*> entered_contexts(count); 1553 List<Context*> entered_contexts(count);
1552 if (count > 0) { 1554 if (count > 0) {
1553 Object** start = reinterpret_cast<Object**>(&entered_contexts.first()); 1555 Object** start = reinterpret_cast<Object**>(&entered_contexts.first());
1554 VisitPointers(start, start + count); 1556 VisitPointers(start, start + count);
1555 } 1557 }
1556 reader_.ExpectC(']'); 1558 reader_.ExpectC(']');
1557 for (int i = 0; i < count; i++) { 1559 for (int i = 0; i < count; i++) {
1558 HandleScopeImplementer::instance()->SaveContext(entered_contexts[i]); 1560 HandleScopeImplementer::instance()->SaveContext(entered_contexts[i]);
1559 } 1561 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1692 ASSERT(index < large_objects_.length()); 1694 ASSERT(index < large_objects_.length());
1693 } 1695 }
1694 return large_objects_[index]; // s.page_offset() is ignored. 1696 return large_objects_[index]; // s.page_offset() is ignored.
1695 } 1697 }
1696 UNREACHABLE(); 1698 UNREACHABLE();
1697 return NULL; 1699 return NULL;
1698 } 1700 }
1699 1701
1700 1702
1701 } } // namespace v8::internal 1703 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698