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

Side by Side Diff: src/api.cc

Issue 1268333004: Introduce object visitor to estimate the size of a native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 { 385 {
386 HandleScope scope(isolate); 386 HandleScope scope(isolate);
387 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { 387 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
388 internal_isolate->bootstrapper()->SourceLookup<i::Natives>(i); 388 internal_isolate->bootstrapper()->SourceLookup<i::Natives>(i);
389 } 389 }
390 } 390 }
391 // If we don't do this then we end up with a stray root pointing at the 391 // If we don't do this then we end up with a stray root pointing at the
392 // context even after we have disposed of the context. 392 // context even after we have disposed of the context.
393 internal_isolate->heap()->CollectAllAvailableGarbage("mksnapshot"); 393 internal_isolate->heap()->CollectAllAvailableGarbage("mksnapshot");
394 i::Object* raw_context = *v8::Utils::OpenPersistent(context); 394 i::Object* raw_context = *v8::Utils::OpenPersistent(context);
395
jochen (gone - plz use gerrit) 2015/08/05 11:39:46 nit. remove
395 context.Reset(); 396 context.Reset();
396 397
397 i::SnapshotByteSink snapshot_sink; 398 i::SnapshotByteSink snapshot_sink;
398 i::StartupSerializer ser(internal_isolate, &snapshot_sink); 399 i::StartupSerializer ser(internal_isolate, &snapshot_sink);
399 ser.SerializeStrongReferences(); 400 ser.SerializeStrongReferences();
400 401
401 i::SnapshotByteSink context_sink; 402 i::SnapshotByteSink context_sink;
402 i::PartialSerializer context_ser(internal_isolate, &ser, &context_sink); 403 i::PartialSerializer context_ser(internal_isolate, &ser, &context_sink);
403 context_ser.Serialize(&raw_context); 404 context_ser.Serialize(&raw_context);
404 ser.SerializeWeakReferencesAndDeferred(); 405 ser.SerializeWeakReferencesAndDeferred();
(...skipping 7998 matching lines...) Expand 10 before | Expand all | Expand 10 after
8403 Address callback_address = 8404 Address callback_address =
8404 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8405 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8405 VMState<EXTERNAL> state(isolate); 8406 VMState<EXTERNAL> state(isolate);
8406 ExternalCallbackScope call_scope(isolate, callback_address); 8407 ExternalCallbackScope call_scope(isolate, callback_address);
8407 callback(info); 8408 callback(info);
8408 } 8409 }
8409 8410
8410 8411
8411 } // namespace internal 8412 } // namespace internal
8412 } // namespace v8 8413 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/bootstrapper.cc » ('j') | src/bootstrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698