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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1785 static Local<String> Concat(Handle<String> left, Handle<String> right); | 1792 static Local<String> Concat(Handle<String> left, Handle<String> right); |
1786 | 1793 |
1787 /** | 1794 /** |
1788 * Creates a new external string using the data defined in the given | 1795 * Creates a new external string using the data defined in the given |
1789 * resource. When the external string is no longer live on V8's heap the | 1796 * resource. When the external string is no longer live on V8's heap the |
1790 * resource will be disposed by calling its Dispose method. The caller of | 1797 * resource will be disposed by calling its Dispose method. The caller of |
1791 * this function should not otherwise delete or modify the resource. Neither | 1798 * this function should not otherwise delete or modify the resource. Neither |
1792 * should the underlying buffer be deallocated or modified except through the | 1799 * should the underlying buffer be deallocated or modified except through the |
1793 * destructor of the external string resource. | 1800 * destructor of the external string resource. |
1794 */ | 1801 */ |
1802 static Local<String> NewExternal(Isolate* isolate, | |
1803 ExternalStringResource* resource); | |
1804 // Will be deprecated soon. | |
1795 static Local<String> NewExternal(ExternalStringResource* resource); | 1805 static Local<String> NewExternal(ExternalStringResource* resource); |
1796 | 1806 |
1797 /** | 1807 /** |
1798 * Associate an external string resource with this string by transforming it | 1808 * Associate an external string resource with this string by transforming it |
1799 * in place so that existing references to this string in the JavaScript heap | 1809 * in place so that existing references to this string in the JavaScript heap |
1800 * will use the external string resource. The external string resource's | 1810 * will use the external string resource. The external string resource's |
1801 * character contents need to be equivalent to this string. | 1811 * character contents need to be equivalent to this string. |
1802 * Returns true if the string has been changed to be an external string. | 1812 * Returns true if the string has been changed to be an external string. |
1803 * The string is not modified if the operation fails. See NewExternal for | 1813 * The string is not modified if the operation fails. See NewExternal for |
1804 * information on the lifetime of the resource. | 1814 * information on the lifetime of the resource. |
1805 */ | 1815 */ |
1806 bool MakeExternal(ExternalStringResource* resource); | 1816 bool MakeExternal(ExternalStringResource* resource); |
1807 | 1817 |
1808 /** | 1818 /** |
1809 * Creates a new external string using the ASCII data defined in the given | 1819 * Creates a new external string using the ASCII data defined in the given |
1810 * resource. When the external string is no longer live on V8's heap the | 1820 * resource. When the external string is no longer live on V8's heap the |
1811 * resource will be disposed by calling its Dispose method. The caller of | 1821 * resource will be disposed by calling its Dispose method. The caller of |
1812 * this function should not otherwise delete or modify the resource. Neither | 1822 * this function should not otherwise delete or modify the resource. Neither |
1813 * should the underlying buffer be deallocated or modified except through the | 1823 * should the underlying buffer be deallocated or modified except through the |
1814 * destructor of the external string resource. | 1824 * destructor of the external string resource. |
1815 */ | 1825 */ |
1826 static Local<String> NewExternal(Isolate* isolate, | |
1827 ExternalAsciiStringResource* resource); | |
1828 // Will be deprecated soon. | |
1816 static Local<String> NewExternal(ExternalAsciiStringResource* resource); | 1829 static Local<String> NewExternal(ExternalAsciiStringResource* resource); |
1817 | 1830 |
1818 /** | 1831 /** |
1819 * Associate an external string resource with this string by transforming it | 1832 * Associate an external string resource with this string by transforming it |
1820 * in place so that existing references to this string in the JavaScript heap | 1833 * in place so that existing references to this string in the JavaScript heap |
1821 * will use the external string resource. The external string resource's | 1834 * will use the external string resource. The external string resource's |
1822 * character contents need to be equivalent to this string. | 1835 * character contents need to be equivalent to this string. |
1823 * Returns true if the string has been changed to be an external string. | 1836 * Returns true if the string has been changed to be an external string. |
1824 * The string is not modified if the operation fails. See NewExternal for | 1837 * The string is not modified if the operation fails. See NewExternal for |
1825 * information on the lifetime of the resource. | 1838 * information on the lifetime of the resource. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1959 Private(); | 1972 Private(); |
1960 }; | 1973 }; |
1961 | 1974 |
1962 | 1975 |
1963 /** | 1976 /** |
1964 * A JavaScript number value (ECMA-262, 4.3.20) | 1977 * A JavaScript number value (ECMA-262, 4.3.20) |
1965 */ | 1978 */ |
1966 class V8_EXPORT Number : public Primitive { | 1979 class V8_EXPORT Number : public Primitive { |
1967 public: | 1980 public: |
1968 double Value() const; | 1981 double Value() const; |
1982 static Local<Number> New(Isolate* isolate, double value); | |
1983 // Will be deprecated soon. | |
1969 static Local<Number> New(double value); | 1984 static Local<Number> New(double value); |
1970 static Local<Number> New(Isolate* isolate, double value); | |
1971 V8_INLINE static Number* Cast(v8::Value* obj); | 1985 V8_INLINE static Number* Cast(v8::Value* obj); |
1972 private: | 1986 private: |
1973 Number(); | 1987 Number(); |
1974 static void CheckCast(v8::Value* obj); | 1988 static void CheckCast(v8::Value* obj); |
1975 }; | 1989 }; |
1976 | 1990 |
1977 | 1991 |
1978 /** | 1992 /** |
1979 * A JavaScript value representing a signed integer. | 1993 * A JavaScript value representing a signed integer. |
1980 */ | 1994 */ |
1981 class V8_EXPORT Integer : public Number { | 1995 class V8_EXPORT Integer : public Number { |
1982 public: | 1996 public: |
1997 static Local<Integer> New(int32_t value, Isolate*); | |
Sven Panne
2013/11/26 08:57:39
For consistency reasons, the Isolate parameter sho
| |
1998 static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*); | |
1999 // Will be deprecated soon. | |
1983 static Local<Integer> New(int32_t value); | 2000 static Local<Integer> New(int32_t value); |
1984 static Local<Integer> NewFromUnsigned(uint32_t value); | 2001 static Local<Integer> NewFromUnsigned(uint32_t value); |
1985 static Local<Integer> New(int32_t value, Isolate*); | |
1986 static Local<Integer> NewFromUnsigned(uint32_t value, Isolate*); | |
1987 int64_t Value() const; | 2002 int64_t Value() const; |
1988 V8_INLINE static Integer* Cast(v8::Value* obj); | 2003 V8_INLINE static Integer* Cast(v8::Value* obj); |
1989 private: | 2004 private: |
1990 Integer(); | 2005 Integer(); |
1991 static void CheckCast(v8::Value* obj); | 2006 static void CheckCast(v8::Value* obj); |
1992 }; | 2007 }; |
1993 | 2008 |
1994 | 2009 |
1995 /** | 2010 /** |
1996 * A JavaScript value representing a 32-bit signed integer. | 2011 * A JavaScript value representing a 32-bit signed integer. |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2329 int argc, | 2344 int argc, |
2330 Handle<Value> argv[]); | 2345 Handle<Value> argv[]); |
2331 | 2346 |
2332 /** | 2347 /** |
2333 * Call an Object as a constructor if a callback is set by the | 2348 * Call an Object as a constructor if a callback is set by the |
2334 * ObjectTemplate::SetCallAsFunctionHandler method. | 2349 * ObjectTemplate::SetCallAsFunctionHandler method. |
2335 * Note: This method behaves like the Function::NewInstance method. | 2350 * Note: This method behaves like the Function::NewInstance method. |
2336 */ | 2351 */ |
2337 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); | 2352 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); |
2338 | 2353 |
2354 static Local<Object> New(Isolate* isolate); | |
2355 // Will be deprecated soon. | |
2339 static Local<Object> New(); | 2356 static Local<Object> New(); |
2340 V8_INLINE static Object* Cast(Value* obj); | 2357 V8_INLINE static Object* Cast(Value* obj); |
2341 | 2358 |
2342 private: | 2359 private: |
2343 Object(); | 2360 Object(); |
2344 static void CheckCast(Value* obj); | 2361 static void CheckCast(Value* obj); |
2345 Local<Value> SlowGetInternalField(int index); | 2362 Local<Value> SlowGetInternalField(int index); |
2346 void* SlowGetAlignedPointerFromInternalField(int index); | 2363 void* SlowGetAlignedPointerFromInternalField(int index); |
2347 }; | 2364 }; |
2348 | 2365 |
2349 | 2366 |
2350 /** | 2367 /** |
2351 * An instance of the built-in array constructor (ECMA-262, 15.4.2). | 2368 * An instance of the built-in array constructor (ECMA-262, 15.4.2). |
2352 */ | 2369 */ |
2353 class V8_EXPORT Array : public Object { | 2370 class V8_EXPORT Array : public Object { |
2354 public: | 2371 public: |
2355 uint32_t Length() const; | 2372 uint32_t Length() const; |
2356 | 2373 |
2357 /** | 2374 /** |
2358 * Clones an element at index |index|. Returns an empty | 2375 * Clones an element at index |index|. Returns an empty |
2359 * handle if cloning fails (for any reason). | 2376 * handle if cloning fails (for any reason). |
2360 */ | 2377 */ |
2361 Local<Object> CloneElementAt(uint32_t index); | 2378 Local<Object> CloneElementAt(uint32_t index); |
2362 | 2379 |
2363 /** | 2380 /** |
2364 * Creates a JavaScript array with the given length. If the length | 2381 * Creates a JavaScript array with the given length. If the length |
2365 * is negative the returned array will have length 0. | 2382 * is negative the returned array will have length 0. |
2366 */ | 2383 */ |
2384 static Local<Array> New(Isolate* isolate, int length = 0); | |
2385 // Will be deprecated soon. | |
2367 static Local<Array> New(int length = 0); | 2386 static Local<Array> New(int length = 0); |
2368 | 2387 |
2369 V8_INLINE static Array* Cast(Value* obj); | 2388 V8_INLINE static Array* Cast(Value* obj); |
2370 private: | 2389 private: |
2371 Array(); | 2390 Array(); |
2372 static void CheckCast(Value* obj); | 2391 static void CheckCast(Value* obj); |
2373 }; | 2392 }; |
2374 | 2393 |
2375 | 2394 |
2376 template<typename T> | 2395 template<typename T> |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2620 * Data length in bytes. | 2639 * Data length in bytes. |
2621 */ | 2640 */ |
2622 size_t ByteLength() const; | 2641 size_t ByteLength() const; |
2623 | 2642 |
2624 /** | 2643 /** |
2625 * Create a new ArrayBuffer. Allocate |byte_length| bytes. | 2644 * Create a new ArrayBuffer. Allocate |byte_length| bytes. |
2626 * Allocated memory will be owned by a created ArrayBuffer and | 2645 * Allocated memory will be owned by a created ArrayBuffer and |
2627 * will be deallocated when it is garbage-collected, | 2646 * will be deallocated when it is garbage-collected, |
2628 * unless the object is externalized. | 2647 * unless the object is externalized. |
2629 */ | 2648 */ |
2649 static Local<ArrayBuffer> New(Isolate* isolate, size_t byte_length); | |
2650 // Will be deprecated soon. | |
2630 static Local<ArrayBuffer> New(size_t byte_length); | 2651 static Local<ArrayBuffer> New(size_t byte_length); |
2631 | 2652 |
2632 /** | 2653 /** |
2633 * Create a new ArrayBuffer over an existing memory block. | 2654 * Create a new ArrayBuffer over an existing memory block. |
2634 * The created array buffer is immediately in externalized state. | 2655 * The created array buffer is immediately in externalized state. |
2635 * The memory block will not be reclaimed when a created ArrayBuffer | 2656 * The memory block will not be reclaimed when a created ArrayBuffer |
2636 * is garbage-collected. | 2657 * is garbage-collected. |
2637 */ | 2658 */ |
2659 static Local<ArrayBuffer> New(Isolate* isolate, void* data, | |
2660 size_t byte_length); | |
2661 // Will be deprecated soon. | |
2638 static Local<ArrayBuffer> New(void* data, size_t byte_length); | 2662 static Local<ArrayBuffer> New(void* data, size_t byte_length); |
2639 | 2663 |
2640 /** | 2664 /** |
2641 * Returns true if ArrayBuffer is extrenalized, that is, does not | 2665 * Returns true if ArrayBuffer is extrenalized, that is, does not |
2642 * own its memory block. | 2666 * own its memory block. |
2643 */ | 2667 */ |
2644 bool IsExternal() const; | 2668 bool IsExternal() const; |
2645 | 2669 |
2646 /** | 2670 /** |
2647 * Neuters this ArrayBuffer and all its views (typed arrays). | 2671 * Neuters this ArrayBuffer and all its views (typed arrays). |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2888 DataView(); | 2912 DataView(); |
2889 static void CheckCast(Value* obj); | 2913 static void CheckCast(Value* obj); |
2890 }; | 2914 }; |
2891 | 2915 |
2892 | 2916 |
2893 /** | 2917 /** |
2894 * An instance of the built-in Date constructor (ECMA-262, 15.9). | 2918 * An instance of the built-in Date constructor (ECMA-262, 15.9). |
2895 */ | 2919 */ |
2896 class V8_EXPORT Date : public Object { | 2920 class V8_EXPORT Date : public Object { |
2897 public: | 2921 public: |
2922 static Local<Value> New(Isolate* isolate, double time); | |
2923 // Will be deprecated soon. | |
2898 static Local<Value> New(double time); | 2924 static Local<Value> New(double time); |
2899 | 2925 |
2900 V8_DEPRECATED( | 2926 V8_DEPRECATED( |
2901 "Use ValueOf instead", | 2927 "Use ValueOf instead", |
2902 double NumberValue() const) { return ValueOf(); } | 2928 double NumberValue() const) { return ValueOf(); } |
2903 | 2929 |
2904 /** | 2930 /** |
2905 * A specialization of Value::NumberValue that is more efficient | 2931 * A specialization of Value::NumberValue that is more efficient |
2906 * because we know the structure of this object. | 2932 * because we know the structure of this object. |
2907 */ | 2933 */ |
2908 double ValueOf() const; | 2934 double ValueOf() const; |
2909 | 2935 |
2910 V8_INLINE static Date* Cast(v8::Value* obj); | 2936 V8_INLINE static Date* Cast(v8::Value* obj); |
2911 | 2937 |
2912 /** | 2938 /** |
2913 * Notification that the embedder has changed the time zone, | 2939 * Notification that the embedder has changed the time zone, |
2914 * daylight savings time, or other date / time configuration | 2940 * daylight savings time, or other date / time configuration |
2915 * parameters. V8 keeps a cache of various values used for | 2941 * parameters. V8 keeps a cache of various values used for |
2916 * date / time computation. This notification will reset | 2942 * date / time computation. This notification will reset |
2917 * those cached values for the current context so that date / | 2943 * those cached values for the current context so that date / |
2918 * time configuration changes would be reflected in the Date | 2944 * time configuration changes would be reflected in the Date |
2919 * object. | 2945 * object. |
2920 * | 2946 * |
2921 * This API should not be called more than needed as it will | 2947 * This API should not be called more than needed as it will |
2922 * negatively impact the performance of date operations. | 2948 * negatively impact the performance of date operations. |
2923 */ | 2949 */ |
2950 static void DateTimeConfigurationChangeNotification(Isolate* isolate); | |
2951 // Will be deprecated soon. | |
2924 static void DateTimeConfigurationChangeNotification(); | 2952 static void DateTimeConfigurationChangeNotification(); |
2925 | 2953 |
2926 private: | 2954 private: |
2927 static void CheckCast(v8::Value* obj); | 2955 static void CheckCast(v8::Value* obj); |
2928 }; | 2956 }; |
2929 | 2957 |
2930 | 2958 |
2931 /** | 2959 /** |
2932 * A Number object (ECMA-262, 4.3.21). | 2960 * A Number object (ECMA-262, 4.3.21). |
2933 */ | 2961 */ |
2934 class V8_EXPORT NumberObject : public Object { | 2962 class V8_EXPORT NumberObject : public Object { |
2935 public: | 2963 public: |
2964 static Local<Value> New(Isolate* isolate, double value); | |
2965 // Will be deprecated soon. | |
2936 static Local<Value> New(double value); | 2966 static Local<Value> New(double value); |
2937 | 2967 |
2938 V8_DEPRECATED( | 2968 V8_DEPRECATED( |
2939 "Use ValueOf instead", | 2969 "Use ValueOf instead", |
2940 double NumberValue() const) { return ValueOf(); } | 2970 double NumberValue() const) { return ValueOf(); } |
2941 | 2971 |
2942 /** | 2972 /** |
2943 * Returns the Number held by the object. | 2973 * Returns the Number held by the object. |
2944 */ | 2974 */ |
2945 double ValueOf() const; | 2975 double ValueOf() const; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3370 * \code | 3400 * \code |
3371 * child_func.prototype.__proto__ == function.prototype; | 3401 * child_func.prototype.__proto__ == function.prototype; |
3372 * child_instance.instance_accessor calls 'InstanceAccessorCallback' | 3402 * child_instance.instance_accessor calls 'InstanceAccessorCallback' |
3373 * child_instance.instance_property == 3; | 3403 * child_instance.instance_property == 3; |
3374 * \endcode | 3404 * \endcode |
3375 */ | 3405 */ |
3376 class V8_EXPORT FunctionTemplate : public Template { | 3406 class V8_EXPORT FunctionTemplate : public Template { |
3377 public: | 3407 public: |
3378 /** Creates a function template.*/ | 3408 /** Creates a function template.*/ |
3379 static Local<FunctionTemplate> New( | 3409 static Local<FunctionTemplate> New( |
3410 Isolate* isolate, | |
3411 FunctionCallback callback = 0, | |
3412 Handle<Value> data = Handle<Value>(), | |
3413 Handle<Signature> signature = Handle<Signature>(), | |
3414 int length = 0); | |
3415 // Will be deprecated soon. | |
3416 static Local<FunctionTemplate> New( | |
3380 FunctionCallback callback = 0, | 3417 FunctionCallback callback = 0, |
3381 Handle<Value> data = Handle<Value>(), | 3418 Handle<Value> data = Handle<Value>(), |
3382 Handle<Signature> signature = Handle<Signature>(), | 3419 Handle<Signature> signature = Handle<Signature>(), |
3383 int length = 0); | 3420 int length = 0); |
3384 | 3421 |
3385 /** Returns the unique function instance in the current execution context.*/ | 3422 /** Returns the unique function instance in the current execution context.*/ |
3386 Local<Function> GetFunction(); | 3423 Local<Function> GetFunction(); |
3387 | 3424 |
3388 /** | 3425 /** |
3389 * Set the call-handler callback for a FunctionTemplate. This | 3426 * Set the call-handler callback for a FunctionTemplate. This |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3456 | 3493 |
3457 /** | 3494 /** |
3458 * An ObjectTemplate is used to create objects at runtime. | 3495 * An ObjectTemplate is used to create objects at runtime. |
3459 * | 3496 * |
3460 * Properties added to an ObjectTemplate are added to each object | 3497 * Properties added to an ObjectTemplate are added to each object |
3461 * created from the ObjectTemplate. | 3498 * created from the ObjectTemplate. |
3462 */ | 3499 */ |
3463 class V8_EXPORT ObjectTemplate : public Template { | 3500 class V8_EXPORT ObjectTemplate : public Template { |
3464 public: | 3501 public: |
3465 /** Creates an ObjectTemplate. */ | 3502 /** Creates an ObjectTemplate. */ |
3503 static Local<ObjectTemplate> New(Isolate* isolate); | |
3504 // Will be deprecated soon. | |
3466 static Local<ObjectTemplate> New(); | 3505 static Local<ObjectTemplate> New(); |
3467 | 3506 |
3468 /** Creates a new instance of this template.*/ | 3507 /** Creates a new instance of this template.*/ |
3469 Local<Object> NewInstance(); | 3508 Local<Object> NewInstance(); |
3470 | 3509 |
3471 /** | 3510 /** |
3472 * Sets an accessor on the object template. | 3511 * Sets an accessor on the object template. |
3473 * | 3512 * |
3474 * Whenever the property with the given name is accessed on objects | 3513 * Whenever the property with the given name is accessed on objects |
3475 * created from this ObjectTemplate the getter and setter callbacks | 3514 * created from this ObjectTemplate the getter and setter callbacks |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3597 int InternalFieldCount(); | 3636 int InternalFieldCount(); |
3598 | 3637 |
3599 /** | 3638 /** |
3600 * Sets the number of internal fields for objects generated from | 3639 * Sets the number of internal fields for objects generated from |
3601 * this template. | 3640 * this template. |
3602 */ | 3641 */ |
3603 void SetInternalFieldCount(int value); | 3642 void SetInternalFieldCount(int value); |
3604 | 3643 |
3605 private: | 3644 private: |
3606 ObjectTemplate(); | 3645 ObjectTemplate(); |
3607 static Local<ObjectTemplate> New(Handle<FunctionTemplate> constructor); | 3646 static Local<ObjectTemplate> New(internal::Isolate* isolate, |
3647 Handle<FunctionTemplate> constructor); | |
3608 friend class FunctionTemplate; | 3648 friend class FunctionTemplate; |
3609 }; | 3649 }; |
3610 | 3650 |
3611 | 3651 |
3612 /** | 3652 /** |
3613 * A Signature specifies which receivers and arguments are valid | 3653 * A Signature specifies which receivers and arguments are valid |
3614 * parameters to a function. | 3654 * parameters to a function. |
3615 */ | 3655 */ |
3616 class V8_EXPORT Signature : public Data { | 3656 class V8_EXPORT Signature : public Data { |
3617 public: | 3657 public: |
3658 static Local<Signature> New(Isolate* isolate, | |
3659 Handle<FunctionTemplate> receiver = | |
3660 Handle<FunctionTemplate>(), | |
3661 int argc = 0, | |
3662 Handle<FunctionTemplate> argv[] = 0); | |
3663 // Will be deprecated soon. | |
3618 static Local<Signature> New(Handle<FunctionTemplate> receiver = | 3664 static Local<Signature> New(Handle<FunctionTemplate> receiver = |
3619 Handle<FunctionTemplate>(), | 3665 Handle<FunctionTemplate>(), |
3620 int argc = 0, | 3666 int argc = 0, |
3621 Handle<FunctionTemplate> argv[] = 0); | 3667 Handle<FunctionTemplate> argv[] = 0); |
3622 private: | 3668 private: |
3623 Signature(); | 3669 Signature(); |
3624 }; | 3670 }; |
3625 | 3671 |
3626 | 3672 |
3627 /** | 3673 /** |
3628 * An AccessorSignature specifies which receivers are valid parameters | 3674 * An AccessorSignature specifies which receivers are valid parameters |
3629 * to an accessor callback. | 3675 * to an accessor callback. |
3630 */ | 3676 */ |
3631 class V8_EXPORT AccessorSignature : public Data { | 3677 class V8_EXPORT AccessorSignature : public Data { |
3632 public: | 3678 public: |
3679 static Local<AccessorSignature> New(Isolate* isolate, | |
3680 Handle<FunctionTemplate> receiver = | |
3681 Handle<FunctionTemplate>()); | |
3682 // Will be deprecated soon. | |
3633 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver = | 3683 static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver = |
3634 Handle<FunctionTemplate>()); | 3684 Handle<FunctionTemplate>()); |
3685 | |
3635 private: | 3686 private: |
3636 AccessorSignature(); | 3687 AccessorSignature(); |
3637 }; | 3688 }; |
3638 | 3689 |
3639 | 3690 |
3640 class V8_EXPORT DeclaredAccessorDescriptor : public Data { | 3691 class V8_EXPORT DeclaredAccessorDescriptor : public Data { |
3641 private: | 3692 private: |
3642 DeclaredAccessorDescriptor(); | 3693 DeclaredAccessorDescriptor(); |
3643 }; | 3694 }; |
3644 | 3695 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3728 class V8_EXPORT Extension { // NOLINT | 3779 class V8_EXPORT Extension { // NOLINT |
3729 public: | 3780 public: |
3730 // Note that the strings passed into this constructor must live as long | 3781 // Note that the strings passed into this constructor must live as long |
3731 // as the Extension itself. | 3782 // as the Extension itself. |
3732 Extension(const char* name, | 3783 Extension(const char* name, |
3733 const char* source = 0, | 3784 const char* source = 0, |
3734 int dep_count = 0, | 3785 int dep_count = 0, |
3735 const char** deps = 0, | 3786 const char** deps = 0, |
3736 int source_length = -1); | 3787 int source_length = -1); |
3737 virtual ~Extension() { } | 3788 virtual ~Extension() { } |
3789 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( | |
3790 v8::Isolate* isolate, v8::Handle<v8::String> name) { | |
3791 return GetNativeFunction(name); | |
3792 } | |
3793 // Will be deprecated soon. | |
3738 virtual v8::Handle<v8::FunctionTemplate> | 3794 virtual v8::Handle<v8::FunctionTemplate> |
3739 GetNativeFunction(v8::Handle<v8::String> name) { | 3795 GetNativeFunction(v8::Handle<v8::String> name) { |
3740 return v8::Handle<v8::FunctionTemplate>(); | 3796 return v8::Handle<v8::FunctionTemplate>(); |
3741 } | 3797 } |
3742 | 3798 |
3743 const char* name() const { return name_; } | 3799 const char* name() const { return name_; } |
3744 size_t source_length() const { return source_length_; } | 3800 size_t source_length() const { return source_length_; } |
3745 const String::ExternalAsciiStringResource* source() const { | 3801 const String::ExternalAsciiStringResource* source() const { |
3746 return &source_; } | 3802 return &source_; } |
3747 int dependency_count() { return dep_count_; } | 3803 int dependency_count() { return dep_count_; } |
(...skipping 24 matching lines...) Expand all Loading... | |
3772 class V8_EXPORT DeclareExtension { | 3828 class V8_EXPORT DeclareExtension { |
3773 public: | 3829 public: |
3774 V8_INLINE DeclareExtension(Extension* extension) { | 3830 V8_INLINE DeclareExtension(Extension* extension) { |
3775 RegisterExtension(extension); | 3831 RegisterExtension(extension); |
3776 } | 3832 } |
3777 }; | 3833 }; |
3778 | 3834 |
3779 | 3835 |
3780 // --- Statics --- | 3836 // --- Statics --- |
3781 | 3837 |
3782 | |
3783 Handle<Primitive> V8_EXPORT Undefined(); | |
3784 Handle<Primitive> V8_EXPORT Null(); | |
3785 Handle<Boolean> V8_EXPORT True(); | |
3786 Handle<Boolean> V8_EXPORT False(); | |
3787 | |
3788 V8_INLINE Handle<Primitive> Undefined(Isolate* isolate); | 3838 V8_INLINE Handle<Primitive> Undefined(Isolate* isolate); |
3789 V8_INLINE Handle<Primitive> Null(Isolate* isolate); | 3839 V8_INLINE Handle<Primitive> Null(Isolate* isolate); |
3790 V8_INLINE Handle<Boolean> True(Isolate* isolate); | 3840 V8_INLINE Handle<Boolean> True(Isolate* isolate); |
3791 V8_INLINE Handle<Boolean> False(Isolate* isolate); | 3841 V8_INLINE Handle<Boolean> False(Isolate* isolate); |
3792 | 3842 |
3843 // Will be removed soon. | |
3844 Handle<Primitive> V8_EXPORT Undefined(); | |
3845 Handle<Primitive> V8_EXPORT Null(); | |
3846 Handle<Boolean> V8_EXPORT True(); | |
3847 Handle<Boolean> V8_EXPORT False(); | |
3848 | |
3793 | 3849 |
3794 /** | 3850 /** |
3795 * A set of constraints that specifies the limits of the runtime's memory use. | 3851 * A set of constraints that specifies the limits of the runtime's memory use. |
3796 * You must set the heap size before initializing the VM - the size cannot be | 3852 * You must set the heap size before initializing the VM - the size cannot be |
3797 * adjusted after the VM is initialized. | 3853 * adjusted after the VM is initialized. |
3798 * | 3854 * |
3799 * If you are using threads then you should hold the V8::Locker lock while | 3855 * If you are using threads then you should hold the V8::Locker lock while |
3800 * setting the stack limit and you must set a non-default stack limit separately | 3856 * setting the stack limit and you must set a non-default stack limit separately |
3801 * for each thread. | 3857 * for each thread. |
3802 */ | 3858 */ |
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6584 */ | 6640 */ |
6585 | 6641 |
6586 | 6642 |
6587 } // namespace v8 | 6643 } // namespace v8 |
6588 | 6644 |
6589 | 6645 |
6590 #undef TYPE_CHECK | 6646 #undef TYPE_CHECK |
6591 | 6647 |
6592 | 6648 |
6593 #endif // V8_H_ | 6649 #endif // V8_H_ |
OLD | NEW |