Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: include/v8.h

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « SConstruct ('k') | include/v8-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 /** 389 /**
390 *Checks if the handle holds the only reference to an object. 390 *Checks if the handle holds the only reference to an object.
391 */ 391 */
392 inline bool IsNearDeath() const; 392 inline bool IsNearDeath() const;
393 393
394 /** 394 /**
395 * Returns true if the handle's reference is weak. 395 * Returns true if the handle's reference is weak.
396 */ 396 */
397 inline bool IsWeak() const; 397 inline bool IsWeak() const;
398 398
399 /**
400 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo
401 * interface description in v8-profiler.h for details.
402 */
403 inline void SetWrapperClassId(uint16_t class_id);
404
399 private: 405 private:
400 friend class ImplementationUtilities; 406 friend class ImplementationUtilities;
401 friend class ObjectTemplate; 407 friend class ObjectTemplate;
402 }; 408 };
403 409
404 410
405 /** 411 /**
406 * A stack-allocated class that governs a number of local handles. 412 * A stack-allocated class that governs a number of local handles.
407 * After a handle scope has been created, all local handles will be 413 * After a handle scope has been created, all local handles will be
408 * allocated within that handle scope until either the handle scope is 414 * allocated within that handle scope until either the handle scope is
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 DontDelete = 1 << 2 1434 DontDelete = 1 << 2
1429 }; 1435 };
1430 1436
1431 enum ExternalArrayType { 1437 enum ExternalArrayType {
1432 kExternalByteArray = 1, 1438 kExternalByteArray = 1,
1433 kExternalUnsignedByteArray, 1439 kExternalUnsignedByteArray,
1434 kExternalShortArray, 1440 kExternalShortArray,
1435 kExternalUnsignedShortArray, 1441 kExternalUnsignedShortArray,
1436 kExternalIntArray, 1442 kExternalIntArray,
1437 kExternalUnsignedIntArray, 1443 kExternalUnsignedIntArray,
1438 kExternalFloatArray 1444 kExternalFloatArray,
1445 kExternalPixelArray
1439 }; 1446 };
1440 1447
1441 /** 1448 /**
1442 * Accessor[Getter|Setter] are used as callback functions when 1449 * Accessor[Getter|Setter] are used as callback functions when
1443 * setting|getting a particular property. See Object and ObjectTemplate's 1450 * setting|getting a particular property. See Object and ObjectTemplate's
1444 * method SetAccessor. 1451 * method SetAccessor.
1445 */ 1452 */
1446 typedef Handle<Value> (*AccessorGetter)(Local<String> property, 1453 typedef Handle<Value> (*AccessorGetter)(Local<String> property,
1447 const AccessorInfo& info); 1454 const AccessorInfo& info);
1448 1455
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2526 2533
2527 size_t total_heap_size_; 2534 size_t total_heap_size_;
2528 size_t total_heap_size_executable_; 2535 size_t total_heap_size_executable_;
2529 size_t used_heap_size_; 2536 size_t used_heap_size_;
2530 size_t heap_size_limit_; 2537 size_t heap_size_limit_;
2531 2538
2532 friend class V8; 2539 friend class V8;
2533 }; 2540 };
2534 2541
2535 2542
2543 class RetainedObjectInfo;
2544
2536 /** 2545 /**
2537 * Container class for static utility functions. 2546 * Container class for static utility functions.
2538 */ 2547 */
2539 class V8EXPORT V8 { 2548 class V8EXPORT V8 {
2540 public: 2549 public:
2541 /** Set the callback to invoke in case of fatal errors. */ 2550 /** Set the callback to invoke in case of fatal errors. */
2542 static void SetFatalErrorHandler(FatalErrorCallback that); 2551 static void SetFatalErrorHandler(FatalErrorCallback that);
2543 2552
2544 /** 2553 /**
2545 * Ignore out-of-memory exceptions. 2554 * Ignore out-of-memory exceptions.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 */ 2704 */
2696 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); 2705 static void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback);
2697 2706
2698 /** 2707 /**
2699 * Allows the host application to group objects together. If one 2708 * Allows the host application to group objects together. If one
2700 * object in the group is alive, all objects in the group are alive. 2709 * object in the group is alive, all objects in the group are alive.
2701 * After each garbage collection, object groups are removed. It is 2710 * After each garbage collection, object groups are removed. It is
2702 * intended to be used in the before-garbage-collection callback 2711 * intended to be used in the before-garbage-collection callback
2703 * function, for instance to simulate DOM tree connections among JS 2712 * function, for instance to simulate DOM tree connections among JS
2704 * wrapper objects. 2713 * wrapper objects.
2714 * See v8-profiler.h for RetainedObjectInfo interface description.
2705 */ 2715 */
2706 static void AddObjectGroup(Persistent<Value>* objects, size_t length); 2716 static void AddObjectGroup(Persistent<Value>* objects,
2717 size_t length,
2718 RetainedObjectInfo* info = NULL);
2707 2719
2708 /** 2720 /**
2709 * Initializes from snapshot if possible. Otherwise, attempts to 2721 * Initializes from snapshot if possible. Otherwise, attempts to
2710 * initialize from scratch. This function is called implicitly if 2722 * initialize from scratch. This function is called implicitly if
2711 * you use the API without calling it first. 2723 * you use the API without calling it first.
2712 */ 2724 */
2713 static bool Initialize(); 2725 static bool Initialize();
2714 2726
2715 /** 2727 /**
2716 * Adjusts the amount of registered external memory. Used to give 2728 * Adjusts the amount of registered external memory. Used to give
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2905 V8(); 2917 V8();
2906 2918
2907 static internal::Object** GlobalizeReference(internal::Object** handle); 2919 static internal::Object** GlobalizeReference(internal::Object** handle);
2908 static void DisposeGlobal(internal::Object** global_handle); 2920 static void DisposeGlobal(internal::Object** global_handle);
2909 static void MakeWeak(internal::Object** global_handle, 2921 static void MakeWeak(internal::Object** global_handle,
2910 void* data, 2922 void* data,
2911 WeakReferenceCallback); 2923 WeakReferenceCallback);
2912 static void ClearWeak(internal::Object** global_handle); 2924 static void ClearWeak(internal::Object** global_handle);
2913 static bool IsGlobalNearDeath(internal::Object** global_handle); 2925 static bool IsGlobalNearDeath(internal::Object** global_handle);
2914 static bool IsGlobalWeak(internal::Object** global_handle); 2926 static bool IsGlobalWeak(internal::Object** global_handle);
2927 static void SetWrapperClassId(internal::Object** global_handle,
2928 uint16_t class_id);
2915 2929
2916 template <class T> friend class Handle; 2930 template <class T> friend class Handle;
2917 template <class T> friend class Local; 2931 template <class T> friend class Local;
2918 template <class T> friend class Persistent; 2932 template <class T> friend class Persistent;
2919 friend class Context; 2933 friend class Context;
2920 }; 2934 };
2921 2935
2922 2936
2923 /** 2937 /**
2924 * An external exception handler. 2938 * An external exception handler.
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
3553 V8::MakeWeak(reinterpret_cast<internal::Object**>(**this), 3567 V8::MakeWeak(reinterpret_cast<internal::Object**>(**this),
3554 parameters, 3568 parameters,
3555 callback); 3569 callback);
3556 } 3570 }
3557 3571
3558 template <class T> 3572 template <class T>
3559 void Persistent<T>::ClearWeak() { 3573 void Persistent<T>::ClearWeak() {
3560 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); 3574 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this));
3561 } 3575 }
3562 3576
3577 template <class T>
3578 void Persistent<T>::SetWrapperClassId(uint16_t class_id) {
3579 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id);
3580 }
3563 3581
3564 Arguments::Arguments(internal::Object** implicit_args, 3582 Arguments::Arguments(internal::Object** implicit_args,
3565 internal::Object** values, int length, 3583 internal::Object** values, int length,
3566 bool is_construct_call) 3584 bool is_construct_call)
3567 : implicit_args_(implicit_args), 3585 : implicit_args_(implicit_args),
3568 values_(values), 3586 values_(values),
3569 length_(length), 3587 length_(length),
3570 is_construct_call_(is_construct_call) { } 3588 is_construct_call_(is_construct_call) { }
3571 3589
3572 3590
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
3837 3855
3838 3856
3839 } // namespace v8 3857 } // namespace v8
3840 3858
3841 3859
3842 #undef V8EXPORT 3860 #undef V8EXPORT
3843 #undef TYPE_CHECK 3861 #undef TYPE_CHECK
3844 3862
3845 3863
3846 #endif // V8_H_ 3864 #endif // V8_H_
OLDNEW
« no previous file with comments | « SConstruct ('k') | include/v8-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698