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 8537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8548 } | 8548 } |
8549 | 8549 |
8550 | 8550 |
8551 void Isolate::IsolateInBackgroundNotification() { | 8551 void Isolate::IsolateInBackgroundNotification() { |
8552 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8552 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8553 return isolate->IsolateInBackgroundNotification(); | 8553 return isolate->IsolateInBackgroundNotification(); |
8554 } | 8554 } |
8555 | 8555 |
8556 void Isolate::MemoryPressureNotification(MemoryPressureLevel level) { | 8556 void Isolate::MemoryPressureNotification(MemoryPressureLevel level) { |
8557 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8557 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8558 isolate->heap()->MemoryPressureNotification(level, Locker::IsLocked(this)); | 8558 bool on_isolate_thread = |
| 8559 v8::Locker::IsActive() |
| 8560 ? isolate->thread_manager()->IsLockedByCurrentThread() |
| 8561 : i::ThreadId::Current().Equals(isolate->thread_id()); |
| 8562 isolate->heap()->MemoryPressureNotification(level, on_isolate_thread); |
8559 isolate->allocator()->MemoryPressureNotification(level); | 8563 isolate->allocator()->MemoryPressureNotification(level); |
8560 isolate->compiler_dispatcher()->MemoryPressureNotification( | 8564 isolate->compiler_dispatcher()->MemoryPressureNotification(level, |
8561 level, Locker::IsLocked(this)); | 8565 on_isolate_thread); |
8562 } | 8566 } |
8563 | 8567 |
8564 void Isolate::SetRAILMode(RAILMode rail_mode) { | 8568 void Isolate::SetRAILMode(RAILMode rail_mode) { |
8565 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8569 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8566 return isolate->SetRAILMode(rail_mode); | 8570 return isolate->SetRAILMode(rail_mode); |
8567 } | 8571 } |
8568 | 8572 |
8569 void Isolate::IncreaseHeapLimitForDebugging() { | 8573 void Isolate::IncreaseHeapLimitForDebugging() { |
8570 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8574 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8571 isolate->heap()->IncreaseHeapLimitForDebugging(); | 8575 isolate->heap()->IncreaseHeapLimitForDebugging(); |
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10136 Address callback_address = | 10140 Address callback_address = |
10137 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10141 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10138 VMState<EXTERNAL> state(isolate); | 10142 VMState<EXTERNAL> state(isolate); |
10139 ExternalCallbackScope call_scope(isolate, callback_address); | 10143 ExternalCallbackScope call_scope(isolate, callback_address); |
10140 callback(info); | 10144 callback(info); |
10141 } | 10145 } |
10142 | 10146 |
10143 | 10147 |
10144 } // namespace internal | 10148 } // namespace internal |
10145 } // namespace v8 | 10149 } // namespace v8 |
OLD | NEW |