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

Side by Side Diff: src/api.cc

Issue 1815153002: Introduce EmbedderHeapTracer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate Jochen's wonderful comments Created 4 years, 8 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 i::Object** V8::CopyPersistent(i::Object** obj) { 670 i::Object** V8::CopyPersistent(i::Object** obj) {
671 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); 671 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
672 #ifdef VERIFY_HEAP 672 #ifdef VERIFY_HEAP
673 if (i::FLAG_verify_heap) { 673 if (i::FLAG_verify_heap) {
674 (*obj)->ObjectVerify(); 674 (*obj)->ObjectVerify();
675 } 675 }
676 #endif // VERIFY_HEAP 676 #endif // VERIFY_HEAP
677 return result.location(); 677 return result.location();
678 } 678 }
679 679
680 void V8::AddObjectToMarkingDeque(i::Object** object, i::Isolate* isolate) {
681 i::GlobalHandles::AddObjectToMarkingDeque(object, isolate);
Hannes Payer (out of office) 2016/03/31 11:13:22 Why do you go through GlobalHandles? You could cal
Marcel Hlopko 2016/03/31 11:58:59 Seemed like I should leave a breadcrumb in the glo
682 }
680 683
681 void V8::MakeWeak(i::Object** object, void* parameter, 684 void V8::MakeWeak(i::Object** object, void* parameter,
682 WeakCallback weak_callback) { 685 WeakCallback weak_callback) {
683 i::GlobalHandles::MakeWeak(object, parameter, weak_callback); 686 i::GlobalHandles::MakeWeak(object, parameter, weak_callback);
684 } 687 }
685 688
686 689
687 void V8::MakeWeak(i::Object** object, void* parameter, 690 void V8::MakeWeak(i::Object** object, void* parameter,
688 int internal_field_index1, int internal_field_index2, 691 int internal_field_index1, int internal_field_index2,
689 WeakCallbackInfo<void>::Callback weak_callback) { 692 WeakCallbackInfo<void>::Callback weak_callback) {
(...skipping 6477 matching lines...) Expand 10 before | Expand all | Expand 10 after
7167 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); 7170 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false);
7168 } 7171 }
7169 7172
7170 7173
7171 void V8::AddGCEpilogueCallback(GCCallback callback, GCType gc_type) { 7174 void V8::AddGCEpilogueCallback(GCCallback callback, GCType gc_type) {
7172 i::Isolate* isolate = i::Isolate::Current(); 7175 i::Isolate* isolate = i::Isolate::Current();
7173 isolate->heap()->AddGCEpilogueCallback( 7176 isolate->heap()->AddGCEpilogueCallback(
7174 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); 7177 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false);
7175 } 7178 }
7176 7179
7180 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
7181 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7182 isolate->heap()->SetEmbedderHeapTracer(tracer);
7183 }
7177 7184
7178 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback, 7185 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback,
7179 ObjectSpace space, 7186 ObjectSpace space,
7180 AllocationAction action) { 7187 AllocationAction action) {
7181 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7188 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7182 isolate->memory_allocator()->AddMemoryAllocationCallback( 7189 isolate->memory_allocator()->AddMemoryAllocationCallback(
7183 callback, space, action); 7190 callback, space, action);
7184 } 7191 }
7185 7192
7186 7193
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
8761 Address callback_address = 8768 Address callback_address =
8762 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8769 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8763 VMState<EXTERNAL> state(isolate); 8770 VMState<EXTERNAL> state(isolate);
8764 ExternalCallbackScope call_scope(isolate, callback_address); 8771 ExternalCallbackScope call_scope(isolate, callback_address);
8765 callback(info); 8772 callback(info);
8766 } 8773 }
8767 8774
8768 8775
8769 } // namespace internal 8776 } // namespace internal
8770 } // namespace v8 8777 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698