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

Side by Side Diff: src/serialize.cc

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 isolate_->heap()->set_allocation_sites_list( 637 isolate_->heap()->set_allocation_sites_list(
638 isolate_->heap()->undefined_value()); 638 isolate_->heap()->undefined_value());
639 } 639 }
640 640
641 isolate_->heap()->InitializeWeakObjectToCodeTable(); 641 isolate_->heap()->InitializeWeakObjectToCodeTable();
642 642
643 // Update data pointers to the external strings containing natives sources. 643 // Update data pointers to the external strings containing natives sources.
644 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { 644 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
645 Object* source = isolate_->heap()->natives_source_cache()->get(i); 645 Object* source = isolate_->heap()->natives_source_cache()->get(i);
646 if (!source->IsUndefined()) { 646 if (!source->IsUndefined()) {
647 ExternalAsciiString::cast(source)->update_data_cache(); 647 ExternalOneByteString::cast(source)->update_data_cache();
648 } 648 }
649 } 649 }
650 650
651 FlushICacheForNewCodeObjects(); 651 FlushICacheForNewCodeObjects();
652 652
653 // Issue code events for newly deserialized code objects. 653 // Issue code events for newly deserialized code objects.
654 LOG_CODE_EVENT(isolate_, LogCodeObjects()); 654 LOG_CODE_EVENT(isolate_, LogCodeObjects());
655 LOG_CODE_EVENT(isolate_, LogCompiledFunctions()); 655 LOG_CODE_EVENT(isolate_, LogCompiledFunctions());
656 } 656 }
657 657
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 // Out-of-line constant pool entries will be visited by the ConstantPoolArray. 1627 // Out-of-line constant pool entries will be visited by the ConstantPoolArray.
1628 if (FLAG_enable_ool_constant_pool && rinfo->IsInConstantPool()) return; 1628 if (FLAG_enable_ool_constant_pool && rinfo->IsInConstantPool()) return;
1629 1629
1630 int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping); 1630 int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping);
1631 Cell* object = Cell::cast(rinfo->target_cell()); 1631 Cell* object = Cell::cast(rinfo->target_cell());
1632 serializer_->SerializeObject(object, kPlain, kInnerPointer, skip); 1632 serializer_->SerializeObject(object, kPlain, kInnerPointer, skip);
1633 bytes_processed_so_far_ += kPointerSize; 1633 bytes_processed_so_far_ += kPointerSize;
1634 } 1634 }
1635 1635
1636 1636
1637 void Serializer::ObjectSerializer::VisitExternalAsciiString( 1637 void Serializer::ObjectSerializer::VisitExternalOneByteString(
1638 v8::String::ExternalAsciiStringResource** resource_pointer) { 1638 v8::String::ExternalOneByteStringResource** resource_pointer) {
1639 Address references_start = reinterpret_cast<Address>(resource_pointer); 1639 Address references_start = reinterpret_cast<Address>(resource_pointer);
1640 OutputRawData(references_start); 1640 OutputRawData(references_start);
1641 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { 1641 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
1642 Object* source = 1642 Object* source =
1643 serializer_->isolate()->heap()->natives_source_cache()->get(i); 1643 serializer_->isolate()->heap()->natives_source_cache()->get(i);
1644 if (!source->IsUndefined()) { 1644 if (!source->IsUndefined()) {
1645 ExternalAsciiString* string = ExternalAsciiString::cast(source); 1645 ExternalOneByteString* string = ExternalOneByteString::cast(source);
1646 typedef v8::String::ExternalAsciiStringResource Resource; 1646 typedef v8::String::ExternalOneByteStringResource Resource;
1647 const Resource* resource = string->resource(); 1647 const Resource* resource = string->resource();
1648 if (resource == *resource_pointer) { 1648 if (resource == *resource_pointer) {
1649 sink_->Put(kNativesStringResource, "NativesStringResource"); 1649 sink_->Put(kNativesStringResource, "NativesStringResource");
1650 sink_->PutSection(i, "NativesStringResourceEnd"); 1650 sink_->PutSection(i, "NativesStringResourceEnd");
1651 bytes_processed_so_far_ += sizeof(resource); 1651 bytes_processed_so_far_ += sizeof(resource);
1652 return; 1652 return;
1653 } 1653 }
1654 } 1654 }
1655 } 1655 }
1656 // One of the strings in the natives cache should match the resource. We 1656 // One of the strings in the natives cache should match the resource. We
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 1951
1952 int SerializedCodeData::CheckSum(String* string) { 1952 int SerializedCodeData::CheckSum(String* string) {
1953 int checksum = Version::Hash(); 1953 int checksum = Version::Hash();
1954 #ifdef DEBUG 1954 #ifdef DEBUG
1955 uint32_t seed = static_cast<uint32_t>(checksum); 1955 uint32_t seed = static_cast<uint32_t>(checksum);
1956 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); 1956 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed));
1957 #endif // DEBUG 1957 #endif // DEBUG
1958 return checksum; 1958 return checksum;
1959 } 1959 }
1960 } } // namespace v8::internal 1960 } } // namespace v8::internal
OLDNEW
« src/jsregexp.cc ('K') | « src/serialize.h ('k') | src/string-search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698