| 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 6446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6457 | 6457 |
| 6458 void Isolate::CancelTerminateExecution() { | 6458 void Isolate::CancelTerminateExecution() { |
| 6459 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 6459 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 6460 isolate->stack_guard()->ClearTerminateExecution(); | 6460 isolate->stack_guard()->ClearTerminateExecution(); |
| 6461 isolate->CancelTerminateExecution(); | 6461 isolate->CancelTerminateExecution(); |
| 6462 } | 6462 } |
| 6463 | 6463 |
| 6464 | 6464 |
| 6465 void Isolate::RequestInterrupt(InterruptCallback callback, void* data) { | 6465 void Isolate::RequestInterrupt(InterruptCallback callback, void* data) { |
| 6466 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 6466 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 6467 isolate->set_api_interrupt_callback(callback); | 6467 isolate->RequestInterrupt(callback, data); |
| 6468 isolate->set_api_interrupt_callback_data(data); | |
| 6469 isolate->stack_guard()->RequestApiInterrupt(); | |
| 6470 } | 6468 } |
| 6471 | 6469 |
| 6472 | 6470 |
| 6473 void Isolate::ClearInterrupt() { | 6471 void Isolate::ClearInterrupt() { |
| 6474 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | |
| 6475 isolate->stack_guard()->ClearApiInterrupt(); | |
| 6476 isolate->set_api_interrupt_callback(NULL); | |
| 6477 isolate->set_api_interrupt_callback_data(NULL); | |
| 6478 } | 6472 } |
| 6479 | 6473 |
| 6480 | 6474 |
| 6481 void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) { | 6475 void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) { |
| 6482 CHECK(i::FLAG_expose_gc); | 6476 CHECK(i::FLAG_expose_gc); |
| 6483 if (type == kMinorGarbageCollection) { | 6477 if (type == kMinorGarbageCollection) { |
| 6484 reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage( | 6478 reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage( |
| 6485 i::NEW_SPACE, "Isolate::RequestGarbageCollection", | 6479 i::NEW_SPACE, "Isolate::RequestGarbageCollection", |
| 6486 kGCCallbackFlagForced); | 6480 kGCCallbackFlagForced); |
| 6487 } else { | 6481 } else { |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7754 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7748 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7755 Address callback_address = | 7749 Address callback_address = |
| 7756 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7750 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7757 VMState<EXTERNAL> state(isolate); | 7751 VMState<EXTERNAL> state(isolate); |
| 7758 ExternalCallbackScope call_scope(isolate, callback_address); | 7752 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7759 callback(info); | 7753 callback(info); |
| 7760 } | 7754 } |
| 7761 | 7755 |
| 7762 | 7756 |
| 7763 } } // namespace v8::internal | 7757 } } // namespace v8::internal |
| OLD | NEW |