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

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

Issue 1320843002: [heap] Limit friendship of the Heap class to essentials. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment. Created 5 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
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/snapshot/serialize.h" 5 #include "src/snapshot/serialize.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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 DCHECK_NULL(StringTable::LookupKeyIfExists(isolate, &key)); 769 DCHECK_NULL(StringTable::LookupKeyIfExists(isolate, &key));
770 StringTable::LookupKey(isolate, &key); 770 StringTable::LookupKey(isolate, &key);
771 } 771 }
772 772
773 Heap* heap = isolate->heap(); 773 Heap* heap = isolate->heap();
774 Factory* factory = isolate->factory(); 774 Factory* factory = isolate->factory();
775 for (Handle<Script> script : new_scripts_) { 775 for (Handle<Script> script : new_scripts_) {
776 // Assign a new script id to avoid collision. 776 // Assign a new script id to avoid collision.
777 script->set_id(isolate_->heap()->NextScriptId()); 777 script->set_id(isolate_->heap()->NextScriptId());
778 // Add script to list. 778 // Add script to list.
779 heap->set_script_list(*WeakFixedArray::Add(factory->script_list(), script)); 779 Handle<Object> list = WeakFixedArray::Add(factory->script_list(), script);
780 heap->SetRootScriptList(*list);
780 } 781 }
781 } 782 }
782 783
783 784
784 HeapObject* Deserializer::GetBackReferencedObject(int space) { 785 HeapObject* Deserializer::GetBackReferencedObject(int space) {
785 HeapObject* obj; 786 HeapObject* obj;
786 BackReference back_reference(source_.GetInt()); 787 BackReference back_reference(source_.GetInt());
787 if (space == LO_SPACE) { 788 if (space == LO_SPACE) {
788 CHECK(back_reference.chunk_index() == 0); 789 CHECK(back_reference.chunk_index() == 0);
789 uint32_t index = back_reference.large_object_index(); 790 uint32_t index = back_reference.large_object_index();
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2880 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2880 SanityCheckResult r = scd->SanityCheck(isolate, source); 2881 SanityCheckResult r = scd->SanityCheck(isolate, source);
2881 if (r == CHECK_SUCCESS) return scd; 2882 if (r == CHECK_SUCCESS) return scd;
2882 cached_data->Reject(); 2883 cached_data->Reject();
2883 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2884 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2884 delete scd; 2885 delete scd;
2885 return NULL; 2886 return NULL;
2886 } 2887 }
2887 } // namespace internal 2888 } // namespace internal
2888 } // namespace v8 2889 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698