| OLD | NEW |
| 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 7152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7163 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); | 7163 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); |
| 7164 } | 7164 } |
| 7165 | 7165 |
| 7166 | 7166 |
| 7167 void V8::AddGCEpilogueCallback(GCCallback callback, GCType gc_type) { | 7167 void V8::AddGCEpilogueCallback(GCCallback callback, GCType gc_type) { |
| 7168 i::Isolate* isolate = i::Isolate::Current(); | 7168 i::Isolate* isolate = i::Isolate::Current(); |
| 7169 isolate->heap()->AddGCEpilogueCallback( | 7169 isolate->heap()->AddGCEpilogueCallback( |
| 7170 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); | 7170 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); |
| 7171 } | 7171 } |
| 7172 | 7172 |
| 7173 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { |
| 7174 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7175 isolate->heap()->SetEmbedderHeapTracer(tracer); |
| 7176 } |
| 7177 |
| 7178 void Isolate::UnsetEmbedderHeapTracer() { |
| 7179 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7180 isolate->heap()->UnsetEmbedderHeapTracer(); |
| 7181 } |
| 7173 | 7182 |
| 7174 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback, | 7183 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback, |
| 7175 ObjectSpace space, | 7184 ObjectSpace space, |
| 7176 AllocationAction action) { | 7185 AllocationAction action) { |
| 7177 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7186 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7178 isolate->memory_allocator()->AddMemoryAllocationCallback( | 7187 isolate->memory_allocator()->AddMemoryAllocationCallback( |
| 7179 callback, space, action); | 7188 callback, space, action); |
| 7180 } | 7189 } |
| 7181 | 7190 |
| 7182 | 7191 |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8752 Address callback_address = | 8761 Address callback_address = |
| 8753 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8762 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8754 VMState<EXTERNAL> state(isolate); | 8763 VMState<EXTERNAL> state(isolate); |
| 8755 ExternalCallbackScope call_scope(isolate, callback_address); | 8764 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8756 callback(info); | 8765 callback(info); |
| 8757 } | 8766 } |
| 8758 | 8767 |
| 8759 | 8768 |
| 8760 } // namespace internal | 8769 } // namespace internal |
| 8761 } // namespace v8 | 8770 } // namespace v8 |
| OLD | NEW |