OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 | 2851 |
2852 | 2852 |
2853 /** | 2853 /** |
2854 * EntropySource is used as a callback function when v8 needs a source | 2854 * EntropySource is used as a callback function when v8 needs a source |
2855 * of entropy. | 2855 * of entropy. |
2856 */ | 2856 */ |
2857 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); | 2857 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); |
2858 | 2858 |
2859 | 2859 |
2860 /** | 2860 /** |
| 2861 * ReturnAddressLocationResolver is used as a callback function when v8 is |
| 2862 * resolving the location of a return address on the stack. Profilers that |
| 2863 * change the return address on the stack can use this to resolve the stack |
| 2864 * location to whereever the profiler stashed the original return address. |
| 2865 * When invoked, return_addr_location will point to a location on stack where |
| 2866 * a machine return address resides, this function should return either the |
| 2867 * same pointer, or a pointer to the profiler's copy of the original return |
| 2868 * address. |
| 2869 */ |
| 2870 typedef uintptr_t (*ReturnAddressLocationResolver)( |
| 2871 uintptr_t return_addr_location); |
| 2872 |
| 2873 |
| 2874 /** |
2861 * Interface for iterating though all external resources in the heap. | 2875 * Interface for iterating though all external resources in the heap. |
2862 */ | 2876 */ |
2863 class V8EXPORT ExternalResourceVisitor { // NOLINT | 2877 class V8EXPORT ExternalResourceVisitor { // NOLINT |
2864 public: | 2878 public: |
2865 virtual ~ExternalResourceVisitor() {} | 2879 virtual ~ExternalResourceVisitor() {} |
2866 virtual void VisitExternalString(Handle<String> string) {} | 2880 virtual void VisitExternalString(Handle<String> string) {} |
2867 }; | 2881 }; |
2868 | 2882 |
2869 | 2883 |
2870 /** | 2884 /** |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 */ | 3118 */ |
3105 static bool Initialize(); | 3119 static bool Initialize(); |
3106 | 3120 |
3107 /** | 3121 /** |
3108 * Allows the host application to provide a callback which can be used | 3122 * Allows the host application to provide a callback which can be used |
3109 * as a source of entropy for random number generators. | 3123 * as a source of entropy for random number generators. |
3110 */ | 3124 */ |
3111 static void SetEntropySource(EntropySource source); | 3125 static void SetEntropySource(EntropySource source); |
3112 | 3126 |
3113 /** | 3127 /** |
| 3128 * Allows the host application to provide a callback that allows v8 to |
| 3129 * cooperate with a profiler that rewrites return addresses on stack. |
| 3130 */ |
| 3131 static void SetReturnAddressLocationResolver( |
| 3132 ReturnAddressLocationResolver return_address_resolver); |
| 3133 |
| 3134 /** |
3114 * Adjusts the amount of registered external memory. Used to give | 3135 * Adjusts the amount of registered external memory. Used to give |
3115 * V8 an indication of the amount of externally allocated memory | 3136 * V8 an indication of the amount of externally allocated memory |
3116 * that is kept alive by JavaScript objects. V8 uses this to decide | 3137 * that is kept alive by JavaScript objects. V8 uses this to decide |
3117 * when to perform global garbage collections. Registering | 3138 * when to perform global garbage collections. Registering |
3118 * externally allocated memory will trigger global garbage | 3139 * externally allocated memory will trigger global garbage |
3119 * collections more often than otherwise in an attempt to garbage | 3140 * collections more often than otherwise in an attempt to garbage |
3120 * collect the JavaScript objects keeping the externally allocated | 3141 * collect the JavaScript objects keeping the externally allocated |
3121 * memory alive. | 3142 * memory alive. |
3122 * | 3143 * |
3123 * \param change_in_bytes the change in externally allocated memory | 3144 * \param change_in_bytes the change in externally allocated memory |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4282 | 4303 |
4283 | 4304 |
4284 } // namespace v8 | 4305 } // namespace v8 |
4285 | 4306 |
4286 | 4307 |
4287 #undef V8EXPORT | 4308 #undef V8EXPORT |
4288 #undef TYPE_CHECK | 4309 #undef TYPE_CHECK |
4289 | 4310 |
4290 | 4311 |
4291 #endif // V8_H_ | 4312 #endif // V8_H_ |
OLD | NEW |