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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 i::Object** V8::CopyPersistent(i::Object** obj) { | 396 i::Object** V8::CopyPersistent(i::Object** obj) { |
397 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); | 397 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); |
398 #ifdef VERIFY_HEAP | 398 #ifdef VERIFY_HEAP |
399 (*obj)->ObjectVerify(); | 399 (*obj)->ObjectVerify(); |
400 #endif // VERIFY_HEAP | 400 #endif // VERIFY_HEAP |
401 return result.location(); | 401 return result.location(); |
402 } | 402 } |
403 | 403 |
404 | 404 |
405 void V8::MakeWeak(i::Object** object, void* parameters, | 405 void V8::MakeWeak(i::Object** object, void* parameter, |
406 WeakCallback weak_callback, V8::WeakHandleType weak_type) { | 406 WeakCallback weak_callback) { |
407 i::GlobalHandles::PhantomState phantom; | 407 i::GlobalHandles::MakeWeak(object, parameter, weak_callback); |
408 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom | |
409 : i::GlobalHandles::Nonphantom; | |
410 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom); | |
411 } | 408 } |
412 | 409 |
413 | 410 |
| 411 void V8::MakePhantom(i::Object** object, void* parameter, |
| 412 PhantomCallbackData<void>::Callback weak_callback) { |
| 413 i::GlobalHandles::MakePhantom(object, parameter, weak_callback); |
| 414 } |
| 415 |
| 416 |
| 417 void V8::MakePhantom( |
| 418 i::Object** object, |
| 419 InternalFieldsCallbackData<void, void>::Callback weak_callback, |
| 420 int internal_field_index1, int internal_field_index2) { |
| 421 i::GlobalHandles::MakePhantom(object, weak_callback, internal_field_index1, |
| 422 internal_field_index2); |
| 423 } |
| 424 |
| 425 |
414 void* V8::ClearWeak(i::Object** obj) { | 426 void* V8::ClearWeak(i::Object** obj) { |
415 return i::GlobalHandles::ClearWeakness(obj); | 427 return i::GlobalHandles::ClearWeakness(obj); |
416 } | 428 } |
417 | 429 |
418 | 430 |
419 void V8::DisposeGlobal(i::Object** obj) { | 431 void V8::DisposeGlobal(i::Object** obj) { |
420 i::GlobalHandles::Destroy(obj); | 432 i::GlobalHandles::Destroy(obj); |
421 } | 433 } |
422 | 434 |
423 | 435 |
(...skipping 7330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7754 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7766 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7755 Address callback_address = | 7767 Address callback_address = |
7756 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7768 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7757 VMState<EXTERNAL> state(isolate); | 7769 VMState<EXTERNAL> state(isolate); |
7758 ExternalCallbackScope call_scope(isolate, callback_address); | 7770 ExternalCallbackScope call_scope(isolate, callback_address); |
7759 callback(info); | 7771 callback(info); |
7760 } | 7772 } |
7761 | 7773 |
7762 | 7774 |
7763 } } // namespace v8::internal | 7775 } } // namespace v8::internal |
OLD | NEW |