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

Side by Side Diff: src/serialize.cc

Issue 871253005: Use weak cells in dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 10 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-inl.h ('k') | test/cctest/test-heap.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 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 isolate->heap()->set_new_array_buffer_views_list( 675 isolate->heap()->set_new_array_buffer_views_list(
676 isolate_->heap()->undefined_value()); 676 isolate_->heap()->undefined_value());
677 677
678 // The allocation site list is build during root iteration, but if no sites 678 // The allocation site list is build during root iteration, but if no sites
679 // were encountered then it needs to be initialized to undefined. 679 // were encountered then it needs to be initialized to undefined.
680 if (isolate_->heap()->allocation_sites_list() == Smi::FromInt(0)) { 680 if (isolate_->heap()->allocation_sites_list() == Smi::FromInt(0)) {
681 isolate_->heap()->set_allocation_sites_list( 681 isolate_->heap()->set_allocation_sites_list(
682 isolate_->heap()->undefined_value()); 682 isolate_->heap()->undefined_value());
683 } 683 }
684 684
685 isolate_->heap()->InitializeWeakObjectToCodeTable();
686
687 // Update data pointers to the external strings containing natives sources. 685 // Update data pointers to the external strings containing natives sources.
688 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { 686 for (int i = 0; i < Natives::GetBuiltinsCount(); i++) {
689 Object* source = isolate_->heap()->natives_source_cache()->get(i); 687 Object* source = isolate_->heap()->natives_source_cache()->get(i);
690 if (!source->IsUndefined()) { 688 if (!source->IsUndefined()) {
691 ExternalOneByteString::cast(source)->update_data_cache(); 689 ExternalOneByteString::cast(source)->update_data_cache();
692 } 690 }
693 } 691 }
694 692
695 FlushICacheForNewCodeObjects(); 693 FlushICacheForNewCodeObjects();
696 694
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 SerializedCodeData* SerializedCodeData::FromCachedData(ScriptData* cached_data, 2661 SerializedCodeData* SerializedCodeData::FromCachedData(ScriptData* cached_data,
2664 String* source) { 2662 String* source) {
2665 DisallowHeapAllocation no_gc; 2663 DisallowHeapAllocation no_gc;
2666 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2664 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2667 if (scd->IsSane(source)) return scd; 2665 if (scd->IsSane(source)) return scd;
2668 cached_data->Reject(); 2666 cached_data->Reject();
2669 delete scd; 2667 delete scd;
2670 return NULL; 2668 return NULL;
2671 } 2669 }
2672 } } // namespace v8::internal 2670 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698