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 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 public: | 1725 public: |
1726 V8EXPORT Local<Object> NewInstance() const; | 1726 V8EXPORT Local<Object> NewInstance() const; |
1727 V8EXPORT Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; | 1727 V8EXPORT Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; |
1728 V8EXPORT Local<Value> Call(Handle<Object> recv, | 1728 V8EXPORT Local<Value> Call(Handle<Object> recv, |
1729 int argc, | 1729 int argc, |
1730 Handle<Value> argv[]); | 1730 Handle<Value> argv[]); |
1731 V8EXPORT void SetName(Handle<String> name); | 1731 V8EXPORT void SetName(Handle<String> name); |
1732 V8EXPORT Handle<Value> GetName() const; | 1732 V8EXPORT Handle<Value> GetName() const; |
1733 | 1733 |
1734 /** | 1734 /** |
| 1735 * Name inferred from variable or property assignment of this function. |
| 1736 * Used to facilitate debugging and profiling of JavaScript code written |
| 1737 * in an OO style, where many functions are anonymous but are assigned |
| 1738 * to object properties. |
| 1739 */ |
| 1740 V8EXPORT Handle<Value> GetInferredName() const; |
| 1741 |
| 1742 /** |
1735 * Returns zero based line number of function body and | 1743 * Returns zero based line number of function body and |
1736 * kLineOffsetNotFound if no information available. | 1744 * kLineOffsetNotFound if no information available. |
1737 */ | 1745 */ |
1738 V8EXPORT int GetScriptLineNumber() const; | 1746 V8EXPORT int GetScriptLineNumber() const; |
1739 /** | 1747 /** |
1740 * Returns zero based column number of function body and | 1748 * Returns zero based column number of function body and |
1741 * kLineOffsetNotFound if no information available. | 1749 * kLineOffsetNotFound if no information available. |
1742 */ | 1750 */ |
1743 V8EXPORT int GetScriptColumnNumber() const; | 1751 V8EXPORT int GetScriptColumnNumber() const; |
1744 V8EXPORT Handle<Value> GetScriptId() const; | 1752 V8EXPORT Handle<Value> GetScriptId() const; |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2838 char** raw_data; | 2846 char** raw_data; |
2839 }; | 2847 }; |
2840 | 2848 |
2841 | 2849 |
2842 /** | 2850 /** |
2843 * EntropySource is used as a callback function when v8 needs a source | 2851 * EntropySource is used as a callback function when v8 needs a source |
2844 * of entropy. | 2852 * of entropy. |
2845 */ | 2853 */ |
2846 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); | 2854 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); |
2847 | 2855 |
| 2856 |
| 2857 /** |
| 2858 * Interface for iterating though all external resources in the heap. |
| 2859 */ |
| 2860 class V8EXPORT ExternalResourceVisitor { // NOLINT |
| 2861 public: |
| 2862 virtual ~ExternalResourceVisitor() {} |
| 2863 virtual void VisitExternalString(Handle<String> string) {} |
| 2864 }; |
| 2865 |
| 2866 |
2848 /** | 2867 /** |
2849 * Container class for static utility functions. | 2868 * Container class for static utility functions. |
2850 */ | 2869 */ |
2851 class V8EXPORT V8 { | 2870 class V8EXPORT V8 { |
2852 public: | 2871 public: |
2853 /** Set the callback to invoke in case of fatal errors. */ | 2872 /** Set the callback to invoke in case of fatal errors. */ |
2854 static void SetFatalErrorHandler(FatalErrorCallback that); | 2873 static void SetFatalErrorHandler(FatalErrorCallback that); |
2855 | 2874 |
2856 /** | 2875 /** |
2857 * Set the callback to invoke to check if code generation from | 2876 * Set the callback to invoke to check if code generation from |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3181 * to use if the process needs the resources taken up by v8. | 3200 * to use if the process needs the resources taken up by v8. |
3182 */ | 3201 */ |
3183 static bool Dispose(); | 3202 static bool Dispose(); |
3184 | 3203 |
3185 /** | 3204 /** |
3186 * Get statistics about the heap memory usage. | 3205 * Get statistics about the heap memory usage. |
3187 */ | 3206 */ |
3188 static void GetHeapStatistics(HeapStatistics* heap_statistics); | 3207 static void GetHeapStatistics(HeapStatistics* heap_statistics); |
3189 | 3208 |
3190 /** | 3209 /** |
| 3210 * Iterates through all external resources referenced from current isolate |
| 3211 * heap. This method is not expected to be used except for debugging purposes |
| 3212 * and may be quite slow. |
| 3213 */ |
| 3214 static void VisitExternalResources(ExternalResourceVisitor* visitor); |
| 3215 |
| 3216 /** |
3191 * Optional notification that the embedder is idle. | 3217 * Optional notification that the embedder is idle. |
3192 * V8 uses the notification to reduce memory footprint. | 3218 * V8 uses the notification to reduce memory footprint. |
3193 * This call can be used repeatedly if the embedder remains idle. | 3219 * This call can be used repeatedly if the embedder remains idle. |
3194 * Returns true if the embedder should stop calling IdleNotification | 3220 * Returns true if the embedder should stop calling IdleNotification |
3195 * until real work has been done. This indicates that V8 has done | 3221 * until real work has been done. This indicates that V8 has done |
3196 * as much cleanup as it will be able to do. | 3222 * as much cleanup as it will be able to do. |
3197 */ | 3223 */ |
3198 static bool IdleNotification(); | 3224 static bool IdleNotification(); |
3199 | 3225 |
3200 /** | 3226 /** |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4228 | 4254 |
4229 | 4255 |
4230 } // namespace v8 | 4256 } // namespace v8 |
4231 | 4257 |
4232 | 4258 |
4233 #undef V8EXPORT | 4259 #undef V8EXPORT |
4234 #undef TYPE_CHECK | 4260 #undef TYPE_CHECK |
4235 | 4261 |
4236 | 4262 |
4237 #endif // V8_H_ | 4263 #endif // V8_H_ |
OLD | NEW |