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 7817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7828 options); | 7828 options); |
7829 } | 7829 } |
7830 | 7830 |
7831 | 7831 |
7832 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { | 7832 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { |
7833 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7833 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7834 isolate->heap()->VisitExternalResources(visitor); | 7834 isolate->heap()->VisitExternalResources(visitor); |
7835 } | 7835 } |
7836 | 7836 |
7837 | 7837 |
| 7838 bool Isolate::IsInUse() { |
| 7839 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7840 return isolate->IsInUse(); |
| 7841 } |
| 7842 |
| 7843 |
7838 class VisitorAdapter : public i::ObjectVisitor { | 7844 class VisitorAdapter : public i::ObjectVisitor { |
7839 public: | 7845 public: |
7840 explicit VisitorAdapter(PersistentHandleVisitor* visitor) | 7846 explicit VisitorAdapter(PersistentHandleVisitor* visitor) |
7841 : visitor_(visitor) {} | 7847 : visitor_(visitor) {} |
7842 void VisitPointers(i::Object** start, i::Object** end) override { | 7848 void VisitPointers(i::Object** start, i::Object** end) override { |
7843 UNREACHABLE(); | 7849 UNREACHABLE(); |
7844 } | 7850 } |
7845 void VisitEmbedderReference(i::Object** p, uint16_t class_id) override { | 7851 void VisitEmbedderReference(i::Object** p, uint16_t class_id) override { |
7846 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); | 7852 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); |
7847 visitor_->VisitPersistentHandle( | 7853 visitor_->VisitPersistentHandle( |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8847 Address callback_address = | 8853 Address callback_address = |
8848 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8854 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8849 VMState<EXTERNAL> state(isolate); | 8855 VMState<EXTERNAL> state(isolate); |
8850 ExternalCallbackScope call_scope(isolate, callback_address); | 8856 ExternalCallbackScope call_scope(isolate, callback_address); |
8851 callback(info); | 8857 callback(info); |
8852 } | 8858 } |
8853 | 8859 |
8854 | 8860 |
8855 } // namespace internal | 8861 } // namespace internal |
8856 } // namespace v8 | 8862 } // namespace v8 |
OLD | NEW |