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 7600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7611 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { | 7611 void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) { |
7612 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7612 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7613 isolate->heap()->VisitExternalResources(visitor); | 7613 isolate->heap()->VisitExternalResources(visitor); |
7614 } | 7614 } |
7615 | 7615 |
7616 | 7616 |
7617 class VisitorAdapter : public i::ObjectVisitor { | 7617 class VisitorAdapter : public i::ObjectVisitor { |
7618 public: | 7618 public: |
7619 explicit VisitorAdapter(PersistentHandleVisitor* visitor) | 7619 explicit VisitorAdapter(PersistentHandleVisitor* visitor) |
7620 : visitor_(visitor) {} | 7620 : visitor_(visitor) {} |
7621 virtual void VisitPointers(i::Object** start, i::Object** end) { | 7621 void VisitPointers(i::Object** start, i::Object** end) override { |
7622 UNREACHABLE(); | 7622 UNREACHABLE(); |
7623 } | 7623 } |
7624 virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) { | 7624 void VisitEmbedderReference(i::Object** p, uint16_t class_id) override { |
7625 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); | 7625 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); |
7626 visitor_->VisitPersistentHandle( | 7626 visitor_->VisitPersistentHandle( |
7627 reinterpret_cast<Persistent<Value>*>(&value), class_id); | 7627 reinterpret_cast<Persistent<Value>*>(&value), class_id); |
7628 } | 7628 } |
7629 | 7629 |
7630 private: | 7630 private: |
7631 PersistentHandleVisitor* visitor_; | 7631 PersistentHandleVisitor* visitor_; |
7632 }; | 7632 }; |
7633 | 7633 |
7634 | 7634 |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8519 Address callback_address = | 8519 Address callback_address = |
8520 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8520 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8521 VMState<EXTERNAL> state(isolate); | 8521 VMState<EXTERNAL> state(isolate); |
8522 ExternalCallbackScope call_scope(isolate, callback_address); | 8522 ExternalCallbackScope call_scope(isolate, callback_address); |
8523 callback(info); | 8523 callback(info); |
8524 } | 8524 } |
8525 | 8525 |
8526 | 8526 |
8527 } // namespace internal | 8527 } // namespace internal |
8528 } // namespace v8 | 8528 } // namespace v8 |
OLD | NEW |