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

Side by Side Diff: src/serialize.cc

Issue 1035523005: Serializer: ensure unique script ids when deserializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test Created 5 years, 9 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/runtime/runtime-debug.cc ('k') | test/mjsunit/debug-breakpoints.js » ('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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 // Uninitialize hash field as the hash seed may have changed. 713 // Uninitialize hash field as the hash seed may have changed.
714 string->set_hash_field(String::kEmptyHashField); 714 string->set_hash_field(String::kEmptyHashField);
715 if (string->IsInternalizedString()) { 715 if (string->IsInternalizedString()) {
716 DisallowHeapAllocation no_gc; 716 DisallowHeapAllocation no_gc;
717 HandleScope scope(isolate_); 717 HandleScope scope(isolate_);
718 StringTableInsertionKey key(string); 718 StringTableInsertionKey key(string);
719 String* canonical = *StringTable::LookupKey(isolate_, &key); 719 String* canonical = *StringTable::LookupKey(isolate_, &key);
720 string->SetForwardedInternalizedString(canonical); 720 string->SetForwardedInternalizedString(canonical);
721 return canonical; 721 return canonical;
722 } 722 }
723 } else if (obj->IsScript()) {
724 Script::cast(obj)->set_id(isolate_->heap()->NextScriptId());
723 } 725 }
724 return obj; 726 return obj;
725 } 727 }
726 728
727 729
728 HeapObject* Deserializer::GetBackReferencedObject(int space) { 730 HeapObject* Deserializer::GetBackReferencedObject(int space) {
729 HeapObject* obj; 731 HeapObject* obj;
730 BackReference back_reference(source_.GetInt()); 732 BackReference back_reference(source_.GetInt());
731 if (space == LO_SPACE) { 733 if (space == LO_SPACE) {
732 CHECK(back_reference.chunk_index() == 0); 734 CHECK(back_reference.chunk_index() == 0);
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 DisallowHeapAllocation no_gc; 2533 DisallowHeapAllocation no_gc;
2532 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2534 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2533 SanityCheckResult r = scd->SanityCheck(isolate, source); 2535 SanityCheckResult r = scd->SanityCheck(isolate, source);
2534 if (r == CHECK_SUCCESS) return scd; 2536 if (r == CHECK_SUCCESS) return scd;
2535 cached_data->Reject(); 2537 cached_data->Reject();
2536 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2538 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2537 delete scd; 2539 delete scd;
2538 return NULL; 2540 return NULL;
2539 } 2541 }
2540 } } // namespace v8::internal 2542 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/debug-breakpoints.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698