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

Side by Side Diff: src/snapshot/serializer.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 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
« no previous file with comments | « src/snapshot/partial-serializer.cc ('k') | src/snapshot/serializer-common.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/snapshot/serializer.h" 5 #include "src/snapshot/serializer.h"
6 6
7 #include "src/macro-assembler.h" 7 #include "src/macro-assembler.h"
8 #include "src/snapshot/natives.h" 8 #include "src/snapshot/natives.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping); 661 int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping);
662 Cell* object = Cell::cast(rinfo->target_cell()); 662 Cell* object = Cell::cast(rinfo->target_cell());
663 serializer_->SerializeObject(object, kPlain, kInnerPointer, skip); 663 serializer_->SerializeObject(object, kPlain, kInnerPointer, skip);
664 bytes_processed_so_far_ += kPointerSize; 664 bytes_processed_so_far_ += kPointerSize;
665 } 665 }
666 666
667 bool Serializer::ObjectSerializer::SerializeExternalNativeSourceString( 667 bool Serializer::ObjectSerializer::SerializeExternalNativeSourceString(
668 int builtin_count, 668 int builtin_count,
669 v8::String::ExternalOneByteStringResource** resource_pointer, 669 v8::String::ExternalOneByteStringResource** resource_pointer,
670 FixedArray* source_cache, int resource_index) { 670 FixedArray* source_cache, int resource_index) {
671 Isolate* isolate = serializer_->isolate();
671 for (int i = 0; i < builtin_count; i++) { 672 for (int i = 0; i < builtin_count; i++) {
672 Object* source = source_cache->get(i); 673 Object* source = source_cache->get(i);
673 if (!source->IsUndefined()) { 674 if (!source->IsUndefined(isolate)) {
674 ExternalOneByteString* string = ExternalOneByteString::cast(source); 675 ExternalOneByteString* string = ExternalOneByteString::cast(source);
675 typedef v8::String::ExternalOneByteStringResource Resource; 676 typedef v8::String::ExternalOneByteStringResource Resource;
676 const Resource* resource = string->resource(); 677 const Resource* resource = string->resource();
677 if (resource == *resource_pointer) { 678 if (resource == *resource_pointer) {
678 sink_->Put(resource_index, "NativesStringResource"); 679 sink_->Put(resource_index, "NativesStringResource");
679 sink_->PutSection(i, "NativesStringResourceEnd"); 680 sink_->PutSection(i, "NativesStringResourceEnd");
680 bytes_processed_so_far_ += sizeof(resource); 681 bytes_processed_so_far_ += sizeof(resource);
681 return true; 682 return true;
682 } 683 }
683 } 684 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 if (to_skip != 0 && return_skip == kIgnoringReturn) { 775 if (to_skip != 0 && return_skip == kIgnoringReturn) {
775 sink_->Put(kSkip, "Skip"); 776 sink_->Put(kSkip, "Skip");
776 sink_->PutInt(to_skip, "SkipDistance"); 777 sink_->PutInt(to_skip, "SkipDistance");
777 to_skip = 0; 778 to_skip = 0;
778 } 779 }
779 return to_skip; 780 return to_skip;
780 } 781 }
781 782
782 } // namespace internal 783 } // namespace internal
783 } // namespace v8 784 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/partial-serializer.cc ('k') | src/snapshot/serializer-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698