| 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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 i::Object** V8::CopyPersistent(i::Object** obj) { | 779 i::Object** V8::CopyPersistent(i::Object** obj) { |
| 780 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); | 780 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); |
| 781 #ifdef VERIFY_HEAP | 781 #ifdef VERIFY_HEAP |
| 782 if (i::FLAG_verify_heap) { | 782 if (i::FLAG_verify_heap) { |
| 783 (*obj)->ObjectVerify(); | 783 (*obj)->ObjectVerify(); |
| 784 } | 784 } |
| 785 #endif // VERIFY_HEAP | 785 #endif // VERIFY_HEAP |
| 786 return result.location(); | 786 return result.location(); |
| 787 } | 787 } |
| 788 | 788 |
| 789 void V8::RegisterExternallyReferencedObject(i::Object** object, | |
| 790 i::Isolate* isolate) { | |
| 791 isolate->heap()->RegisterExternallyReferencedObject(object); | |
| 792 } | |
| 793 | |
| 794 void V8::MakeWeak(i::Object** location, void* parameter, | 789 void V8::MakeWeak(i::Object** location, void* parameter, |
| 795 int internal_field_index1, int internal_field_index2, | 790 int internal_field_index1, int internal_field_index2, |
| 796 WeakCallbackInfo<void>::Callback weak_callback) { | 791 WeakCallbackInfo<void>::Callback weak_callback) { |
| 797 WeakCallbackType type = WeakCallbackType::kParameter; | 792 WeakCallbackType type = WeakCallbackType::kParameter; |
| 798 if (internal_field_index1 == 0) { | 793 if (internal_field_index1 == 0) { |
| 799 if (internal_field_index2 == 1) { | 794 if (internal_field_index2 == 1) { |
| 800 type = WeakCallbackType::kInternalFields; | 795 type = WeakCallbackType::kInternalFields; |
| 801 } else { | 796 } else { |
| 802 DCHECK_EQ(internal_field_index2, -1); | 797 DCHECK_EQ(internal_field_index2, -1); |
| 803 type = WeakCallbackType::kInternalFields; | 798 type = WeakCallbackType::kInternalFields; |
| (...skipping 8682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9486 Address callback_address = | 9481 Address callback_address = |
| 9487 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9482 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9488 VMState<EXTERNAL> state(isolate); | 9483 VMState<EXTERNAL> state(isolate); |
| 9489 ExternalCallbackScope call_scope(isolate, callback_address); | 9484 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9490 callback(info); | 9485 callback(info); |
| 9491 } | 9486 } |
| 9492 | 9487 |
| 9493 | 9488 |
| 9494 } // namespace internal | 9489 } // namespace internal |
| 9495 } // namespace v8 | 9490 } // namespace v8 |
| OLD | NEW |