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

Side by Side Diff: src/api.cc

Issue 2740033002: [serializer] complete slack tracking when creating context snapshot. (Closed)
Patch Set: remove unused variable. Created 3 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 | « no previous file | src/objects.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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 *v8::Utils::OpenHandle(*data->default_context_.Get(data->isolate_)); 618 *v8::Utils::OpenHandle(*data->default_context_.Get(data->isolate_));
619 data->default_context_.Reset(); 619 data->default_context_.Reset();
620 for (int i = 0; i < num_additional_contexts; i++) { 620 for (int i = 0; i < num_additional_contexts; i++) {
621 i::Handle<i::Context> context = 621 i::Handle<i::Context> context =
622 v8::Utils::OpenHandle(*data->contexts_.Get(i)); 622 v8::Utils::OpenHandle(*data->contexts_.Get(i));
623 contexts.Add(*context); 623 contexts.Add(*context);
624 } 624 }
625 data->contexts_.Clear(); 625 data->contexts_.Clear();
626 } 626 }
627 627
628 // Complete in-object slack tracking for all functions.
629 i::HeapIterator heap_iterator(isolate->heap());
630 while (i::HeapObject* current_obj = heap_iterator.next()) {
631 if (!current_obj->IsJSFunction()) continue;
632 i::JSFunction* fun = i::JSFunction::cast(current_obj);
633 fun->CompleteInobjectSlackTrackingIfActive();
634 }
635
628 #ifdef DEBUG 636 #ifdef DEBUG
629 i::ExternalReferenceTable::instance(isolate)->ResetCount(); 637 i::ExternalReferenceTable::instance(isolate)->ResetCount();
630 #endif // DEBUG 638 #endif // DEBUG
631 639
632 i::StartupSerializer startup_serializer(isolate, function_code_handling); 640 i::StartupSerializer startup_serializer(isolate, function_code_handling);
633 startup_serializer.SerializeStrongReferences(); 641 startup_serializer.SerializeStrongReferences();
634 642
635 // Serialize each context with a new partial serializer. 643 // Serialize each context with a new partial serializer.
636 i::List<i::SnapshotData*> context_snapshots(num_additional_contexts + 1); 644 i::List<i::SnapshotData*> context_snapshots(num_additional_contexts + 1);
637 645
(...skipping 9607 matching lines...) Expand 10 before | Expand all | Expand 10 after
10245 Address callback_address = 10253 Address callback_address =
10246 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10254 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10247 VMState<EXTERNAL> state(isolate); 10255 VMState<EXTERNAL> state(isolate);
10248 ExternalCallbackScope call_scope(isolate, callback_address); 10256 ExternalCallbackScope call_scope(isolate, callback_address);
10249 callback(info); 10257 callback(info);
10250 } 10258 }
10251 10259
10252 10260
10253 } // namespace internal 10261 } // namespace internal
10254 } // namespace v8 10262 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698