OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 832 |
833 /** | 833 /** |
834 * Creates a new external string using the data defined in the given | 834 * Creates a new external string using the data defined in the given |
835 * resource. The resource is deleted when the external string is no | 835 * resource. The resource is deleted when the external string is no |
836 * longer live on V8's heap. The caller of this function should not | 836 * longer live on V8's heap. The caller of this function should not |
837 * delete or modify the resource. Neither should the underlying buffer be | 837 * delete or modify the resource. Neither should the underlying buffer be |
838 * deallocated or modified except through the destructor of the | 838 * deallocated or modified except through the destructor of the |
839 * external string resource. | 839 * external string resource. |
840 */ | 840 */ |
841 static Local<String> NewExternal(ExternalStringResource* resource); | 841 static Local<String> NewExternal(ExternalStringResource* resource); |
842 | 842 |
843 /** | 843 /** |
844 * Associate an external string resource with this string by transforming it | 844 * Associate an external string resource with this string by transforming it |
845 * in place so that existing references to this string in the JavaScript heap | 845 * in place so that existing references to this string in the JavaScript heap |
846 * will use the external string resource. The external string resource's | 846 * will use the external string resource. The external string resource's |
847 * character contents needs to be equivalent to this string. | 847 * character contents needs to be equivalent to this string. |
848 * Returns true if the string has been changed to be an external string. | 848 * Returns true if the string has been changed to be an external string. |
849 * The string is not modified if the operation fails. | 849 * The string is not modified if the operation fails. |
850 */ | 850 */ |
851 bool MakeExternal(ExternalStringResource* resource); | 851 bool MakeExternal(ExternalStringResource* resource); |
852 | 852 |
853 /** | 853 /** |
854 * Creates a new external string using the ascii data defined in the given | 854 * Creates a new external string using the ascii data defined in the given |
855 * resource. The resource is deleted when the external string is no | 855 * resource. The resource is deleted when the external string is no |
856 * longer live on V8's heap. The caller of this function should not | 856 * longer live on V8's heap. The caller of this function should not |
857 * delete or modify the resource. Neither should the underlying buffer be | 857 * delete or modify the resource. Neither should the underlying buffer be |
858 * deallocated or modified except through the destructor of the | 858 * deallocated or modified except through the destructor of the |
859 * external string resource. | 859 * external string resource. |
860 */ | 860 */ |
861 static Local<String> NewExternal(ExternalAsciiStringResource* resource); | 861 static Local<String> NewExternal(ExternalAsciiStringResource* resource); |
862 | 862 |
863 /** | 863 /** |
864 * Associate an external string resource with this string by transforming it | 864 * Associate an external string resource with this string by transforming it |
865 * in place so that existing references to this string in the JavaScript heap | 865 * in place so that existing references to this string in the JavaScript heap |
866 * will use the external string resource. The external string resource's | 866 * will use the external string resource. The external string resource's |
867 * character contents needs to be equivalent to this string. | 867 * character contents needs to be equivalent to this string. |
868 * Returns true if the string has been changed to be an external string. | 868 * Returns true if the string has been changed to be an external string. |
869 * The string is not modified if the operation fails. | 869 * The string is not modified if the operation fails. |
870 */ | 870 */ |
871 bool MakeExternal(ExternalAsciiStringResource* resource); | 871 bool MakeExternal(ExternalAsciiStringResource* resource); |
872 | 872 |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 static Local<Value> SyntaxError(Handle<String> message); | 1809 static Local<Value> SyntaxError(Handle<String> message); |
1810 static Local<Value> TypeError(Handle<String> message); | 1810 static Local<Value> TypeError(Handle<String> message); |
1811 static Local<Value> Error(Handle<String> message); | 1811 static Local<Value> Error(Handle<String> message); |
1812 }; | 1812 }; |
1813 | 1813 |
1814 | 1814 |
1815 // --- C o u n t e r s C a l l b a c k s --- | 1815 // --- C o u n t e r s C a l l b a c k s --- |
1816 | 1816 |
1817 typedef int* (*CounterLookupCallback)(const char* name); | 1817 typedef int* (*CounterLookupCallback)(const char* name); |
1818 | 1818 |
| 1819 typedef void* (*CreateHistogramCallback)(const char* name, |
| 1820 int min, |
| 1821 int max, |
| 1822 size_t buckets); |
| 1823 |
| 1824 typedef void (*AddHistogramSampleCallback)(void* histogram, int sample); |
| 1825 |
1819 // --- F a i l e d A c c e s s C h e c k C a l l b a c k --- | 1826 // --- F a i l e d A c c e s s C h e c k C a l l b a c k --- |
1820 typedef void (*FailedAccessCheckCallback)(Local<Object> target, | 1827 typedef void (*FailedAccessCheckCallback)(Local<Object> target, |
1821 AccessType type, | 1828 AccessType type, |
1822 Local<Value> data); | 1829 Local<Value> data); |
1823 | 1830 |
1824 // --- G a r b a g e C o l l e c t i o n C a l l b a c k s | 1831 // --- G a r b a g e C o l l e c t i o n C a l l b a c k s |
1825 | 1832 |
1826 /** | 1833 /** |
1827 * Applications can register a callback function which is called | 1834 * Applications can register a callback function which is called |
1828 * before and after a major garbage collection. Allocations are not | 1835 * before and after a major garbage collection. Allocations are not |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 /** Get the version string. */ | 1906 /** Get the version string. */ |
1900 static const char* GetVersion(); | 1907 static const char* GetVersion(); |
1901 | 1908 |
1902 /** | 1909 /** |
1903 * Enables the host application to provide a mechanism for recording | 1910 * Enables the host application to provide a mechanism for recording |
1904 * statistics counters. | 1911 * statistics counters. |
1905 */ | 1912 */ |
1906 static void SetCounterFunction(CounterLookupCallback); | 1913 static void SetCounterFunction(CounterLookupCallback); |
1907 | 1914 |
1908 /** | 1915 /** |
| 1916 * Enables the host application to provide a mechanism for recording |
| 1917 * histograms. The CreateHistogram function returns a |
| 1918 * histogram which will later be passed to the AddHistogramSample |
| 1919 * function. |
| 1920 */ |
| 1921 static void SetCreateHistogramFunction(CreateHistogramCallback); |
| 1922 static void SetAddHistogramSampleFunction(AddHistogramSampleCallback); |
| 1923 |
| 1924 /** |
1909 * Enables the computation of a sliding window of states. The sliding | 1925 * Enables the computation of a sliding window of states. The sliding |
1910 * window information is recorded in statistics counters. | 1926 * window information is recorded in statistics counters. |
1911 */ | 1927 */ |
1912 static void EnableSlidingStateWindow(); | 1928 static void EnableSlidingStateWindow(); |
1913 | 1929 |
1914 /** Callback function for reporting failed access checks.*/ | 1930 /** Callback function for reporting failed access checks.*/ |
1915 static void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback); | 1931 static void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback); |
1916 | 1932 |
1917 /** | 1933 /** |
1918 * Enables the host application to receive a notification before a | 1934 * Enables the host application to receive a notification before a |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2457 | 2473 |
2458 } // namespace v8 | 2474 } // namespace v8 |
2459 | 2475 |
2460 | 2476 |
2461 #undef EXPORT | 2477 #undef EXPORT |
2462 #undef EXPORT_INLINE | 2478 #undef EXPORT_INLINE |
2463 #undef TYPE_CHECK | 2479 #undef TYPE_CHECK |
2464 | 2480 |
2465 | 2481 |
2466 #endif // V8_H_ | 2482 #endif // V8_H_ |
OLD | NEW |