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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 i::Object** V8::CopyPersistent(i::Object** obj) { | 503 i::Object** V8::CopyPersistent(i::Object** obj) { |
504 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); | 504 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); |
505 #ifdef DEBUG | 505 #ifdef DEBUG |
506 (*obj)->ObjectVerify(); | 506 (*obj)->ObjectVerify(); |
507 #endif // DEBUG | 507 #endif // DEBUG |
508 return result.location(); | 508 return result.location(); |
509 } | 509 } |
510 | 510 |
511 | 511 |
512 void V8::MakeWeak(i::Object** object, void* parameters, | 512 void V8::MakeWeak(i::Object** object, |
513 WeakCallback weak_callback, V8::WeakHandleType weak_type) { | 513 void* parameters, |
514 i::GlobalHandles::PhantomState phantom; | 514 WeakCallback weak_callback) { |
515 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom | 515 i::GlobalHandles::MakeWeak(object, parameters, weak_callback); |
516 : i::GlobalHandles::Nonphantom; | |
517 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom); | |
518 } | 516 } |
519 | 517 |
520 | 518 |
521 void* V8::ClearWeak(i::Object** obj) { | 519 void* V8::ClearWeak(i::Object** obj) { |
522 return i::GlobalHandles::ClearWeakness(obj); | 520 return i::GlobalHandles::ClearWeakness(obj); |
523 } | 521 } |
524 | 522 |
525 | 523 |
526 void V8::DisposeGlobal(i::Object** obj) { | 524 void V8::DisposeGlobal(i::Object** obj) { |
527 i::GlobalHandles::Destroy(obj); | 525 i::GlobalHandles::Destroy(obj); |
(...skipping 7239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7767 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7765 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7768 Address callback_address = | 7766 Address callback_address = |
7769 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7767 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7770 VMState<EXTERNAL> state(isolate); | 7768 VMState<EXTERNAL> state(isolate); |
7771 ExternalCallbackScope call_scope(isolate, callback_address); | 7769 ExternalCallbackScope call_scope(isolate, callback_address); |
7772 callback(info); | 7770 callback(info); |
7773 } | 7771 } |
7774 | 7772 |
7775 | 7773 |
7776 } } // namespace v8::internal | 7774 } } // namespace v8::internal |
OLD | NEW |