OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 * This is an experimental feature. | 1886 * This is an experimental feature. |
1887 */ | 1887 */ |
1888 bool IsFloat64Array() const; | 1888 bool IsFloat64Array() const; |
1889 | 1889 |
1890 /** | 1890 /** |
1891 * Returns true if this value is a DataView. | 1891 * Returns true if this value is a DataView. |
1892 * This is an experimental feature. | 1892 * This is an experimental feature. |
1893 */ | 1893 */ |
1894 bool IsDataView() const; | 1894 bool IsDataView() const; |
1895 | 1895 |
| 1896 /** |
| 1897 * Returns true if this value is a SharedArrayBuffer. |
| 1898 * This is an experimental feature. |
| 1899 */ |
| 1900 bool IsSharedArrayBuffer() const; |
| 1901 |
| 1902 /** |
| 1903 * Returns true if this value is one of SharedTypedArrays. |
| 1904 * This is an experimental feature. |
| 1905 */ |
| 1906 bool IsSharedTypedArray() const; |
| 1907 |
| 1908 /** |
| 1909 * Returns true if this value is a SharedUint8Array. |
| 1910 * This is an experimental feature. |
| 1911 */ |
| 1912 bool IsSharedUint8Array() const; |
| 1913 |
| 1914 /** |
| 1915 * Returns true if this value is a SharedUint8ClampedArray. |
| 1916 * This is an experimental feature. |
| 1917 */ |
| 1918 bool IsSharedUint8ClampedArray() const; |
| 1919 |
| 1920 /** |
| 1921 * Returns true if this value is a SharedInt8Array. |
| 1922 * This is an experimental feature. |
| 1923 */ |
| 1924 bool IsSharedInt8Array() const; |
| 1925 |
| 1926 /** |
| 1927 * Returns true if this value is a SharedUint16Array. |
| 1928 * This is an experimental feature. |
| 1929 */ |
| 1930 bool IsSharedUint16Array() const; |
| 1931 |
| 1932 /** |
| 1933 * Returns true if this value is a SharedInt16Array. |
| 1934 * This is an experimental feature. |
| 1935 */ |
| 1936 bool IsSharedInt16Array() const; |
| 1937 |
| 1938 /** |
| 1939 * Returns true if this value is a SharedUint32Array. |
| 1940 * This is an experimental feature. |
| 1941 */ |
| 1942 bool IsSharedUint32Array() const; |
| 1943 |
| 1944 /** |
| 1945 * Returns true if this value is a SharedInt32Array. |
| 1946 * This is an experimental feature. |
| 1947 */ |
| 1948 bool IsSharedInt32Array() const; |
| 1949 |
| 1950 /** |
| 1951 * Returns true if this value is a SharedFloat32Array. |
| 1952 * This is an experimental feature. |
| 1953 */ |
| 1954 bool IsSharedFloat32Array() const; |
| 1955 |
| 1956 /** |
| 1957 * Returns true if this value is a SharedFloat64Array. |
| 1958 * This is an experimental feature. |
| 1959 */ |
| 1960 bool IsSharedFloat64Array() const; |
| 1961 |
| 1962 |
1896 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean( | 1963 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean( |
1897 Local<Context> context) const; | 1964 Local<Context> context) const; |
1898 V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber( | 1965 V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber( |
1899 Local<Context> context) const; | 1966 Local<Context> context) const; |
1900 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString( | 1967 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString( |
1901 Local<Context> context) const; | 1968 Local<Context> context) const; |
1902 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToDetailString( | 1969 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToDetailString( |
1903 Local<Context> context) const; | 1970 Local<Context> context) const; |
1904 V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject( | 1971 V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject( |
1905 Local<Context> context) const; | 1972 Local<Context> context) const; |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3305 * Create a new ArrayBuffer over an existing memory block. | 3372 * Create a new ArrayBuffer over an existing memory block. |
3306 * The created array buffer is by default immediately in externalized state. | 3373 * The created array buffer is by default immediately in externalized state. |
3307 * The memory block will not be reclaimed when a created ArrayBuffer | 3374 * The memory block will not be reclaimed when a created ArrayBuffer |
3308 * is garbage-collected. | 3375 * is garbage-collected. |
3309 */ | 3376 */ |
3310 static Local<ArrayBuffer> New( | 3377 static Local<ArrayBuffer> New( |
3311 Isolate* isolate, void* data, size_t byte_length, | 3378 Isolate* isolate, void* data, size_t byte_length, |
3312 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); | 3379 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); |
3313 | 3380 |
3314 /** | 3381 /** |
3315 * Returns true if ArrayBuffer is extrenalized, that is, does not | 3382 * Returns true if ArrayBuffer is externalized, that is, does not |
3316 * own its memory block. | 3383 * own its memory block. |
3317 */ | 3384 */ |
3318 bool IsExternal() const; | 3385 bool IsExternal() const; |
3319 | 3386 |
3320 /** | 3387 /** |
3321 * Returns true if this ArrayBuffer may be neutered. | 3388 * Returns true if this ArrayBuffer may be neutered. |
3322 */ | 3389 */ |
3323 bool IsNeuterable() const; | 3390 bool IsNeuterable() const; |
3324 | 3391 |
3325 /** | 3392 /** |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3592 size_t byte_offset, size_t length); | 3659 size_t byte_offset, size_t length); |
3593 V8_INLINE static DataView* Cast(Value* obj); | 3660 V8_INLINE static DataView* Cast(Value* obj); |
3594 | 3661 |
3595 private: | 3662 private: |
3596 DataView(); | 3663 DataView(); |
3597 static void CheckCast(Value* obj); | 3664 static void CheckCast(Value* obj); |
3598 }; | 3665 }; |
3599 | 3666 |
3600 | 3667 |
3601 /** | 3668 /** |
| 3669 * TODO(binji): document |
| 3670 * An instance of the built-in SharedArrayBuffer constructor (ES6 draft |
| 3671 * 15.13.5). |
| 3672 * This API is experimental and may change significantly. |
| 3673 */ |
| 3674 class V8_EXPORT SharedArrayBuffer : public Object { |
| 3675 public: |
| 3676 /** |
| 3677 * The contents of an |SharedArrayBuffer|. Externalization of |
| 3678 * |SharedArrayBuffer| returns an instance of this class, populated, with a |
| 3679 * pointer to data and byte length. |
| 3680 * |
| 3681 * The Data pointer of SharedArrayBuffer::Contents is always allocated with |
| 3682 * |ArrayBuffer::Allocator::Allocate| by the allocator specified in |
| 3683 * v8::Isolate::CreateParams::shared_array_buffer_allocator. |
| 3684 * |
| 3685 * This API is experimental and may change significantly. |
| 3686 */ |
| 3687 class V8_EXPORT Contents { // NOLINT |
| 3688 public: |
| 3689 Contents() : data_(NULL), byte_length_(0) {} |
| 3690 |
| 3691 void* Data() const { return data_; } |
| 3692 size_t ByteLength() const { return byte_length_; } |
| 3693 |
| 3694 private: |
| 3695 void* data_; |
| 3696 size_t byte_length_; |
| 3697 |
| 3698 friend class SharedArrayBuffer; |
| 3699 }; |
| 3700 |
| 3701 |
| 3702 /** |
| 3703 * Data length in bytes. |
| 3704 */ |
| 3705 size_t ByteLength() const; |
| 3706 |
| 3707 /** |
| 3708 * Create a new SharedArrayBuffer. Allocate |byte_length| bytes. |
| 3709 * Allocated memory will be owned by a created SharedArrayBuffer and |
| 3710 * will be deallocated when it is garbage-collected, |
| 3711 * unless the object is externalized. |
| 3712 */ |
| 3713 static Local<SharedArrayBuffer> New(Isolate* isolate, size_t byte_length); |
| 3714 |
| 3715 /** |
| 3716 * Create a new SharedArrayBuffer over an existing memory block. The created |
| 3717 * array buffer is immediately in externalized state unless otherwise |
| 3718 * specified. The memory block will not be reclaimed when a created |
| 3719 * SharedArrayBuffer is garbage-collected. |
| 3720 */ |
| 3721 static Local<SharedArrayBuffer> New( |
| 3722 Isolate* isolate, void* data, size_t byte_length, |
| 3723 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized); |
| 3724 |
| 3725 /** |
| 3726 * Returns true if SharedArrayBuffer is externalized, that is, does not |
| 3727 * own its memory block. |
| 3728 */ |
| 3729 bool IsExternal() const; |
| 3730 |
| 3731 /** |
| 3732 * Make this SharedArrayBuffer external. The pointer to underlying memory |
| 3733 * block and byte length are returned as |Contents| structure. After |
| 3734 * SharedArrayBuffer had been etxrenalized, it does no longer owns the memory |
| 3735 * block. The caller should take steps to free memory when it is no longer |
| 3736 * needed. |
| 3737 * |
| 3738 * The memory block is guaranteed to be allocated with |Allocator::Allocate| |
| 3739 * by the allocator specified in |
| 3740 * v8::Isolate::CreateParams::shared_array_buffer_allocator. |
| 3741 * |
| 3742 */ |
| 3743 Contents Externalize(); |
| 3744 |
| 3745 /** |
| 3746 * Get a pointer to the ArrayBuffer's underlying memory block without |
| 3747 * externalizing it. If the ArrayBuffer is not externalized, this pointer |
| 3748 * will become invalid as soon as the ArrayBuffer became garbage collected. |
| 3749 * |
| 3750 * The embedder should make sure to hold a strong reference to the |
| 3751 * ArrayBuffer while accessing this pointer. |
| 3752 * |
| 3753 * The memory block is guaranteed to be allocated with |Allocator::Allocate| |
| 3754 * by the allocator specified in |
| 3755 * v8::Isolate::CreateParams::shared_array_buffer_allocator. |
| 3756 */ |
| 3757 Contents GetContents(); |
| 3758 |
| 3759 V8_INLINE static SharedArrayBuffer* Cast(Value* obj); |
| 3760 |
| 3761 static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; |
| 3762 |
| 3763 private: |
| 3764 SharedArrayBuffer(); |
| 3765 static void CheckCast(Value* obj); |
| 3766 }; |
| 3767 |
| 3768 |
| 3769 /** |
| 3770 * TODO(binji): document |
| 3771 * A base class for an instance of TypedArray series of constructors |
| 3772 * (ES6 draft 15.13.6). |
| 3773 * This API is experimental and may change significantly. |
| 3774 */ |
| 3775 class V8_EXPORT SharedTypedArray : public Object { |
| 3776 public: |
| 3777 /** |
| 3778 * Returns underlying SharedArrayBuffer. |
| 3779 */ |
| 3780 Local<SharedArrayBuffer> Buffer(); |
| 3781 /** |
| 3782 * Byte offset in |Buffer|. |
| 3783 */ |
| 3784 size_t ByteOffset(); |
| 3785 /** |
| 3786 * Size of a view in bytes. |
| 3787 */ |
| 3788 size_t ByteLength(); |
| 3789 |
| 3790 /** |
| 3791 * Number of elements in this typed array |
| 3792 * (e.g. for SharedInt16Array, |ByteLength|/2). |
| 3793 */ |
| 3794 size_t Length(); |
| 3795 |
| 3796 V8_INLINE static SharedTypedArray* Cast(Value* obj); |
| 3797 |
| 3798 private: |
| 3799 SharedTypedArray(); |
| 3800 static void CheckCast(Value* obj); |
| 3801 }; |
| 3802 |
| 3803 |
| 3804 /** |
| 3805 * TODO(binji): document |
| 3806 * An instance of Uint8Array constructor (ES6 draft 15.13.6). |
| 3807 * This API is experimental and may change significantly. |
| 3808 */ |
| 3809 class V8_EXPORT SharedUint8Array : public SharedTypedArray { |
| 3810 public: |
| 3811 static Local<SharedUint8Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3812 size_t byte_offset, size_t length); |
| 3813 V8_INLINE static SharedUint8Array* Cast(Value* obj); |
| 3814 |
| 3815 private: |
| 3816 SharedUint8Array(); |
| 3817 static void CheckCast(Value* obj); |
| 3818 }; |
| 3819 |
| 3820 |
| 3821 /** |
| 3822 * TODO(binji): document |
| 3823 * An instance of Uint8ClampedArray constructor (ES6 draft 15.13.6). |
| 3824 * This API is experimental and may change significantly. |
| 3825 */ |
| 3826 class V8_EXPORT SharedUint8ClampedArray : public SharedTypedArray { |
| 3827 public: |
| 3828 static Local<SharedUint8ClampedArray> New( |
| 3829 Handle<SharedArrayBuffer> array_buffer, size_t byte_offset, |
| 3830 size_t length); |
| 3831 V8_INLINE static SharedUint8ClampedArray* Cast(Value* obj); |
| 3832 |
| 3833 private: |
| 3834 SharedUint8ClampedArray(); |
| 3835 static void CheckCast(Value* obj); |
| 3836 }; |
| 3837 |
| 3838 /** |
| 3839 * TODO(binji): document |
| 3840 * An instance of Int8Array constructor (ES6 draft 15.13.6). |
| 3841 * This API is experimental and may change significantly. |
| 3842 */ |
| 3843 class V8_EXPORT SharedInt8Array : public SharedTypedArray { |
| 3844 public: |
| 3845 static Local<SharedInt8Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3846 size_t byte_offset, size_t length); |
| 3847 V8_INLINE static SharedInt8Array* Cast(Value* obj); |
| 3848 |
| 3849 private: |
| 3850 SharedInt8Array(); |
| 3851 static void CheckCast(Value* obj); |
| 3852 }; |
| 3853 |
| 3854 |
| 3855 /** |
| 3856 * TODO(binji): document |
| 3857 * An instance of Uint16Array constructor (ES6 draft 15.13.6). |
| 3858 * This API is experimental and may change significantly. |
| 3859 */ |
| 3860 class V8_EXPORT SharedUint16Array : public SharedTypedArray { |
| 3861 public: |
| 3862 static Local<SharedUint16Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3863 size_t byte_offset, size_t length); |
| 3864 V8_INLINE static SharedUint16Array* Cast(Value* obj); |
| 3865 |
| 3866 private: |
| 3867 SharedUint16Array(); |
| 3868 static void CheckCast(Value* obj); |
| 3869 }; |
| 3870 |
| 3871 |
| 3872 /** |
| 3873 * TODO(binji): document |
| 3874 * An instance of Int16Array constructor (ES6 draft 15.13.6). |
| 3875 * This API is experimental and may change significantly. |
| 3876 */ |
| 3877 class V8_EXPORT SharedInt16Array : public SharedTypedArray { |
| 3878 public: |
| 3879 static Local<SharedInt16Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3880 size_t byte_offset, size_t length); |
| 3881 V8_INLINE static SharedInt16Array* Cast(Value* obj); |
| 3882 |
| 3883 private: |
| 3884 SharedInt16Array(); |
| 3885 static void CheckCast(Value* obj); |
| 3886 }; |
| 3887 |
| 3888 |
| 3889 /** |
| 3890 * TODO(binji): document |
| 3891 * An instance of Uint32Array constructor (ES6 draft 15.13.6). |
| 3892 * This API is experimental and may change significantly. |
| 3893 */ |
| 3894 class V8_EXPORT SharedUint32Array : public SharedTypedArray { |
| 3895 public: |
| 3896 static Local<SharedUint32Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3897 size_t byte_offset, size_t length); |
| 3898 V8_INLINE static SharedUint32Array* Cast(Value* obj); |
| 3899 |
| 3900 private: |
| 3901 SharedUint32Array(); |
| 3902 static void CheckCast(Value* obj); |
| 3903 }; |
| 3904 |
| 3905 |
| 3906 /** |
| 3907 * TODO(binji): document |
| 3908 * An instance of Int32Array constructor (ES6 draft 15.13.6). |
| 3909 * This API is experimental and may change significantly. |
| 3910 */ |
| 3911 class V8_EXPORT SharedInt32Array : public SharedTypedArray { |
| 3912 public: |
| 3913 static Local<SharedInt32Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3914 size_t byte_offset, size_t length); |
| 3915 V8_INLINE static SharedInt32Array* Cast(Value* obj); |
| 3916 |
| 3917 private: |
| 3918 SharedInt32Array(); |
| 3919 static void CheckCast(Value* obj); |
| 3920 }; |
| 3921 |
| 3922 |
| 3923 /** |
| 3924 * TODO(binji): document |
| 3925 * An instance of Float32Array constructor (ES6 draft 15.13.6). |
| 3926 * This API is experimental and may change significantly. |
| 3927 */ |
| 3928 class V8_EXPORT SharedFloat32Array : public SharedTypedArray { |
| 3929 public: |
| 3930 static Local<SharedFloat32Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3931 size_t byte_offset, size_t length); |
| 3932 V8_INLINE static SharedFloat32Array* Cast(Value* obj); |
| 3933 |
| 3934 private: |
| 3935 SharedFloat32Array(); |
| 3936 static void CheckCast(Value* obj); |
| 3937 }; |
| 3938 |
| 3939 |
| 3940 /** |
| 3941 * TODO(binji): document |
| 3942 * An instance of Float64Array constructor (ES6 draft 15.13.6). |
| 3943 * This API is experimental and may change significantly. |
| 3944 */ |
| 3945 class V8_EXPORT SharedFloat64Array : public SharedTypedArray { |
| 3946 public: |
| 3947 static Local<SharedFloat64Array> New(Handle<SharedArrayBuffer> array_buffer, |
| 3948 size_t byte_offset, size_t length); |
| 3949 V8_INLINE static SharedFloat64Array* Cast(Value* obj); |
| 3950 |
| 3951 private: |
| 3952 SharedFloat64Array(); |
| 3953 static void CheckCast(Value* obj); |
| 3954 }; |
| 3955 |
| 3956 |
| 3957 /** |
3602 * An instance of the built-in Date constructor (ECMA-262, 15.9). | 3958 * An instance of the built-in Date constructor (ECMA-262, 15.9). |
3603 */ | 3959 */ |
3604 class V8_EXPORT Date : public Object { | 3960 class V8_EXPORT Date : public Object { |
3605 public: | 3961 public: |
3606 static V8_DEPRECATE_SOON("Use maybe version.", | 3962 static V8_DEPRECATE_SOON("Use maybe version.", |
3607 Local<Value> New(Isolate* isolate, double time)); | 3963 Local<Value> New(Isolate* isolate, double time)); |
3608 static V8_WARN_UNUSED_RESULT MaybeLocal<Value> New(Local<Context> context, | 3964 static V8_WARN_UNUSED_RESULT MaybeLocal<Value> New(Local<Context> context, |
3609 double time); | 3965 double time); |
3610 | 3966 |
3611 /** | 3967 /** |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4949 * Initial configuration parameters for a new Isolate. | 5305 * Initial configuration parameters for a new Isolate. |
4950 */ | 5306 */ |
4951 struct CreateParams { | 5307 struct CreateParams { |
4952 CreateParams() | 5308 CreateParams() |
4953 : entry_hook(NULL), | 5309 : entry_hook(NULL), |
4954 code_event_handler(NULL), | 5310 code_event_handler(NULL), |
4955 snapshot_blob(NULL), | 5311 snapshot_blob(NULL), |
4956 counter_lookup_callback(NULL), | 5312 counter_lookup_callback(NULL), |
4957 create_histogram_callback(NULL), | 5313 create_histogram_callback(NULL), |
4958 add_histogram_sample_callback(NULL), | 5314 add_histogram_sample_callback(NULL), |
4959 array_buffer_allocator(NULL) {} | 5315 array_buffer_allocator(NULL), |
| 5316 shared_array_buffer_allocator(NULL) {} |
4960 | 5317 |
4961 /** | 5318 /** |
4962 * The optional entry_hook allows the host application to provide the | 5319 * The optional entry_hook allows the host application to provide the |
4963 * address of a function that's invoked on entry to every V8-generated | 5320 * address of a function that's invoked on entry to every V8-generated |
4964 * function. Note that entry_hook is invoked at the very start of each | 5321 * function. Note that entry_hook is invoked at the very start of each |
4965 * generated function. Furthermore, if an entry_hook is given, V8 will | 5322 * generated function. Furthermore, if an entry_hook is given, V8 will |
4966 * always run without a context snapshot. | 5323 * always run without a context snapshot. |
4967 */ | 5324 */ |
4968 FunctionEntryHook entry_hook; | 5325 FunctionEntryHook entry_hook; |
4969 | 5326 |
(...skipping 27 matching lines...) Expand all Loading... |
4997 * function. | 5354 * function. |
4998 */ | 5355 */ |
4999 CreateHistogramCallback create_histogram_callback; | 5356 CreateHistogramCallback create_histogram_callback; |
5000 AddHistogramSampleCallback add_histogram_sample_callback; | 5357 AddHistogramSampleCallback add_histogram_sample_callback; |
5001 | 5358 |
5002 /** | 5359 /** |
5003 * The ArrayBuffer::Allocator to use for allocating and freeing the backing | 5360 * The ArrayBuffer::Allocator to use for allocating and freeing the backing |
5004 * store of ArrayBuffers. | 5361 * store of ArrayBuffers. |
5005 */ | 5362 */ |
5006 ArrayBuffer::Allocator* array_buffer_allocator; | 5363 ArrayBuffer::Allocator* array_buffer_allocator; |
| 5364 |
| 5365 /** |
| 5366 * The ArrayBuffer::Allocator to use for allocating and freeing the backing |
| 5367 * store of SharedArrayBuffers. |
| 5368 */ |
| 5369 ArrayBuffer::Allocator* shared_array_buffer_allocator; |
5007 }; | 5370 }; |
5008 | 5371 |
5009 | 5372 |
5010 /** | 5373 /** |
5011 * Stack-allocated class which sets the isolate for all operations | 5374 * Stack-allocated class which sets the isolate for all operations |
5012 * executed within a local scope. | 5375 * executed within a local scope. |
5013 */ | 5376 */ |
5014 class V8_EXPORT Scope { | 5377 class V8_EXPORT Scope { |
5015 public: | 5378 public: |
5016 explicit Scope(Isolate* isolate) : isolate_(isolate) { | 5379 explicit Scope(Isolate* isolate) : isolate_(isolate) { |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6666 static const int kHeapObjectMapOffset = 0; | 7029 static const int kHeapObjectMapOffset = 0; |
6667 static const int kMapInstanceTypeAndBitFieldOffset = | 7030 static const int kMapInstanceTypeAndBitFieldOffset = |
6668 1 * kApiPointerSize + kApiIntSize; | 7031 1 * kApiPointerSize + kApiIntSize; |
6669 static const int kStringResourceOffset = 3 * kApiPointerSize; | 7032 static const int kStringResourceOffset = 3 * kApiPointerSize; |
6670 | 7033 |
6671 static const int kOddballKindOffset = 3 * kApiPointerSize; | 7034 static const int kOddballKindOffset = 3 * kApiPointerSize; |
6672 static const int kForeignAddressOffset = kApiPointerSize; | 7035 static const int kForeignAddressOffset = kApiPointerSize; |
6673 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; | 7036 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; |
6674 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; | 7037 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize; |
6675 static const int kContextHeaderSize = 2 * kApiPointerSize; | 7038 static const int kContextHeaderSize = 2 * kApiPointerSize; |
6676 static const int kContextEmbedderDataIndex = 77; | 7039 static const int kContextEmbedderDataIndex = 96; |
6677 static const int kFullStringRepresentationMask = 0x07; | 7040 static const int kFullStringRepresentationMask = 0x07; |
6678 static const int kStringEncodingMask = 0x4; | 7041 static const int kStringEncodingMask = 0x4; |
6679 static const int kExternalTwoByteRepresentationTag = 0x02; | 7042 static const int kExternalTwoByteRepresentationTag = 0x02; |
6680 static const int kExternalOneByteRepresentationTag = 0x06; | 7043 static const int kExternalOneByteRepresentationTag = 0x06; |
6681 | 7044 |
6682 static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; | 7045 static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize; |
6683 static const int kAmountOfExternalAllocatedMemoryOffset = | 7046 static const int kAmountOfExternalAllocatedMemoryOffset = |
6684 4 * kApiPointerSize; | 7047 4 * kApiPointerSize; |
6685 static const int kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset = | 7048 static const int kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset = |
6686 kAmountOfExternalAllocatedMemoryOffset + kApiInt64Size; | 7049 kAmountOfExternalAllocatedMemoryOffset + kApiInt64Size; |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7717 | 8080 |
7718 | 8081 |
7719 DataView* DataView::Cast(v8::Value* value) { | 8082 DataView* DataView::Cast(v8::Value* value) { |
7720 #ifdef V8_ENABLE_CHECKS | 8083 #ifdef V8_ENABLE_CHECKS |
7721 CheckCast(value); | 8084 CheckCast(value); |
7722 #endif | 8085 #endif |
7723 return static_cast<DataView*>(value); | 8086 return static_cast<DataView*>(value); |
7724 } | 8087 } |
7725 | 8088 |
7726 | 8089 |
| 8090 SharedArrayBuffer* SharedArrayBuffer::Cast(v8::Value* value) { |
| 8091 #ifdef V8_ENABLE_CHECKS |
| 8092 CheckCast(value); |
| 8093 #endif |
| 8094 return static_cast<SharedArrayBuffer*>(value); |
| 8095 } |
| 8096 |
| 8097 |
| 8098 SharedTypedArray* SharedTypedArray::Cast(v8::Value* value) { |
| 8099 #ifdef V8_ENABLE_CHECKS |
| 8100 CheckCast(value); |
| 8101 #endif |
| 8102 return static_cast<SharedTypedArray*>(value); |
| 8103 } |
| 8104 |
| 8105 |
| 8106 SharedUint8Array* SharedUint8Array::Cast(v8::Value* value) { |
| 8107 #ifdef V8_ENABLE_CHECKS |
| 8108 CheckCast(value); |
| 8109 #endif |
| 8110 return static_cast<SharedUint8Array*>(value); |
| 8111 } |
| 8112 |
| 8113 |
| 8114 SharedInt8Array* SharedInt8Array::Cast(v8::Value* value) { |
| 8115 #ifdef V8_ENABLE_CHECKS |
| 8116 CheckCast(value); |
| 8117 #endif |
| 8118 return static_cast<SharedInt8Array*>(value); |
| 8119 } |
| 8120 |
| 8121 |
| 8122 SharedUint16Array* SharedUint16Array::Cast(v8::Value* value) { |
| 8123 #ifdef V8_ENABLE_CHECKS |
| 8124 CheckCast(value); |
| 8125 #endif |
| 8126 return static_cast<SharedUint16Array*>(value); |
| 8127 } |
| 8128 |
| 8129 |
| 8130 SharedInt16Array* SharedInt16Array::Cast(v8::Value* value) { |
| 8131 #ifdef V8_ENABLE_CHECKS |
| 8132 CheckCast(value); |
| 8133 #endif |
| 8134 return static_cast<SharedInt16Array*>(value); |
| 8135 } |
| 8136 |
| 8137 |
| 8138 SharedUint32Array* SharedUint32Array::Cast(v8::Value* value) { |
| 8139 #ifdef V8_ENABLE_CHECKS |
| 8140 CheckCast(value); |
| 8141 #endif |
| 8142 return static_cast<SharedUint32Array*>(value); |
| 8143 } |
| 8144 |
| 8145 |
| 8146 SharedInt32Array* SharedInt32Array::Cast(v8::Value* value) { |
| 8147 #ifdef V8_ENABLE_CHECKS |
| 8148 CheckCast(value); |
| 8149 #endif |
| 8150 return static_cast<SharedInt32Array*>(value); |
| 8151 } |
| 8152 |
| 8153 |
| 8154 SharedFloat32Array* SharedFloat32Array::Cast(v8::Value* value) { |
| 8155 #ifdef V8_ENABLE_CHECKS |
| 8156 CheckCast(value); |
| 8157 #endif |
| 8158 return static_cast<SharedFloat32Array*>(value); |
| 8159 } |
| 8160 |
| 8161 |
| 8162 SharedFloat64Array* SharedFloat64Array::Cast(v8::Value* value) { |
| 8163 #ifdef V8_ENABLE_CHECKS |
| 8164 CheckCast(value); |
| 8165 #endif |
| 8166 return static_cast<SharedFloat64Array*>(value); |
| 8167 } |
| 8168 |
| 8169 |
| 8170 SharedUint8ClampedArray* SharedUint8ClampedArray::Cast(v8::Value* value) { |
| 8171 #ifdef V8_ENABLE_CHECKS |
| 8172 CheckCast(value); |
| 8173 #endif |
| 8174 return static_cast<SharedUint8ClampedArray*>(value); |
| 8175 } |
| 8176 |
| 8177 |
7727 Function* Function::Cast(v8::Value* value) { | 8178 Function* Function::Cast(v8::Value* value) { |
7728 #ifdef V8_ENABLE_CHECKS | 8179 #ifdef V8_ENABLE_CHECKS |
7729 CheckCast(value); | 8180 CheckCast(value); |
7730 #endif | 8181 #endif |
7731 return static_cast<Function*>(value); | 8182 return static_cast<Function*>(value); |
7732 } | 8183 } |
7733 | 8184 |
7734 | 8185 |
7735 External* External::Cast(v8::Value* value) { | 8186 External* External::Cast(v8::Value* value) { |
7736 #ifdef V8_ENABLE_CHECKS | 8187 #ifdef V8_ENABLE_CHECKS |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8022 */ | 8473 */ |
8023 | 8474 |
8024 | 8475 |
8025 } // namespace v8 | 8476 } // namespace v8 |
8026 | 8477 |
8027 | 8478 |
8028 #undef TYPE_CHECK | 8479 #undef TYPE_CHECK |
8029 | 8480 |
8030 | 8481 |
8031 #endif // V8_H_ | 8482 #endif // V8_H_ |
OLD | NEW |