| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 i::Object** V8::CopyPersistent(i::Object** obj) { | 357 i::Object** V8::CopyPersistent(i::Object** obj) { |
| 358 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); | 358 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); |
| 359 #ifdef DEBUG | 359 #ifdef DEBUG |
| 360 (*obj)->ObjectVerify(); | 360 (*obj)->ObjectVerify(); |
| 361 #endif // DEBUG | 361 #endif // DEBUG |
| 362 return result.location(); | 362 return result.location(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 | 365 |
| 366 void V8::MakeWeak(i::Object** object, void* parameters, | 366 void V8::MakeWeak(i::Object** object, void* parameter, |
| 367 WeakCallback weak_callback, V8::WeakHandleType weak_type) { | 367 WeakCallback weak_callback) { |
| 368 i::GlobalHandles::PhantomState phantom; | 368 i::GlobalHandles::MakeWeak(object, parameter, weak_callback); |
| 369 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom | |
| 370 : i::GlobalHandles::Nonphantom; | |
| 371 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom); | |
| 372 } | 369 } |
| 373 | 370 |
| 374 | 371 |
| 372 void V8::MakePhantom(i::Object** object, void* parameter, |
| 373 PhantomCallback weak_callback, int internal_field_index1, |
| 374 int internal_field_index2) { |
| 375 i::GlobalHandles::MakePhantom(object, parameter, weak_callback, internal_field
_index1, internal_field_index2); |
| 376 } |
| 377 |
| 378 |
| 375 void* V8::ClearWeak(i::Object** obj) { | 379 void* V8::ClearWeak(i::Object** obj) { |
| 376 return i::GlobalHandles::ClearWeakness(obj); | 380 return i::GlobalHandles::ClearWeakness(obj); |
| 377 } | 381 } |
| 378 | 382 |
| 379 | 383 |
| 380 void V8::DisposeGlobal(i::Object** obj) { | 384 void V8::DisposeGlobal(i::Object** obj) { |
| 381 i::GlobalHandles::Destroy(obj); | 385 i::GlobalHandles::Destroy(obj); |
| 382 } | 386 } |
| 383 | 387 |
| 384 | 388 |
| (...skipping 7273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7658 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7662 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7659 Address callback_address = | 7663 Address callback_address = |
| 7660 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7664 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7661 VMState<EXTERNAL> state(isolate); | 7665 VMState<EXTERNAL> state(isolate); |
| 7662 ExternalCallbackScope call_scope(isolate, callback_address); | 7666 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7663 callback(info); | 7667 callback(info); |
| 7664 } | 7668 } |
| 7665 | 7669 |
| 7666 | 7670 |
| 7667 } } // namespace v8::internal | 7671 } } // namespace v8::internal |
| OLD | NEW |