OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 */ | 1130 */ |
1131 int GetEndColumn() const; | 1131 int GetEndColumn() const; |
1132 | 1132 |
1133 /** | 1133 /** |
1134 * Passes on the value set by the embedder when it fed the script from which | 1134 * Passes on the value set by the embedder when it fed the script from which |
1135 * this Message was generated to V8. | 1135 * this Message was generated to V8. |
1136 */ | 1136 */ |
1137 bool IsSharedCrossOrigin() const; | 1137 bool IsSharedCrossOrigin() const; |
1138 | 1138 |
1139 // TODO(1245381): Print to a string instead of on a FILE. | 1139 // TODO(1245381): Print to a string instead of on a FILE. |
| 1140 static void PrintCurrentStackTrace(Isolate* isolate, FILE* out); |
| 1141 // Will be deprecated soon. |
1140 static void PrintCurrentStackTrace(FILE* out); | 1142 static void PrintCurrentStackTrace(FILE* out); |
1141 | 1143 |
1142 static const int kNoLineNumberInfo = 0; | 1144 static const int kNoLineNumberInfo = 0; |
1143 static const int kNoColumnInfo = 0; | 1145 static const int kNoColumnInfo = 0; |
1144 static const int kNoScriptIdInfo = 0; | 1146 static const int kNoScriptIdInfo = 0; |
1145 }; | 1147 }; |
1146 | 1148 |
1147 | 1149 |
1148 /** | 1150 /** |
1149 * Representation of a JavaScript stack trace. The information collected is a | 1151 * Representation of a JavaScript stack trace. The information collected is a |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 Local<Array> AsArray(); | 1187 Local<Array> AsArray(); |
1186 | 1188 |
1187 /** | 1189 /** |
1188 * Grab a snapshot of the current JavaScript execution stack. | 1190 * Grab a snapshot of the current JavaScript execution stack. |
1189 * | 1191 * |
1190 * \param frame_limit The maximum number of stack frames we want to capture. | 1192 * \param frame_limit The maximum number of stack frames we want to capture. |
1191 * \param options Enumerates the set of things we will capture for each | 1193 * \param options Enumerates the set of things we will capture for each |
1192 * StackFrame. | 1194 * StackFrame. |
1193 */ | 1195 */ |
1194 static Local<StackTrace> CurrentStackTrace( | 1196 static Local<StackTrace> CurrentStackTrace( |
| 1197 Isolate* isolate, |
| 1198 int frame_limit, |
| 1199 StackTraceOptions options = kOverview); |
| 1200 // Will be deprecated soon. |
| 1201 static Local<StackTrace> CurrentStackTrace( |
1195 int frame_limit, | 1202 int frame_limit, |
1196 StackTraceOptions options = kOverview); | 1203 StackTraceOptions options = kOverview); |
1197 }; | 1204 }; |
1198 | 1205 |
1199 | 1206 |
1200 /** | 1207 /** |
1201 * A single JavaScript stack frame. | 1208 * A single JavaScript stack frame. |
1202 */ | 1209 */ |
1203 class V8_EXPORT StackFrame { | 1210 class V8_EXPORT StackFrame { |
1204 public: | 1211 public: |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 static Local<String> Concat(Handle<String> left, Handle<String> right); | 1794 static Local<String> Concat(Handle<String> left, Handle<String> right); |
1788 | 1795 |
1789 /** | 1796 /** |
1790 * Creates a new external string using the data defined in the given | 1797 * Creates a new external string using the data defined in the given |
1791 * resource. When the external string is no longer live on V8's heap the | 1798 * resource. When the external string is no longer live on V8's heap the |
1792 * resource will be disposed by calling its Dispose method. The caller of | 1799 * resource will be disposed by calling its Dispose method. The caller of |
1793 * this function should not otherwise delete or modify the resource. Neither | 1800 * this function should not otherwise delete or modify the resource. Neither |
1794 * should the underlying buffer be deallocated or modified except through the | 1801 * should the underlying buffer be deallocated or modified except through the |
1795 * destructor of the external string resource. | 1802 * destructor of the external string resource. |
1796 */ | 1803 */ |
| 1804 static Local<String> NewExternal(Isolate* isolate, |
| 1805 ExternalStringResource* resource); |
| 1806 // Will be deprecated soon. |
1797 static Local<String> NewExternal(ExternalStringResource* resource); | 1807 static Local<String> NewExternal(ExternalStringResource* resource); |
1798 | 1808 |
1799 /** | 1809 /** |
1800 * Associate an external string resource with this string by transforming it | 1810 * Associate an external string resource with this string by transforming it |
1801 * in place so that existing references to this string in the JavaScript heap | 1811 * in place so that existing references to this string in the JavaScript heap |
1802 * will use the external string resource. The external string resource's | 1812 * will use the external string resource. The external string resource's |
1803 * character contents need to be equivalent to this string. | 1813 * character contents need to be equivalent to this string. |
1804 * Returns true if the string has been changed to be an external string. | 1814 * Returns true if the string has been changed to be an external string. |
1805 * The string is not modified if the operation fails. See NewExternal for | 1815 * The string is not modified if the operation fails. See NewExternal for |
1806 * information on the lifetime of the resource. | 1816 * information on the lifetime of the resource. |
1807 */ | 1817 */ |
1808 bool MakeExternal(ExternalStringResource* resource); | 1818 bool MakeExternal(ExternalStringResource* resource); |
1809 | 1819 |
1810 /** | 1820 /** |
1811 * Creates a new external string using the ASCII data defined in the given | 1821 * Creates a new external string using the ASCII data defined in the given |
1812 * resource. When the external string is no longer live on V8's heap the | 1822 * resource. When the external string is no longer live on V8's heap the |
1813 * resource will be disposed by calling its Dispose method. The caller of | 1823 * resource will be disposed by calling its Dispose method. The caller of |
1814 * this function should not otherwise delete or modify the resource. Neither | 1824 * this function should not otherwise delete or modify the resource. Neither |
1815 * should the underlying buffer be deallocated or modified except through the | 1825 * should the underlying buffer be deallocated or modified except through the |
1816 * destructor of the external string resource. | 1826 * destructor of the external string resource. |
1817 */ | 1827 */ |
| 1828 static Local<String> NewExternal(Isolate* isolate, |
| 1829 ExternalAsciiStringResource* resource); |
| 1830 // Will be deprecated soon. |
1818 static Local<String> NewExternal(ExternalAsciiStringResource* resource); | 1831 static Local<String> NewExternal(ExternalAsciiStringResource* resource); |
1819 | 1832 |
1820 /** | 1833 /** |
1821 * Associate an external string resource with this string by transforming it | 1834 * Associate an external string resource with this string by transforming it |
1822 * in place so that existing references to this string in the JavaScript heap | 1835 * in place so that existing references to this string in the JavaScript heap |
1823 * will use the external string resource. The external string resource's | 1836 * will use the external string resource. The external string resource's |
1824 * character contents need to be equivalent to this string. | 1837 * character contents need to be equivalent to this string. |
1825 * Returns true if the string has been changed to be an external string. | 1838 * Returns true if the string has been changed to be an external string. |
1826 * The string is not modified if the operation fails. See NewExternal for | 1839 * The string is not modified if the operation fails. See NewExternal for |
1827 * information on the lifetime of the resource. | 1840 * information on the lifetime of the resource. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 Private(); | 1974 Private(); |
1962 }; | 1975 }; |
1963 | 1976 |
1964 | 1977 |
1965 /** | 1978 /** |
1966 * A JavaScript number value (ECMA-262, 4.3.20) | 1979 * A JavaScript number value (ECMA-262, 4.3.20) |
1967 */ | 1980 */ |
1968 class V8_EXPORT Number : public Primitive { | 1981 class V8_EXPORT Number : public Primitive { |
1969 public: | 1982 public: |
1970 double Value() const; | 1983 double Value() const; |
| 1984 static Local<Number> New(Isolate* isolate, double value); |
| 1985 // Will be deprecated soon. |
1971 static Local<Number> New(double value); | 1986 static Local<Number> New(double value); |
1972 static Local<Number> New(Isolate* isolate, double value); | |
1973 V8_INLINE static Number* Cast(v8::Value* obj); | 1987 V8_INLINE static Number* Cast(v8::Value* obj); |
1974 private: | 1988 private: |
1975 Number(); | 1989 Number(); |
1976 static void CheckCast(v8::Value* obj); | 1990 static void CheckCast(v8::Value* obj); |
1977 }; | 1991 }; |
1978 | 1992 |
1979 | 1993 |
1980 /** | 1994 /** |
1981 * A JavaScript value representing a signed integer. | 1995 * A JavaScript value representing a signed integer. |
1982 */ | 1996 */ |
1983 class V8_EXPORT Integer : public Number { | 1997 class V8_EXPORT Integer : public Number { |
1984 public: | 1998 public: |
| 1999 static Local<Integer> New(Isolate* isolate, int32_t value); |
| 2000 static Local<Integer> NewFromUnsigned(Isolate* isolate, uint32_t value); |
| 2001 // Will be deprecated soon. |
| 2002 static Local<Integer> New(int32_t value, Isolate*); |
| 2003 static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*); |
1985 static Local<Integer> New(int32_t value); | 2004 static Local<Integer> New(int32_t value); |
1986 static Local<Integer> NewFromUnsigned(uint32_t value); | 2005 static Local<Integer> NewFromUnsigned(uint32_t value); |
1987 static Local<Integer> New(int32_t value, Isolate*); | |
1988 static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*); | |
1989 int64_t Value() const; | 2006 int64_t Value() const; |
1990 V8_INLINE static Integer* Cast(v8::Value* obj); | 2007 V8_INLINE static Integer* Cast(v8::Value* obj); |
1991 private: | 2008 private: |
1992 Integer(); | 2009 Integer(); |
1993 static void CheckCast(v8::Value* obj); | 2010 static void CheckCast(v8::Value* obj); |
1994 }; | 2011 }; |
1995 | 2012 |
1996 | 2013 |
1997 /** | 2014 /** |
1998 * A JavaScript value representing a 32-bit signed integer. | 2015 * A JavaScript value representing a 32-bit signed integer. |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 int argc, | 2348 int argc, |
2332 Handle<Value> argv[]); | 2349 Handle<Value> argv[]); |
2333 | 2350 |
2334 /** | 2351 /** |
2335 * Call an Object as a constructor if a callback is set by the | 2352 * Call an Object as a constructor if a callback is set by the |
2336 * ObjectTemplate::SetCallAsFunctionHandler method. | 2353 * ObjectTemplate::SetCallAsFunctionHandler method. |
2337 * Note: This method behaves like the Function::NewInstance method. | 2354 * Note: This method behaves like the Function::NewInstance method. |
2338 */ | 2355 */ |
2339 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); | 2356 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); |
2340 | 2357 |
| 2358 static Local<Object> New(Isolate* isolate); |
| 2359 // Will be deprecated soon. |
2341 static Local<Object> New(); | 2360 static Local<Object> New(); |
2342 V8_INLINE static Object* Cast(Value* obj); | 2361 V8_INLINE static Object* Cast(Value* obj); |
2343 | 2362 |
2344 private: | 2363 private: |
2345 Object(); | 2364 Object(); |
2346 static void CheckCast(Value* obj); | 2365 static void CheckCast(Value* obj); |
2347 Local<Value> SlowGetInternalField(int index); | 2366 Local<Value> SlowGetInternalField(int index); |
2348 void* SlowGetAlignedPointerFromInternalField(int index); | 2367 void* SlowGetAlignedPointerFromInternalField(int index); |
2349 }; | 2368 }; |
2350 | 2369 |
2351 | 2370 |
2352 /** | 2371 /** |
2353 * An instance of the built-in array constructor (ECMA-262, 15.4.2). | 2372 * An instance of the built-in array constructor (ECMA-262, 15.4.2). |
2354 */ | 2373 */ |
2355 class V8_EXPORT Array : public Object { | 2374 class V8_EXPORT Array : public Object { |
2356 public: | 2375 public: |
2357 uint32_t Length() const; | 2376 uint32_t Length() const; |
2358 | 2377 |
2359 /** | 2378 /** |
2360 * Clones an element at index |index|. Returns an empty | 2379 * Clones an element at index |index|. Returns an empty |
2361 * handle if cloning fails (for any reason). | 2380 * handle if cloning fails (for any reason). |
2362 */ | 2381 */ |
2363 Local<Object> CloneElementAt(uint32_t index); | 2382 Local<Object> CloneElementAt(uint32_t index); |
2364 | 2383 |
2365 /** | 2384 /** |
2366 * Creates a JavaScript array with the given length. If the length | 2385 * Creates a JavaScript array with the given length. If the length |
2367 * is negative the returned array will have length 0. | 2386 * is negative the returned array will have length 0. |
2368 */ | 2387 */ |
| 2388 static Local<Array> New(Isolate* isolate, int length = 0); |
| 2389 // Will be deprecated soon. |
2369 static Local<Array> New(int length = 0); | 2390 static Local<Array> New(int length = 0); |
2370 | 2391 |
2371 V8_INLINE static Array* Cast(Value* obj); | 2392 V8_INLINE static Array* Cast(Value* obj); |
2372 private: | 2393 private: |
2373 Array(); | 2394 Array(); |
2374 static void CheckCast(Value* obj); | 2395 static void CheckCast(Value* obj); |
2375 }; | 2396 }; |
2376 | 2397 |
2377 | 2398 |
2378 template<typename T> | 2399 template<typename T> |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 * Data length in bytes. | 2643 * Data length in bytes. |
2623 */ | 2644 */ |
2624 size_t ByteLength() const; | 2645 size_t ByteLength() const; |
2625 | 2646 |
2626 /** | 2647 /** |
2627 * Create a new ArrayBuffer. Allocate |byte_length| bytes. | 2648 * Create a new ArrayBuffer. Allocate |byte_length| bytes. |
2628 * Allocated memory will be owned by a created ArrayBuffer and | 2649 * Allocated memory will be owned by a created ArrayBuffer and |
2629 * will be deallocated when it is garbage-collected, | 2650 * will be deallocated when it is garbage-collected, |
2630 * unless the object is externalized. | 2651 * unless the object is externalized. |
2631 */ | 2652 */ |
| 2653 static Local<ArrayBuffer> New(Isolate* isolate, size_t byte_length); |
| 2654 // Will be deprecated soon. |
2632 static Local<ArrayBuffer> New(size_t byte_length); | 2655 static Local<ArrayBuffer> New(size_t byte_length); |
2633 | 2656 |
2634 /** | 2657 /** |
2635 * Create a new ArrayBuffer over an existing memory block. | 2658 * Create a new ArrayBuffer over an existing memory block. |
2636 * The created array buffer is immediately in externalized state. | 2659 * The created array buffer is immediately in externalized state. |
2637 * The memory block will not be reclaimed when a created ArrayBuffer | 2660 * The memory block will not be reclaimed when a created ArrayBuffer |
2638 * is garbage-collected. | 2661 * is garbage-collected. |
2639 */ | 2662 */ |
| 2663 static Local<ArrayBuffer> New(Isolate* isolate, void* data, |
| 2664 size_t byte_length); |
| 2665 // Will be deprecated soon. |
2640 static Local<ArrayBuffer> New(void* data, size_t byte_length); | 2666 static Local<ArrayBuffer> New(void* data, size_t byte_length); |
2641 | 2667 |
2642 /** | 2668 /** |
2643 * Returns true if ArrayBuffer is extrenalized, that is, does not | 2669 * Returns true if ArrayBuffer is extrenalized, that is, does not |
2644 * own its memory block. | 2670 * own its memory block. |
2645 */ | 2671 */ |
2646 bool IsExternal() const; | 2672 bool IsExternal() const; |
2647 | 2673 |
2648 /** | 2674 /** |
2649 * Neuters this ArrayBuffer and all its views (typed arrays). | 2675 * Neuters this ArrayBuffer and all its views (typed arrays). |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 DataView(); | 2916 DataView(); |
2891 static void CheckCast(Value* obj); | 2917 static void CheckCast(Value* obj); |
2892 }; | 2918 }; |
2893 | 2919 |
2894 | 2920 |
2895 /** | 2921 /** |
2896 * An instance of the built-in Date constructor (ECMA-262, 15.9). | 2922 * An instance of the built-in Date constructor (ECMA-262, 15.9). |
2897 */ | 2923 */ |
2898 class V8_EXPORT Date : public Object { | 2924 class V8_EXPORT Date : public Object { |
2899 public: | 2925 public: |
| 2926 static Local<Value> New(Isolate* isolate, double time); |
| 2927 // Will be deprecated soon. |
2900 static Local<Value> New(double time); | 2928 static Local<Value> New(double time); |
2901 | 2929 |
2902 V8_DEPRECATED( | 2930 V8_DEPRECATED( |
2903 "Use ValueOf instead", | 2931 "Use ValueOf instead", |
2904 double NumberValue() const) { return ValueOf(); } | 2932 double NumberValue() const) { return ValueOf(); } |
2905 | 2933 |
2906 /** | 2934 /** |
2907 * A specialization of Value::NumberValue that is more efficient | 2935 * A specialization of Value::NumberValue that is more efficient |
2908 * because we know the structure of this object. | 2936 * because we know the structure of this object. |
2909 */ | 2937 */ |
2910 double ValueOf() const; | 2938 double ValueOf() const; |
2911 | 2939 |
2912 V8_INLINE static Date* Cast(v8::Value* obj); | 2940 V8_INLINE static Date* Cast(v8::Value* obj); |
2913 | 2941 |
2914 /** | 2942 /** |
2915 * Notification that the embedder has changed the time zone, | 2943 * Notification that the embedder has changed the time zone, |
2916 * daylight savings time, or other date / time configuration | 2944 * daylight savings time, or other date / time configuration |
2917 * parameters. V8 keeps a cache of various values used for | 2945 * parameters. V8 keeps a cache of various values used for |
2918 * date / time computation. This notification will reset | 2946 * date / time computation. This notification will reset |
2919 * those cached values for the current context so that date / | 2947 * those cached values for the current context so that date / |
2920 * time configuration changes would be reflected in the Date | 2948 * time configuration changes would be reflected in the Date |
2921 * object. | 2949 * object. |
2922 * | 2950 * |
2923 * This API should not be called more than needed as it will | 2951 * This API should not be called more than needed as it will |
2924 * negatively impact the performance of date operations. | 2952 * negatively impact the performance of date operations. |
2925 */ | 2953 */ |
| 2954 static void DateTimeConfigurationChangeNotification(Isolate* isolate); |
| 2955 // Will be deprecated soon. |
2926 static void DateTimeConfigurationChangeNotification(); | 2956 static void DateTimeConfigurationChangeNotification(); |
2927 | 2957 |
2928 private: | 2958 private: |
2929 static void CheckCast(v8::Value* obj); | 2959 static void CheckCast(v8::Value* obj); |
2930 }; | 2960 }; |
2931 | 2961 |
2932 | 2962 |
2933 /** | 2963 /** |
2934 * A Number object (ECMA-262, 4.3.21). | 2964 * A Number object (ECMA-262, 4.3.21). |
2935 */ | 2965 */ |
2936 class V8_EXPORT NumberObject : public Object { | 2966 class V8_EXPORT NumberObject : public Object { |
2937 public: | 2967 public: |
| 2968 static Local<Value> New(Isolate* isolate, double value); |
| 2969 // Will be deprecated soon. |
2938 static Local<Value> New(double value); | 2970 static Local<Value> New(double value); |
2939 | 2971 |
2940 V8_DEPRECATED( | 2972 V8_DEPRECATED( |
2941 "Use ValueOf instead", | 2973 "Use ValueOf instead", |
2942 double NumberValue() const) { return ValueOf(); } | 2974 double NumberValue() const) { return ValueOf(); } |
2943 | 2975 |
2944 /** | 2976 /** |
2945 * Returns the Number held by the object. | 2977 * Returns the Number held by the object. |
2946 */ | 2978 */ |
2947 double ValueOf() const; | 2979 double ValueOf() const; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3374 * \code | 3406 * \code |
3375 * child_func.prototype.__proto__ == function.prototype; | 3407 * child_func.prototype.__proto__ == function.prototype; |
3376 * child_instance.instance_accessor calls 'InstanceAccessorCallback' | 3408 * child_instance.instance_accessor calls 'InstanceAccessorCallback' |
3377 * child_instance.instance_property == 3; | 3409 * child_instance.instance_property == 3; |
3378 * \endcode | 3410 * \endcode |
3379 */ | 3411 */ |
3380 class V8_EXPORT FunctionTemplate : public Template { | 3412 class V8_EXPORT FunctionTemplate : public Template { |
3381 public: | 3413 public: |
3382 /** Creates a function template.*/ | 3414 /** Creates a function template.*/ |
3383 static Local<FunctionTemplate> New( | 3415 static Local<FunctionTemplate> New( |
| 3416 Isolate* isolate, |
| 3417 FunctionCallback callback = 0, |
| 3418 Handle<Value> data = Handle<Value>(), |
| 3419 Handle<Signature> signature = Handle<Signature>(), |
| 3420 int length = 0); |
| 3421 // Will be deprecated soon. |
| 3422 static Local<FunctionTemplate> New( |
3384 FunctionCallback callback = 0, | 3423 FunctionCallback callback = 0, |
3385 Handle<Value> data = Handle<Value>(), | 3424 Handle<Value> data = Handle<Value>(), |
3386 Handle<Signature> signature = Handle<Signature>(), | 3425 Handle<Signature> signature = Handle<Signature>(), |
3387 int length = 0); | 3426 int length = 0); |
3388 | 3427 |
3389 /** Returns the unique function instance in the current execution context.*/ | 3428 /** Returns the unique function instance in the current execution context.*/ |
3390 Local<Function> GetFunction(); | 3429 Local<Function> GetFunction(); |
3391 | 3430 |
3392 /** | 3431 /** |
3393 * Set the call-handler callback for a FunctionTemplate. This | 3432 * Set the call-handler callback for a FunctionTemplate. This |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3460 | 3499 |
3461 /** | 3500 /** |
3462 * An ObjectTemplate is used to create objects at runtime. | 3501 * An ObjectTemplate is used to create objects at runtime. |
3463 * | 3502 * |
3464 * Properties added to an ObjectTemplate are added to each object | 3503 * Properties added to an ObjectTemplate are added to each object |
3465 * created from the ObjectTemplate. | 3504 * created from the ObjectTemplate. |
3466 */ | 3505 */ |
3467 class V8_EXPORT ObjectTemplate : public Template { | 3506 class V8_EXPORT ObjectTemplate : public Template { |
3468 public: | 3507 public: |
3469 /** Creates an ObjectTemplate. */ | 3508 /** Creates an ObjectTemplate. */ |
| 3509 static Local<ObjectTemplate> New(Isolate* isolate); |
| 3510 // Will be deprecated soon. |
3470 static Local<ObjectTemplate> New(); | 3511 static Local<ObjectTemplate> New(); |
3471 | 3512 |
3472 /** Creates a new instance of this template.*/ | 3513 /** Creates a new instance of this template.*/ |
3473 Local<Object> NewInstance(); | 3514 Local<Object> NewInstance(); |
3474 | 3515 |
3475 /** | 3516 /** |
3476 * Sets an accessor on the object template. | 3517 * Sets an accessor on the object template. |
3477 * | 3518 * |
3478 * Whenever the property with the given name is accessed on objects | 3519 * Whenever the property with the given name is accessed on objects |
3479 * created from this ObjectTemplate the getter and setter callbacks | 3520 * created from this ObjectTemplate the getter and setter callbacks |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3601 int InternalFieldCount(); | 3642 int InternalFieldCount(); |
3602 | 3643 |
3603 /** | 3644 /** |
3604 * Sets the number of internal fields for objects generated from | 3645 * Sets the number of internal fields for objects generated from |
3605 * this template. | 3646 * this template. |
3606 */ | 3647 */ |
3607 void SetInternalFieldCount(int value); | 3648 void SetInternalFieldCount(int value); |
3608 | 3649 |
3609 private: | 3650 private: |
3610 ObjectTemplate(); | 3651 ObjectTemplate(); |
3611 static Local<ObjectTemplate> New(Handle<FunctionTemplate> constructor); | 3652 static Local<ObjectTemplate> New(internal::Isolate* isolate, |
| 3653 Handle<FunctionTemplate> constructor); |
3612 friend class FunctionTemplate; | 3654 friend class FunctionTemplate; |
3613 }; | 3655 }; |
3614 | 3656 |
3615 | 3657 |
3616 /** | 3658 /** |
3617 * A Signature specifies which receivers and arguments are valid | 3659 * A Signature specifies which receivers and arguments are valid |
3618 * parameters to a function. | 3660 * parameters to a function. |
3619 */ | 3661 */ |
3620 class V8_EXPORT Signature : public Data { | 3662 class V8_EXPORT Signature : public Data { |
3621 public: | 3663 public: |
| 3664 static Local<Signature> New(Isolate* isolate, |
| 3665 Handle<FunctionTemplate> receiver = |
| 3666 Handle<FunctionTemplate>(), |
| 3667 int argc = 0, |
| 3668 Handle<FunctionTemplate> argv[] = 0); |
| 3669 // Will be deprecated soon. |
3622 static Local<Signature> New(Handle<FunctionTemplate> receiver = | 3670 static Local<Signature> New(Handle<FunctionTemplate> receiver = |
3623 Handle<FunctionTemplate>(), | 3671 Handle<FunctionTemplate>(), |
3624 int argc = 0, | 3672 int argc = 0, |
3625 Handle<FunctionTemplate> argv[] = 0); | 3673 Handle<FunctionTemplate> argv[] = 0); |
3626 private: | 3674 private: |
3627 Signature(); | 3675 Signature(); |
3628 }; | 3676 }; |
3629 | 3677 |
3630 | 3678 |
3631 /** | 3679 /** |
3632 * An AccessorSignature specifies which receivers are valid parameters | 3680 * An AccessorSignature specifies which receivers are valid parameters |
3633 * to an accessor callback. | 3681 * to an accessor callback. |
3634 */ | 3682 */ |
3635 class V8_EXPORT AccessorSignature : public Data { | 3683 class V8_EXPORT AccessorSignature : public Data { |
3636 public: | 3684 public: |
| 3685 static Local<AccessorSignature> New(Isolate* isolate, |
| 3686 Handle<FunctionTemplate> receiver = |
| 3687 Handle<FunctionTemplate>()); |
| 3688 // Will be deprecated soon. |
3637 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver = | 3689 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver = |
3638 Handle<FunctionTemplate>()); | 3690 Handle<FunctionTemplate>()); |
| 3691 |
3639 private: | 3692 private: |
3640 AccessorSignature(); | 3693 AccessorSignature(); |
3641 }; | 3694 }; |
3642 | 3695 |
3643 | 3696 |
3644 class V8_EXPORT DeclaredAccessorDescriptor : public Data { | 3697 class V8_EXPORT DeclaredAccessorDescriptor : public Data { |
3645 private: | 3698 private: |
3646 DeclaredAccessorDescriptor(); | 3699 DeclaredAccessorDescriptor(); |
3647 }; | 3700 }; |
3648 | 3701 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3732 class V8_EXPORT Extension { // NOLINT | 3785 class V8_EXPORT Extension { // NOLINT |
3733 public: | 3786 public: |
3734 // Note that the strings passed into this constructor must live as long | 3787 // Note that the strings passed into this constructor must live as long |
3735 // as the Extension itself. | 3788 // as the Extension itself. |
3736 Extension(const char* name, | 3789 Extension(const char* name, |
3737 const char* source = 0, | 3790 const char* source = 0, |
3738 int dep_count = 0, | 3791 int dep_count = 0, |
3739 const char** deps = 0, | 3792 const char** deps = 0, |
3740 int source_length = -1); | 3793 int source_length = -1); |
3741 virtual ~Extension() { } | 3794 virtual ~Extension() { } |
| 3795 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
| 3796 v8::Isolate* isolate, v8::Handle<v8::String> name) { |
| 3797 return GetNativeFunction(name); |
| 3798 } |
| 3799 // Will be deprecated soon. |
3742 virtual v8::Handle<v8::FunctionTemplate> | 3800 virtual v8::Handle<v8::FunctionTemplate> |
3743 GetNativeFunction(v8::Handle<v8::String> name) { | 3801 GetNativeFunction(v8::Handle<v8::String> name) { |
3744 return v8::Handle<v8::FunctionTemplate>(); | 3802 return v8::Handle<v8::FunctionTemplate>(); |
3745 } | 3803 } |
3746 | 3804 |
3747 const char* name() const { return name_; } | 3805 const char* name() const { return name_; } |
3748 size_t source_length() const { return source_length_; } | 3806 size_t source_length() const { return source_length_; } |
3749 const String::ExternalAsciiStringResource* source() const { | 3807 const String::ExternalAsciiStringResource* source() const { |
3750 return &source_; } | 3808 return &source_; } |
3751 int dependency_count() { return dep_count_; } | 3809 int dependency_count() { return dep_count_; } |
(...skipping 24 matching lines...) Expand all Loading... |
3776 class V8_EXPORT DeclareExtension { | 3834 class V8_EXPORT DeclareExtension { |
3777 public: | 3835 public: |
3778 V8_INLINE DeclareExtension(Extension* extension) { | 3836 V8_INLINE DeclareExtension(Extension* extension) { |
3779 RegisterExtension(extension); | 3837 RegisterExtension(extension); |
3780 } | 3838 } |
3781 }; | 3839 }; |
3782 | 3840 |
3783 | 3841 |
3784 // --- Statics --- | 3842 // --- Statics --- |
3785 | 3843 |
3786 | |
3787 Handle<Primitive> V8_EXPORT Undefined(); | |
3788 Handle<Primitive> V8_EXPORT Null(); | |
3789 Handle<Boolean> V8_EXPORT True(); | |
3790 Handle<Boolean> V8_EXPORT False(); | |
3791 | |
3792 V8_INLINE Handle<Primitive> Undefined(Isolate* isolate); | 3844 V8_INLINE Handle<Primitive> Undefined(Isolate* isolate); |
3793 V8_INLINE Handle<Primitive> Null(Isolate* isolate); | 3845 V8_INLINE Handle<Primitive> Null(Isolate* isolate); |
3794 V8_INLINE Handle<Boolean> True(Isolate* isolate); | 3846 V8_INLINE Handle<Boolean> True(Isolate* isolate); |
3795 V8_INLINE Handle<Boolean> False(Isolate* isolate); | 3847 V8_INLINE Handle<Boolean> False(Isolate* isolate); |
3796 | 3848 |
| 3849 // Will be removed soon. |
| 3850 Handle<Primitive> V8_EXPORT Undefined(); |
| 3851 Handle<Primitive> V8_EXPORT Null(); |
| 3852 Handle<Boolean> V8_EXPORT True(); |
| 3853 Handle<Boolean> V8_EXPORT False(); |
| 3854 |
3797 | 3855 |
3798 /** | 3856 /** |
3799 * A set of constraints that specifies the limits of the runtime's memory use. | 3857 * A set of constraints that specifies the limits of the runtime's memory use. |
3800 * You must set the heap size before initializing the VM - the size cannot be | 3858 * You must set the heap size before initializing the VM - the size cannot be |
3801 * adjusted after the VM is initialized. | 3859 * adjusted after the VM is initialized. |
3802 * | 3860 * |
3803 * If you are using threads then you should hold the V8::Locker lock while | 3861 * If you are using threads then you should hold the V8::Locker lock while |
3804 * setting the stack limit and you must set a non-default stack limit separately | 3862 * setting the stack limit and you must set a non-default stack limit separately |
3805 * for each thread. | 3863 * for each thread. |
3806 */ | 3864 */ |
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6597 */ | 6655 */ |
6598 | 6656 |
6599 | 6657 |
6600 } // namespace v8 | 6658 } // namespace v8 |
6601 | 6659 |
6602 | 6660 |
6603 #undef TYPE_CHECK | 6661 #undef TYPE_CHECK |
6604 | 6662 |
6605 | 6663 |
6606 #endif // V8_H_ | 6664 #endif // V8_H_ |
OLD | NEW |