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 7785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7796 options); | 7796 options); |
7797 } | 7797 } |
7798 | 7798 |
7799 | 7799 |
7800 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { | 7800 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { |
7801 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7801 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7802 isolate->heap()->VisitExternalResources(visitor); | 7802 isolate->heap()->VisitExternalResources(visitor); |
7803 } | 7803 } |
7804 | 7804 |
7805 | 7805 |
| 7806 bool Isolate::IsInUse() { |
| 7807 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7808 return isolate->IsInUse(); |
| 7809 } |
| 7810 |
| 7811 |
7806 class VisitorAdapter : public i::ObjectVisitor { | 7812 class VisitorAdapter : public i::ObjectVisitor { |
7807 public: | 7813 public: |
7808 explicit VisitorAdapter(PersistentHandleVisitor* visitor) | 7814 explicit VisitorAdapter(PersistentHandleVisitor* visitor) |
7809 : visitor_(visitor) {} | 7815 : visitor_(visitor) {} |
7810 void VisitPointers(i::Object** start, i::Object** end) override { | 7816 void VisitPointers(i::Object** start, i::Object** end) override { |
7811 UNREACHABLE(); | 7817 UNREACHABLE(); |
7812 } | 7818 } |
7813 void VisitEmbedderReference(i::Object** p, uint16_t class_id) override { | 7819 void VisitEmbedderReference(i::Object** p, uint16_t class_id) override { |
7814 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); | 7820 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); |
7815 visitor_->VisitPersistentHandle( | 7821 visitor_->VisitPersistentHandle( |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8817 Address callback_address = | 8823 Address callback_address = |
8818 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8824 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8819 VMState<EXTERNAL> state(isolate); | 8825 VMState<EXTERNAL> state(isolate); |
8820 ExternalCallbackScope call_scope(isolate, callback_address); | 8826 ExternalCallbackScope call_scope(isolate, callback_address); |
8821 callback(info); | 8827 callback(info); |
8822 } | 8828 } |
8823 | 8829 |
8824 | 8830 |
8825 } // namespace internal | 8831 } // namespace internal |
8826 } // namespace v8 | 8832 } // namespace v8 |
OLD | NEW |