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

Side by Side Diff: src/serialize.cc

Issue 564035: Remove lazy loading of natives files and the natives cache.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 10 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/serialize.h ('k') | src/string.js » ('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 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } else if (space_index == kLargeFixedArray) { 532 } else if (space_index == kLargeFixedArray) {
533 new_allocation = lo_space->AllocateRawFixedArray(size); 533 new_allocation = lo_space->AllocateRawFixedArray(size);
534 } else { 534 } else {
535 ASSERT_EQ(kLargeCode, space_index); 535 ASSERT_EQ(kLargeCode, space_index);
536 new_allocation = lo_space->AllocateRawCode(size); 536 new_allocation = lo_space->AllocateRawCode(size);
537 } 537 }
538 ASSERT(!new_allocation->IsFailure()); 538 ASSERT(!new_allocation->IsFailure());
539 HeapObject* new_object = HeapObject::cast(new_allocation); 539 HeapObject* new_object = HeapObject::cast(new_allocation);
540 // Record all large objects in the same space. 540 // Record all large objects in the same space.
541 address = new_object->address(); 541 address = new_object->address();
542 high_water_[LO_SPACE] = address + size; 542 pages_[LO_SPACE].Add(address);
543 } 543 }
544 last_object_address_ = address; 544 last_object_address_ = address;
545 return address; 545 return address;
546 } 546 }
547 547
548 548
549 // This returns the address of an object that has been described in the 549 // This returns the address of an object that has been described in the
550 // snapshot as being offset bytes back in a particular space. 550 // snapshot as being offset bytes back in a particular space.
551 HeapObject* Deserializer::GetAddressFromEnd(int space) { 551 HeapObject* Deserializer::GetAddressFromEnd(int space) {
552 int offset = source_->GetInt(); 552 int offset = source_->GetInt();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 case (base_tag) + kLargeCode: /* NOLINT */ \ 658 case (base_tag) + kLargeCode: /* NOLINT */ \
659 case (base_tag) + kLargeFixedArray: /* NOLINT */ 659 case (base_tag) + kLargeFixedArray: /* NOLINT */
660 660
661 661
662 void Deserializer::ReadChunk(Object** current, 662 void Deserializer::ReadChunk(Object** current,
663 Object** limit, 663 Object** limit,
664 int space, 664 int space,
665 Address address) { 665 Address address) {
666 while (current < limit) { 666 while (current < limit) {
667 int data = source_->Get(); 667 int data = source_->Get();
668 Trace("Tag", data);
668 switch (data) { 669 switch (data) {
669 #define RAW_CASE(index, size) \ 670 #define RAW_CASE(index, size) \
670 case RAW_DATA_SERIALIZATION + index: { \ 671 case RAW_DATA_SERIALIZATION + index: { \
671 byte* raw_data_out = reinterpret_cast<byte*>(current); \ 672 byte* raw_data_out = reinterpret_cast<byte*>(current); \
672 source_->CopyRaw(raw_data_out, size); \ 673 source_->CopyRaw(raw_data_out, size); \
673 current = reinterpret_cast<Object**>(raw_data_out + size); \ 674 current = reinterpret_cast<Object**>(raw_data_out + size); \
674 break; \ 675 break; \
675 } 676 }
676 COMMON_RAW_LENGTHS(RAW_CASE) 677 COMMON_RAW_LENGTHS(RAW_CASE)
677 #undef RAW_CASE 678 #undef RAW_CASE
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 if (used_in_this_page + size > Page::kObjectAreaSize) { 1351 if (used_in_this_page + size > Page::kObjectAreaSize) {
1351 *new_page = true; 1352 *new_page = true;
1352 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1353 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1353 } 1354 }
1354 } 1355 }
1355 int allocation_address = fullness_[space]; 1356 int allocation_address = fullness_[space];
1356 fullness_[space] = allocation_address + size; 1357 fullness_[space] = allocation_address + size;
1357 return allocation_address; 1358 return allocation_address;
1358 } 1359 }
1359 1360
1361 bool SerializerDeserializer::tracing_;
1362
1360 1363
1361 } } // namespace v8::internal 1364 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/serialize.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698