| 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 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 class EXPORT Exception { | 1804 class EXPORT Exception { |
| 1805 public: | 1805 public: |
| 1806 static Local<Value> RangeError(Handle<String> message); | 1806 static Local<Value> RangeError(Handle<String> message); |
| 1807 static Local<Value> ReferenceError(Handle<String> message); | 1807 static Local<Value> ReferenceError(Handle<String> message); |
| 1808 static Local<Value> SyntaxError(Handle<String> message); | 1808 static Local<Value> SyntaxError(Handle<String> message); |
| 1809 static Local<Value> TypeError(Handle<String> message); | 1809 static Local<Value> TypeError(Handle<String> message); |
| 1810 static Local<Value> Error(Handle<String> message); | 1810 static Local<Value> Error(Handle<String> message); |
| 1811 }; | 1811 }; |
| 1812 | 1812 |
| 1813 | 1813 |
| 1814 // --- C o u n t e r s C a l l b a c k s | 1814 // --- C o u n t e r s C a l l b a c k s --- |
| 1815 | 1815 |
| 1816 typedef int* (*CounterLookupCallback)(const wchar_t* name); | 1816 typedef int* (*CounterLookupCallback)(const wchar_t* name); |
| 1817 | 1817 |
| 1818 // --- 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 --- | 1818 // --- 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 --- |
| 1819 typedef void (*FailedAccessCheckCallback)(Local<Object> target, | 1819 typedef void (*FailedAccessCheckCallback)(Local<Object> target, |
| 1820 AccessType type, | 1820 AccessType type, |
| 1821 Local<Value> data); | 1821 Local<Value> data); |
| 1822 | 1822 |
| 1823 // --- 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 | 1823 // --- 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 |
| 1824 | 1824 |
| 1825 /** | 1825 /** |
| 1826 * Applications can register a callback function which is called | 1826 * Applications can register a callback function which is called |
| 1827 * before and after a major garbage collection. Allocations are not | 1827 * before and after a major garbage collection. Allocations are not |
| 1828 * allowed in the callback function, you therefore cannot manipulate | 1828 * allowed in the callback function, you therefore cannot manipulate |
| 1829 * objects (set or delete properties for example) since it is possible | 1829 * objects (set or delete properties for example) since it is possible |
| 1830 * such operations will result in the allocation of objects. | 1830 * such operations will result in the allocation of objects. |
| 1831 */ | 1831 */ |
| 1832 typedef void (*GCCallback)(); | 1832 typedef void (*GCCallback)(); |
| 1833 | 1833 |
| 1834 | 1834 |
| 1835 // --- C o n t e x t G e n e r a t o r | 1835 // --- E x t e r n a l S y m b o l C a l l b a c k --- |
| 1836 |
| 1837 /** |
| 1838 * Callback used to allocate certain V8 symbols as external strings. |
| 1839 * |
| 1840 * Allocations are not allowed in the callback function, you therefore |
| 1841 * cannot manipulate objects (set or delete properties for example) |
| 1842 * since it is possible such operations will result in the allocation |
| 1843 * of objects. |
| 1844 */ |
| 1845 typedef String::ExternalStringResource* (*ExternalSymbolCallback)( |
| 1846 const char* chars, |
| 1847 size_t length); |
| 1848 |
| 1849 |
| 1850 // --- C o n t e x t G e n e r a t o r --- |
| 1836 | 1851 |
| 1837 /** | 1852 /** |
| 1838 * Applications must provide a callback function which is called to generate | 1853 * Applications must provide a callback function which is called to generate |
| 1839 * a context if a context was not deserialized from the snapshot. | 1854 * a context if a context was not deserialized from the snapshot. |
| 1840 */ | 1855 */ |
| 1841 typedef Persistent<Context> (*ContextGenerator)(); | 1856 typedef Persistent<Context> (*ContextGenerator)(); |
| 1842 | 1857 |
| 1843 | 1858 |
| 1844 /** | 1859 /** |
| 1845 * Container class for static utility functions. | 1860 * Container class for static utility functions. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 /** | 1940 /** |
| 1926 * Enables the host application to receive a notification after a | 1941 * Enables the host application to receive a notification after a |
| 1927 * major garbage collection. Allocations are not allowed in the | 1942 * major garbage collection. Allocations are not allowed in the |
| 1928 * callback function, you therefore cannot manipulate objects (set | 1943 * callback function, you therefore cannot manipulate objects (set |
| 1929 * or delete properties for example) since it is possible such | 1944 * or delete properties for example) since it is possible such |
| 1930 * operations will result in the allocation of objects. | 1945 * operations will result in the allocation of objects. |
| 1931 */ | 1946 */ |
| 1932 static void SetGlobalGCEpilogueCallback(GCCallback); | 1947 static void SetGlobalGCEpilogueCallback(GCCallback); |
| 1933 | 1948 |
| 1934 /** | 1949 /** |
| 1950 * Applications can register a callback that will be used when |
| 1951 * allocating most of the V8 symbols. The callback must return an |
| 1952 * external string resource that represents the symbols. |
| 1953 * |
| 1954 * Most often when performing a property lookup the key will be a |
| 1955 * symbol. Allocating symbols as external strings can reduce the |
| 1956 * amount of string conversions needed when using interceptors and |
| 1957 * accessors. |
| 1958 * |
| 1959 * \note This is an experimental feature and it might be removed. |
| 1960 */ |
| 1961 static void SetExternalSymbolCallback(ExternalSymbolCallback); |
| 1962 |
| 1963 /** |
| 1935 * Allows the host application to group objects together. If one | 1964 * Allows the host application to group objects together. If one |
| 1936 * object in the group is alive, all objects in the group are alive. | 1965 * object in the group is alive, all objects in the group are alive. |
| 1937 * After each garbage collection, object groups are removed. It is | 1966 * After each garbage collection, object groups are removed. It is |
| 1938 * intended to be used in the before-garbage-collection callback | 1967 * intended to be used in the before-garbage-collection callback |
| 1939 * function for istance to simulate DOM tree connections among JS | 1968 * function for istance to simulate DOM tree connections among JS |
| 1940 * wrapper objects. | 1969 * wrapper objects. |
| 1941 */ | 1970 */ |
| 1942 static void AddObjectToGroup(void* id, Persistent<Object> obj); | 1971 static void AddObjectToGroup(void* id, Persistent<Object> obj); |
| 1943 | 1972 |
| 1944 /** | 1973 /** |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 | 2461 |
| 2433 } // namespace v8 | 2462 } // namespace v8 |
| 2434 | 2463 |
| 2435 | 2464 |
| 2436 #undef EXPORT | 2465 #undef EXPORT |
| 2437 #undef EXPORT_INLINE | 2466 #undef EXPORT_INLINE |
| 2438 #undef TYPE_CHECK | 2467 #undef TYPE_CHECK |
| 2439 | 2468 |
| 2440 | 2469 |
| 2441 #endif // V8_H_ | 2470 #endif // V8_H_ |
| OLD | NEW |