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

Side by Side Diff: src/serialize.cc

Issue 9159010: Add an assert to the serializer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 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 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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 } 1357 }
1358 1358
1359 1359
1360 void PartialSerializer::SerializeObject( 1360 void PartialSerializer::SerializeObject(
1361 Object* o, 1361 Object* o,
1362 HowToCode how_to_code, 1362 HowToCode how_to_code,
1363 WhereToPoint where_to_point) { 1363 WhereToPoint where_to_point) {
1364 CHECK(o->IsHeapObject()); 1364 CHECK(o->IsHeapObject());
1365 HeapObject* heap_object = HeapObject::cast(o); 1365 HeapObject* heap_object = HeapObject::cast(o);
1366 1366
1367 if (heap_object->IsMap()) {
1368 // The code-caches link to context-specific code objects, which
1369 // the startup and context serializes cannot currently handle.
1370 ASSERT(Map::cast(heap_object)->code_cache() ==
1371 heap_object->GetHeap()->raw_unchecked_empty_fixed_array());
1372 }
1373
1367 int root_index; 1374 int root_index;
1368 if ((root_index = RootIndex(heap_object)) != kInvalidRootIndex) { 1375 if ((root_index = RootIndex(heap_object)) != kInvalidRootIndex) {
1369 PutRoot(root_index, heap_object, how_to_code, where_to_point); 1376 PutRoot(root_index, heap_object, how_to_code, where_to_point);
1370 return; 1377 return;
1371 } 1378 }
1372 1379
1373 if (ShouldBeInThePartialSnapshotCache(heap_object)) { 1380 if (ShouldBeInThePartialSnapshotCache(heap_object)) {
1374 int cache_index = PartialSnapshotCacheIndex(heap_object); 1381 int cache_index = PartialSnapshotCacheIndex(heap_object);
1375 sink_->Put(kPartialSnapshotCache + how_to_code + where_to_point, 1382 sink_->Put(kPartialSnapshotCache + how_to_code + where_to_point,
1376 "PartialSnapshotCache"); 1383 "PartialSnapshotCache");
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1678 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1672 } 1679 }
1673 } 1680 }
1674 int allocation_address = fullness_[space]; 1681 int allocation_address = fullness_[space];
1675 fullness_[space] = allocation_address + size; 1682 fullness_[space] = allocation_address + size;
1676 return allocation_address; 1683 return allocation_address;
1677 } 1684 }
1678 1685
1679 1686
1680 } } // namespace v8::internal 1687 } } // 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