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/serialize.cc

Issue 911543002: Correctly clean up natives sources on tear down. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« src/bootstrapper.h ('K') | « src/bootstrapper.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/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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 #undef ALL_SPACES 1288 #undef ALL_SPACES
1289 1289
1290 case kSkip: { 1290 case kSkip: {
1291 int size = source_.GetInt(); 1291 int size = source_.GetInt();
1292 current = reinterpret_cast<Object**>( 1292 current = reinterpret_cast<Object**>(
1293 reinterpret_cast<intptr_t>(current) + size); 1293 reinterpret_cast<intptr_t>(current) + size);
1294 break; 1294 break;
1295 } 1295 }
1296 1296
1297 case kNativesStringResource: { 1297 case kNativesStringResource: {
1298 DCHECK(!isolate_->heap()->deserialization_complete());
1298 int index = source_.Get(); 1299 int index = source_.Get();
1299 Vector<const char> source_vector = Natives::GetScriptSource(index); 1300 Vector<const char> source_vector = Natives::GetScriptSource(index);
1300 NativesExternalStringResource* resource = 1301 NativesExternalStringResource* resource =
1301 new NativesExternalStringResource(isolate->bootstrapper(), 1302 new NativesExternalStringResource(source_vector.start(),
1302 source_vector.start(),
1303 source_vector.length()); 1303 source_vector.length());
1304 Object* resource_obj = reinterpret_cast<Object*>(resource); 1304 Object* resource_obj = reinterpret_cast<Object*>(resource);
1305 UnalignedCopy(current++, &resource_obj); 1305 UnalignedCopy(current++, &resource_obj);
1306 break; 1306 break;
1307 } 1307 }
1308 1308
1309 case kNextChunk: { 1309 case kNextChunk: {
1310 int space = source_.Get(); 1310 int space = source_.Get();
1311 DCHECK(space < kNumberOfPreallocatedSpaces); 1311 DCHECK(space < kNumberOfPreallocatedSpaces);
1312 int chunk_index = current_chunk_[space]; 1312 int chunk_index = current_chunk_[space];
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 return GetHeaderValue(kNumInternalizedStringsOffset); 2568 return GetHeaderValue(kNumInternalizedStringsOffset);
2569 } 2569 }
2570 2570
2571 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const { 2571 Vector<const uint32_t> SerializedCodeData::CodeStubKeys() const {
2572 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size; 2572 int reservations_size = GetHeaderValue(kReservationsOffset) * kInt32Size;
2573 const byte* start = data_ + kHeaderSize + reservations_size; 2573 const byte* start = data_ + kHeaderSize + reservations_size;
2574 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start), 2574 return Vector<const uint32_t>(reinterpret_cast<const uint32_t*>(start),
2575 GetHeaderValue(kNumCodeStubKeysOffset)); 2575 GetHeaderValue(kNumCodeStubKeysOffset));
2576 } 2576 }
2577 } } // namespace v8::internal 2577 } } // namespace v8::internal
OLDNEW
« src/bootstrapper.h ('K') | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698