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

Side by Side Diff: src/serialize.cc

Issue 7889046: 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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 1413
1414 void Serializer::ObjectSerializer::VisitExternalAsciiString( 1414 void Serializer::ObjectSerializer::VisitExternalAsciiString(
1415 v8::String::ExternalAsciiStringResource** resource_pointer) { 1415 v8::String::ExternalAsciiStringResource** resource_pointer) {
1416 Address references_start = reinterpret_cast<Address>(resource_pointer); 1416 Address references_start = reinterpret_cast<Address>(resource_pointer);
1417 OutputRawData(references_start); 1417 OutputRawData(references_start);
1418 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { 1418 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
1419 Object* source = HEAP->natives_source_cache()->get(i); 1419 Object* source = HEAP->natives_source_cache()->get(i);
1420 if (!source->IsUndefined()) { 1420 if (!source->IsUndefined()) {
1421 ExternalAsciiString* string = ExternalAsciiString::cast(source); 1421 ExternalAsciiString* string = ExternalAsciiString::cast(source);
1422 typedef v8::String::ExternalAsciiStringResource Resource; 1422 typedef v8::String::ExternalAsciiStringResource Resource;
1423 Resource* resource = string->resource(); 1423 const Resource* resource = string->resource();
1424 if (resource == *resource_pointer) { 1424 if (resource == *resource_pointer) {
1425 sink_->Put(kNativesStringResource, "NativesStringResource"); 1425 sink_->Put(kNativesStringResource, "NativesStringResource");
1426 sink_->PutSection(i, "NativesStringResourceEnd"); 1426 sink_->PutSection(i, "NativesStringResourceEnd");
1427 bytes_processed_so_far_ += sizeof(resource); 1427 bytes_processed_so_far_ += sizeof(resource);
1428 return; 1428 return;
1429 } 1429 }
1430 } 1430 }
1431 } 1431 }
1432 // One of the strings in the natives cache should match the resource. We 1432 // One of the strings in the natives cache should match the resource. We
1433 // can't serialize any other kinds of external strings. 1433 // can't serialize any other kinds of external strings.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1524 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1525 } 1525 }
1526 } 1526 }
1527 int allocation_address = fullness_[space]; 1527 int allocation_address = fullness_[space];
1528 fullness_[space] = allocation_address + size; 1528 fullness_[space] = allocation_address + size;
1529 return allocation_address; 1529 return allocation_address;
1530 } 1530 }
1531 1531
1532 1532
1533 } } // namespace v8::internal 1533 } } // 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