| 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 8208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8219 i::Isolate* isolate = i::Isolate::Current(); | 8219 i::Isolate* isolate = i::Isolate::Current(); |
| 8220 isolate->heap()->AddGCEpilogueCallback( | 8220 isolate->heap()->AddGCEpilogueCallback( |
| 8221 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); | 8221 reinterpret_cast<v8::Isolate::GCCallback>(callback), gc_type, false); |
| 8222 } | 8222 } |
| 8223 | 8223 |
| 8224 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { | 8224 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { |
| 8225 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8225 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8226 isolate->heap()->SetEmbedderHeapTracer(tracer); | 8226 isolate->heap()->SetEmbedderHeapTracer(tracer); |
| 8227 } | 8227 } |
| 8228 | 8228 |
| 8229 void Isolate::SetGetExternallyAllocatedMemoryInBytesCallback( |
| 8230 GetExternallyAllocatedMemoryInBytesCallback callback) { |
| 8231 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8232 isolate->heap()->SetGetExternallyAllocatedMemoryInBytesCallback(callback); |
| 8233 } |
| 8234 |
| 8229 void Isolate::TerminateExecution() { | 8235 void Isolate::TerminateExecution() { |
| 8230 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8236 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8231 isolate->stack_guard()->RequestTerminateExecution(); | 8237 isolate->stack_guard()->RequestTerminateExecution(); |
| 8232 } | 8238 } |
| 8233 | 8239 |
| 8234 | 8240 |
| 8235 bool Isolate::IsExecutionTerminating() { | 8241 bool Isolate::IsExecutionTerminating() { |
| 8236 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8242 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8237 return IsExecutionTerminatingCheck(isolate); | 8243 return IsExecutionTerminatingCheck(isolate); |
| 8238 } | 8244 } |
| (...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10464 Address callback_address = | 10470 Address callback_address = |
| 10465 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10471 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10466 VMState<EXTERNAL> state(isolate); | 10472 VMState<EXTERNAL> state(isolate); |
| 10467 ExternalCallbackScope call_scope(isolate, callback_address); | 10473 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10468 callback(info); | 10474 callback(info); |
| 10469 } | 10475 } |
| 10470 | 10476 |
| 10471 | 10477 |
| 10472 } // namespace internal | 10478 } // namespace internal |
| 10473 } // namespace v8 | 10479 } // namespace v8 |
| OLD | NEW |