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

Side by Side Diff: src/serialize.cc

Issue 7978028: Landing for miket@chromium.org: Add an optional source length field to the Extension constructor. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | « src/objects-inl.h ('k') | test/cctest/test-api.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 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 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 1446
1447 void Serializer::ObjectSerializer::VisitExternalAsciiString( 1447 void Serializer::ObjectSerializer::VisitExternalAsciiString(
1448 v8::String::ExternalAsciiStringResource** resource_pointer) { 1448 v8::String::ExternalAsciiStringResource** resource_pointer) {
1449 Address references_start = reinterpret_cast<Address>(resource_pointer); 1449 Address references_start = reinterpret_cast<Address>(resource_pointer);
1450 OutputRawData(references_start); 1450 OutputRawData(references_start);
1451 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { 1451 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
1452 Object* source = HEAP->natives_source_cache()->get(i); 1452 Object* source = HEAP->natives_source_cache()->get(i);
1453 if (!source->IsUndefined()) { 1453 if (!source->IsUndefined()) {
1454 ExternalAsciiString* string = ExternalAsciiString::cast(source); 1454 ExternalAsciiString* string = ExternalAsciiString::cast(source);
1455 typedef v8::String::ExternalAsciiStringResource Resource; 1455 typedef v8::String::ExternalAsciiStringResource Resource;
1456 Resource* resource = string->resource(); 1456 const Resource* resource = string->resource();
1457 if (resource == *resource_pointer) { 1457 if (resource == *resource_pointer) {
1458 sink_->Put(kNativesStringResource, "NativesStringResource"); 1458 sink_->Put(kNativesStringResource, "NativesStringResource");
1459 sink_->PutSection(i, "NativesStringResourceEnd"); 1459 sink_->PutSection(i, "NativesStringResourceEnd");
1460 bytes_processed_so_far_ += sizeof(resource); 1460 bytes_processed_so_far_ += sizeof(resource);
1461 return; 1461 return;
1462 } 1462 }
1463 } 1463 }
1464 } 1464 }
1465 // One of the strings in the natives cache should match the resource. We 1465 // One of the strings in the natives cache should match the resource. We
1466 // can't serialize any other kinds of external strings. 1466 // can't serialize any other kinds of external strings.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1557 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1558 } 1558 }
1559 } 1559 }
1560 int allocation_address = fullness_[space]; 1560 int allocation_address = fullness_[space];
1561 fullness_[space] = allocation_address + size; 1561 fullness_[space] = allocation_address + size;
1562 return allocation_address; 1562 return allocation_address;
1563 } 1563 }
1564 1564
1565 1565
1566 } } // namespace v8::internal 1566 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698