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 8422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8433 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8433 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8434 isolate->heap()->MemoryPressureNotification(level, Locker::IsLocked(this)); | 8434 isolate->heap()->MemoryPressureNotification(level, Locker::IsLocked(this)); |
8435 isolate->allocator()->MemoryPressureNotification(level); | 8435 isolate->allocator()->MemoryPressureNotification(level); |
8436 } | 8436 } |
8437 | 8437 |
8438 void Isolate::SetRAILMode(RAILMode rail_mode) { | 8438 void Isolate::SetRAILMode(RAILMode rail_mode) { |
8439 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8439 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8440 return isolate->SetRAILMode(rail_mode); | 8440 return isolate->SetRAILMode(rail_mode); |
8441 } | 8441 } |
8442 | 8442 |
| 8443 void Isolate::IncreaseHeapLimitForDebugging() { |
| 8444 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8445 isolate->heap()->IncreaseHeapLimitForDebugging(); |
| 8446 } |
| 8447 |
| 8448 void Isolate::RestoreOriginalHeapLimit() { |
| 8449 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8450 isolate->heap()->RestoreOriginalHeapLimit(); |
| 8451 } |
| 8452 |
8443 void Isolate::SetJitCodeEventHandler(JitCodeEventOptions options, | 8453 void Isolate::SetJitCodeEventHandler(JitCodeEventOptions options, |
8444 JitCodeEventHandler event_handler) { | 8454 JitCodeEventHandler event_handler) { |
8445 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8455 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8446 // Ensure that logging is initialized for our isolate. | 8456 // Ensure that logging is initialized for our isolate. |
8447 isolate->InitializeLoggingAndCounters(); | 8457 isolate->InitializeLoggingAndCounters(); |
8448 isolate->logger()->SetCodeEventHandler(options, event_handler); | 8458 isolate->logger()->SetCodeEventHandler(options, event_handler); |
8449 } | 8459 } |
8450 | 8460 |
8451 | 8461 |
8452 void Isolate::SetStackLimit(uintptr_t stack_limit) { | 8462 void Isolate::SetStackLimit(uintptr_t stack_limit) { |
8453 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8463 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8454 CHECK(stack_limit); | 8464 CHECK(stack_limit); |
8455 isolate->stack_guard()->SetStackLimit(stack_limit); | 8465 isolate->stack_guard()->SetStackLimit(stack_limit); |
8456 } | 8466 } |
8457 | 8467 |
8458 | |
8459 void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) { | 8468 void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) { |
8460 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8469 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8461 if (isolate->heap()->memory_allocator()->code_range()->valid()) { | 8470 if (isolate->heap()->memory_allocator()->code_range()->valid()) { |
8462 *start = isolate->heap()->memory_allocator()->code_range()->start(); | 8471 *start = isolate->heap()->memory_allocator()->code_range()->start(); |
8463 *length_in_bytes = | 8472 *length_in_bytes = |
8464 isolate->heap()->memory_allocator()->code_range()->size(); | 8473 isolate->heap()->memory_allocator()->code_range()->size(); |
8465 } else { | 8474 } else { |
8466 *start = NULL; | 8475 *start = NULL; |
8467 *length_in_bytes = 0; | 8476 *length_in_bytes = 0; |
8468 } | 8477 } |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9922 Address callback_address = | 9931 Address callback_address = |
9923 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9932 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9924 VMState<EXTERNAL> state(isolate); | 9933 VMState<EXTERNAL> state(isolate); |
9925 ExternalCallbackScope call_scope(isolate, callback_address); | 9934 ExternalCallbackScope call_scope(isolate, callback_address); |
9926 callback(info); | 9935 callback(info); |
9927 } | 9936 } |
9928 | 9937 |
9929 | 9938 |
9930 } // namespace internal | 9939 } // namespace internal |
9931 } // namespace v8 | 9940 } // namespace v8 |
OLD | NEW |