| OLD | NEW |
| 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 /** | 390 /** |
| 391 *Checks if the handle holds the only reference to an object. | 391 *Checks if the handle holds the only reference to an object. |
| 392 */ | 392 */ |
| 393 inline bool IsNearDeath() const; | 393 inline bool IsNearDeath() const; |
| 394 | 394 |
| 395 /** | 395 /** |
| 396 * Returns true if the handle's reference is weak. | 396 * Returns true if the handle's reference is weak. |
| 397 */ | 397 */ |
| 398 inline bool IsWeak() const; | 398 inline bool IsWeak() const; |
| 399 | 399 |
| 400 /** |
| 401 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo |
| 402 * interface description in v8-profiler.h for details. |
| 403 */ |
| 404 inline void SetWrapperClassId(uint16_t class_id); |
| 405 |
| 400 private: | 406 private: |
| 401 friend class ImplementationUtilities; | 407 friend class ImplementationUtilities; |
| 402 friend class ObjectTemplate; | 408 friend class ObjectTemplate; |
| 403 }; | 409 }; |
| 404 | 410 |
| 405 | 411 |
| 406 /** | 412 /** |
| 407 * A stack-allocated class that governs a number of local handles. | 413 * A stack-allocated class that governs a number of local handles. |
| 408 * After a handle scope has been created, all local handles will be | 414 * After a handle scope has been created, all local handles will be |
| 409 * allocated within that handle scope until either the handle scope is | 415 * allocated within that handle scope until either the handle scope is |
| (...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2530 | 2536 |
| 2531 size_t total_heap_size_; | 2537 size_t total_heap_size_; |
| 2532 size_t total_heap_size_executable_; | 2538 size_t total_heap_size_executable_; |
| 2533 size_t used_heap_size_; | 2539 size_t used_heap_size_; |
| 2534 size_t heap_size_limit_; | 2540 size_t heap_size_limit_; |
| 2535 | 2541 |
| 2536 friend class V8; | 2542 friend class V8; |
| 2537 }; | 2543 }; |
| 2538 | 2544 |
| 2539 | 2545 |
| 2546 class RetainedObjectInfo; |
| 2547 |
| 2540 /** | 2548 /** |
| 2541 * Isolate represents an isolated instance of the V8 engine. V8 | 2549 * Isolate represents an isolated instance of the V8 engine. V8 |
| 2542 * isolates have completely separate states. Objects from one isolate | 2550 * isolates have completely separate states. Objects from one isolate |
| 2543 * must not be used in other isolates. When V8 is initialized a | 2551 * must not be used in other isolates. When V8 is initialized a |
| 2544 * default isolate is implicitly created and entered. The embedder | 2552 * default isolate is implicitly created and entered. The embedder |
| 2545 * can create additional isolates and use them in parallel in multiple | 2553 * can create additional isolates and use them in parallel in multiple |
| 2546 * threads. An isolate can be entered by at most one thread at any | 2554 * threads. An isolate can be entered by at most one thread at any |
| 2547 * given time. The Locker/Unlocker API can be used to synchronize. | 2555 * given time. The Locker/Unlocker API can be used to synchronize. |
| 2548 */ | 2556 */ |
| 2549 class V8EXPORT Isolate { | 2557 class V8EXPORT Isolate { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 */ | 2791 */ |
| 2784 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); | 2792 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); |
| 2785 | 2793 |
| 2786 /** | 2794 /** |
| 2787 * Allows the host application to group objects together. If one | 2795 * Allows the host application to group objects together. If one |
| 2788 * object in the group is alive, all objects in the group are alive. | 2796 * object in the group is alive, all objects in the group are alive. |
| 2789 * After each garbage collection, object groups are removed. It is | 2797 * After each garbage collection, object groups are removed. It is |
| 2790 * intended to be used in the before-garbage-collection callback | 2798 * intended to be used in the before-garbage-collection callback |
| 2791 * function, for instance to simulate DOM tree connections among JS | 2799 * function, for instance to simulate DOM tree connections among JS |
| 2792 * wrapper objects. | 2800 * wrapper objects. |
| 2801 * See v8-profiler.h for RetainedObjectInfo interface description. |
| 2793 */ | 2802 */ |
| 2794 static void AddObjectGroup(Persistent<Value>* objects, size_t length); | 2803 static void AddObjectGroup(Persistent<Value>* objects, |
| 2804 size_t length, |
| 2805 RetainedObjectInfo* info = NULL); |
| 2795 | 2806 |
| 2796 /** | 2807 /** |
| 2797 * Initializes from snapshot if possible. Otherwise, attempts to | 2808 * Initializes from snapshot if possible. Otherwise, attempts to |
| 2798 * initialize from scratch. This function is called implicitly if | 2809 * initialize from scratch. This function is called implicitly if |
| 2799 * you use the API without calling it first. | 2810 * you use the API without calling it first. |
| 2800 */ | 2811 */ |
| 2801 static bool Initialize(); | 2812 static bool Initialize(); |
| 2802 | 2813 |
| 2803 /** | 2814 /** |
| 2804 * Adjusts the amount of registered external memory. Used to give | 2815 * Adjusts the amount of registered external memory. Used to give |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2993 V8(); | 3004 V8(); |
| 2994 | 3005 |
| 2995 static internal::Object** GlobalizeReference(internal::Object** handle); | 3006 static internal::Object** GlobalizeReference(internal::Object** handle); |
| 2996 static void DisposeGlobal(internal::Object** global_handle); | 3007 static void DisposeGlobal(internal::Object** global_handle); |
| 2997 static void MakeWeak(internal::Object** global_handle, | 3008 static void MakeWeak(internal::Object** global_handle, |
| 2998 void* data, | 3009 void* data, |
| 2999 WeakReferenceCallback); | 3010 WeakReferenceCallback); |
| 3000 static void ClearWeak(internal::Object** global_handle); | 3011 static void ClearWeak(internal::Object** global_handle); |
| 3001 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3012 static bool IsGlobalNearDeath(internal::Object** global_handle); |
| 3002 static bool IsGlobalWeak(internal::Object** global_handle); | 3013 static bool IsGlobalWeak(internal::Object** global_handle); |
| 3014 static void SetWrapperClassId(internal::Object** global_handle, |
| 3015 uint16_t class_id); |
| 3003 | 3016 |
| 3004 template <class T> friend class Handle; | 3017 template <class T> friend class Handle; |
| 3005 template <class T> friend class Local; | 3018 template <class T> friend class Local; |
| 3006 template <class T> friend class Persistent; | 3019 template <class T> friend class Persistent; |
| 3007 friend class Context; | 3020 friend class Context; |
| 3008 }; | 3021 }; |
| 3009 | 3022 |
| 3010 | 3023 |
| 3011 /** | 3024 /** |
| 3012 * An external exception handler. | 3025 * An external exception handler. |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3665 V8::MakeWeak(reinterpret_cast<internal::Object**>(**this), | 3678 V8::MakeWeak(reinterpret_cast<internal::Object**>(**this), |
| 3666 parameters, | 3679 parameters, |
| 3667 callback); | 3680 callback); |
| 3668 } | 3681 } |
| 3669 | 3682 |
| 3670 template <class T> | 3683 template <class T> |
| 3671 void Persistent<T>::ClearWeak() { | 3684 void Persistent<T>::ClearWeak() { |
| 3672 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); | 3685 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
| 3673 } | 3686 } |
| 3674 | 3687 |
| 3688 template <class T> |
| 3689 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
| 3690 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
| 3691 } |
| 3675 | 3692 |
| 3676 Arguments::Arguments(internal::Object** implicit_args, | 3693 Arguments::Arguments(internal::Object** implicit_args, |
| 3677 internal::Object** values, int length, | 3694 internal::Object** values, int length, |
| 3678 bool is_construct_call) | 3695 bool is_construct_call) |
| 3679 : implicit_args_(implicit_args), | 3696 : implicit_args_(implicit_args), |
| 3680 values_(values), | 3697 values_(values), |
| 3681 length_(length), | 3698 length_(length), |
| 3682 is_construct_call_(is_construct_call) { } | 3699 is_construct_call_(is_construct_call) { } |
| 3683 | 3700 |
| 3684 | 3701 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3949 | 3966 |
| 3950 | 3967 |
| 3951 } // namespace v8 | 3968 } // namespace v8 |
| 3952 | 3969 |
| 3953 | 3970 |
| 3954 #undef V8EXPORT | 3971 #undef V8EXPORT |
| 3955 #undef TYPE_CHECK | 3972 #undef TYPE_CHECK |
| 3956 | 3973 |
| 3957 | 3974 |
| 3958 #endif // V8_H_ | 3975 #endif // V8_H_ |
| OLD | NEW |