| 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, | 512 void V8::MakeWeak(i::Object** object, void* parameters, |
| 513 void* parameters, | 513 WeakCallback weak_callback, V8::WeakHandleType weak_type) { |
| 514 WeakCallback weak_callback) { | 514 i::GlobalHandles::PhantomState phantom; |
| 515 i::GlobalHandles::MakeWeak(object, parameters, weak_callback); | 515 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom |
| 516 : i::GlobalHandles::Nonphantom; |
| 517 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom); |
| 516 } | 518 } |
| 517 | 519 |
| 518 | 520 |
| 519 void* V8::ClearWeak(i::Object** obj) { | 521 void* V8::ClearWeak(i::Object** obj) { |
| 520 return i::GlobalHandles::ClearWeakness(obj); | 522 return i::GlobalHandles::ClearWeakness(obj); |
| 521 } | 523 } |
| 522 | 524 |
| 523 | 525 |
| 524 void V8::DisposeGlobal(i::Object** obj) { | 526 void V8::DisposeGlobal(i::Object** obj) { |
| 525 i::GlobalHandles::Destroy(obj); | 527 i::GlobalHandles::Destroy(obj); |
| (...skipping 7167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7693 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7695 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7694 Address callback_address = | 7696 Address callback_address = |
| 7695 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7697 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7696 VMState<EXTERNAL> state(isolate); | 7698 VMState<EXTERNAL> state(isolate); |
| 7697 ExternalCallbackScope call_scope(isolate, callback_address); | 7699 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7698 callback(info); | 7700 callback(info); |
| 7699 } | 7701 } |
| 7700 | 7702 |
| 7701 | 7703 |
| 7702 } } // namespace v8::internal | 7704 } } // namespace v8::internal |
| OLD | NEW |