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 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 ElementsKind to_kind); | 2784 ElementsKind to_kind); |
2785 | 2785 |
2786 // Used from Object::GetProperty(). | 2786 // Used from Object::GetProperty(). |
2787 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( | 2787 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( |
2788 Handle<JSObject> object, | 2788 Handle<JSObject> object, |
2789 Handle<Object> receiver, | 2789 Handle<Object> receiver, |
2790 LookupResult* result, | 2790 LookupResult* result, |
2791 Handle<Name> name, | 2791 Handle<Name> name, |
2792 PropertyAttributes* attributes); | 2792 PropertyAttributes* attributes); |
2793 | 2793 |
| 2794 MUST_USE_RESULT static Handle<Object> GetElementWithCallback( |
| 2795 Handle<JSObject> object, |
| 2796 Handle<Object> receiver, |
| 2797 Handle<Object> structure, |
| 2798 uint32_t index, |
| 2799 Handle<Object> holder); |
| 2800 |
2794 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, | 2801 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, |
2795 Object* structure, | 2802 Object* structure, |
2796 uint32_t index, | 2803 uint32_t index, |
2797 Object* holder); | 2804 Object* holder); |
2798 static PropertyAttributes GetElementAttributeWithInterceptor( | 2805 static PropertyAttributes GetElementAttributeWithInterceptor( |
2799 Handle<JSObject> object, | 2806 Handle<JSObject> object, |
2800 Handle<JSReceiver> receiver, | 2807 Handle<JSReceiver> receiver, |
2801 uint32_t index, | 2808 uint32_t index, |
2802 bool continue_search); | 2809 bool continue_search); |
2803 static PropertyAttributes GetElementAttributeWithoutInterceptor( | 2810 static PropertyAttributes GetElementAttributeWithoutInterceptor( |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3029 | 3036 |
3030 class FixedDoubleArray; | 3037 class FixedDoubleArray; |
3031 class IncrementalMarking; | 3038 class IncrementalMarking; |
3032 | 3039 |
3033 | 3040 |
3034 // FixedArray describes fixed-sized arrays with element type Object*. | 3041 // FixedArray describes fixed-sized arrays with element type Object*. |
3035 class FixedArray: public FixedArrayBase { | 3042 class FixedArray: public FixedArrayBase { |
3036 public: | 3043 public: |
3037 // Setter and getter for elements. | 3044 // Setter and getter for elements. |
3038 inline Object* get(int index); | 3045 inline Object* get(int index); |
| 3046 static inline Handle<Object> get(Handle<FixedArray> array, int index); |
3039 // Setter that uses write barrier. | 3047 // Setter that uses write barrier. |
3040 inline void set(int index, Object* value); | 3048 inline void set(int index, Object* value); |
3041 inline bool is_the_hole(int index); | 3049 inline bool is_the_hole(int index); |
3042 | 3050 |
3043 // Setter that doesn't need write barrier. | 3051 // Setter that doesn't need write barrier. |
3044 inline void set(int index, Smi* value); | 3052 inline void set(int index, Smi* value); |
3045 // Setter with explicit barrier mode. | 3053 // Setter with explicit barrier mode. |
3046 inline void set(int index, Object* value, WriteBarrierMode mode); | 3054 inline void set(int index, Object* value, WriteBarrierMode mode); |
3047 | 3055 |
3048 // Setters for frequently used oddballs located in old space. | 3056 // Setters for frequently used oddballs located in old space. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3145 }; | 3153 }; |
3146 | 3154 |
3147 | 3155 |
3148 // FixedDoubleArray describes fixed-sized arrays with element type double. | 3156 // FixedDoubleArray describes fixed-sized arrays with element type double. |
3149 class FixedDoubleArray: public FixedArrayBase { | 3157 class FixedDoubleArray: public FixedArrayBase { |
3150 public: | 3158 public: |
3151 // Setter and getter for elements. | 3159 // Setter and getter for elements. |
3152 inline double get_scalar(int index); | 3160 inline double get_scalar(int index); |
3153 inline int64_t get_representation(int index); | 3161 inline int64_t get_representation(int index); |
3154 MUST_USE_RESULT inline MaybeObject* get(int index); | 3162 MUST_USE_RESULT inline MaybeObject* get(int index); |
3155 // TODO(ishell): Rename as get() once all usages handlified. | 3163 static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index); |
3156 inline Handle<Object> get_as_handle(int index); | |
3157 inline void set(int index, double value); | 3164 inline void set(int index, double value); |
3158 inline void set_the_hole(int index); | 3165 inline void set_the_hole(int index); |
3159 | 3166 |
3160 // Checking for the hole. | 3167 // Checking for the hole. |
3161 inline bool is_the_hole(int index); | 3168 inline bool is_the_hole(int index); |
3162 | 3169 |
3163 // Copy operations | 3170 // Copy operations |
3164 MUST_USE_RESULT inline MaybeObject* Copy(); | 3171 MUST_USE_RESULT inline MaybeObject* Copy(); |
3165 | 3172 |
3166 // Garbage collection support. | 3173 // Garbage collection support. |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4885 // http://www.whatwg.org/specs/web-apps/current-work/ | 4892 // http://www.whatwg.org/specs/web-apps/current-work/ |
4886 // multipage/the-canvas-element.html#canvaspixelarray | 4893 // multipage/the-canvas-element.html#canvaspixelarray |
4887 // In particular, write access clamps the value written to 0 or 255 if the | 4894 // In particular, write access clamps the value written to 0 or 255 if the |
4888 // value written is outside this range. | 4895 // value written is outside this range. |
4889 class ExternalUint8ClampedArray: public ExternalArray { | 4896 class ExternalUint8ClampedArray: public ExternalArray { |
4890 public: | 4897 public: |
4891 inline uint8_t* external_uint8_clamped_pointer(); | 4898 inline uint8_t* external_uint8_clamped_pointer(); |
4892 | 4899 |
4893 // Setter and getter. | 4900 // Setter and getter. |
4894 inline uint8_t get_scalar(int index); | 4901 inline uint8_t get_scalar(int index); |
4895 MUST_USE_RESULT inline MaybeObject* get(int index); | 4902 MUST_USE_RESULT inline Object* get(int index); |
| 4903 static inline Handle<Object> get(Handle<ExternalUint8ClampedArray> array, |
| 4904 int index); |
4896 inline void set(int index, uint8_t value); | 4905 inline void set(int index, uint8_t value); |
4897 | 4906 |
4898 // This accessor applies the correct conversion from Smi, HeapNumber and | 4907 // This accessor applies the correct conversion from Smi, HeapNumber and |
4899 // undefined and clamps the converted value between 0 and 255. | 4908 // undefined and clamps the converted value between 0 and 255. |
4900 Object* SetValue(uint32_t index, Object* value); | 4909 Object* SetValue(uint32_t index, Object* value); |
4901 | 4910 |
4902 static Handle<Object> SetValue(Handle<ExternalUint8ClampedArray> array, | 4911 static Handle<Object> SetValue(Handle<ExternalUint8ClampedArray> array, |
4903 uint32_t index, | 4912 uint32_t index, |
4904 Handle<Object> value); | 4913 Handle<Object> value); |
4905 | 4914 |
4906 // Casting. | 4915 // Casting. |
4907 static inline ExternalUint8ClampedArray* cast(Object* obj); | 4916 static inline ExternalUint8ClampedArray* cast(Object* obj); |
4908 | 4917 |
4909 // Dispatched behavior. | 4918 // Dispatched behavior. |
4910 DECLARE_PRINTER(ExternalUint8ClampedArray) | 4919 DECLARE_PRINTER(ExternalUint8ClampedArray) |
4911 DECLARE_VERIFIER(ExternalUint8ClampedArray) | 4920 DECLARE_VERIFIER(ExternalUint8ClampedArray) |
4912 | 4921 |
4913 private: | 4922 private: |
4914 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8ClampedArray); | 4923 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8ClampedArray); |
4915 }; | 4924 }; |
4916 | 4925 |
4917 | 4926 |
4918 class ExternalInt8Array: public ExternalArray { | 4927 class ExternalInt8Array: public ExternalArray { |
4919 public: | 4928 public: |
4920 // Setter and getter. | 4929 // Setter and getter. |
4921 inline int8_t get_scalar(int index); | 4930 inline int8_t get_scalar(int index); |
4922 MUST_USE_RESULT inline MaybeObject* get(int index); | 4931 MUST_USE_RESULT inline Object* get(int index); |
| 4932 static inline Handle<Object> get(Handle<ExternalInt8Array> array, int index); |
4923 inline void set(int index, int8_t value); | 4933 inline void set(int index, int8_t value); |
4924 | 4934 |
4925 static Handle<Object> SetValue(Handle<ExternalInt8Array> array, | 4935 static Handle<Object> SetValue(Handle<ExternalInt8Array> array, |
4926 uint32_t index, | 4936 uint32_t index, |
4927 Handle<Object> value); | 4937 Handle<Object> value); |
4928 | 4938 |
4929 // This accessor applies the correct conversion from Smi, HeapNumber | 4939 // This accessor applies the correct conversion from Smi, HeapNumber |
4930 // and undefined. | 4940 // and undefined. |
4931 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 4941 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
4932 | 4942 |
4933 // Casting. | 4943 // Casting. |
4934 static inline ExternalInt8Array* cast(Object* obj); | 4944 static inline ExternalInt8Array* cast(Object* obj); |
4935 | 4945 |
4936 // Dispatched behavior. | 4946 // Dispatched behavior. |
4937 DECLARE_PRINTER(ExternalInt8Array) | 4947 DECLARE_PRINTER(ExternalInt8Array) |
4938 DECLARE_VERIFIER(ExternalInt8Array) | 4948 DECLARE_VERIFIER(ExternalInt8Array) |
4939 | 4949 |
4940 private: | 4950 private: |
4941 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt8Array); | 4951 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt8Array); |
4942 }; | 4952 }; |
4943 | 4953 |
4944 | 4954 |
4945 class ExternalUint8Array: public ExternalArray { | 4955 class ExternalUint8Array: public ExternalArray { |
4946 public: | 4956 public: |
4947 // Setter and getter. | 4957 // Setter and getter. |
4948 inline uint8_t get_scalar(int index); | 4958 inline uint8_t get_scalar(int index); |
4949 MUST_USE_RESULT inline MaybeObject* get(int index); | 4959 MUST_USE_RESULT inline Object* get(int index); |
| 4960 static inline Handle<Object> get(Handle<ExternalUint8Array> array, int index); |
4950 inline void set(int index, uint8_t value); | 4961 inline void set(int index, uint8_t value); |
4951 | 4962 |
4952 static Handle<Object> SetValue(Handle<ExternalUint8Array> array, | 4963 static Handle<Object> SetValue(Handle<ExternalUint8Array> array, |
4953 uint32_t index, | 4964 uint32_t index, |
4954 Handle<Object> value); | 4965 Handle<Object> value); |
4955 | 4966 |
4956 // This accessor applies the correct conversion from Smi, HeapNumber | 4967 // This accessor applies the correct conversion from Smi, HeapNumber |
4957 // and undefined. | 4968 // and undefined. |
4958 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 4969 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
4959 | 4970 |
4960 // Casting. | 4971 // Casting. |
4961 static inline ExternalUint8Array* cast(Object* obj); | 4972 static inline ExternalUint8Array* cast(Object* obj); |
4962 | 4973 |
4963 // Dispatched behavior. | 4974 // Dispatched behavior. |
4964 DECLARE_PRINTER(ExternalUint8Array) | 4975 DECLARE_PRINTER(ExternalUint8Array) |
4965 DECLARE_VERIFIER(ExternalUint8Array) | 4976 DECLARE_VERIFIER(ExternalUint8Array) |
4966 | 4977 |
4967 private: | 4978 private: |
4968 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8Array); | 4979 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8Array); |
4969 }; | 4980 }; |
4970 | 4981 |
4971 | 4982 |
4972 class ExternalInt16Array: public ExternalArray { | 4983 class ExternalInt16Array: public ExternalArray { |
4973 public: | 4984 public: |
4974 // Setter and getter. | 4985 // Setter and getter. |
4975 inline int16_t get_scalar(int index); | 4986 inline int16_t get_scalar(int index); |
4976 MUST_USE_RESULT inline MaybeObject* get(int index); | 4987 MUST_USE_RESULT inline Object* get(int index); |
| 4988 static inline Handle<Object> get(Handle<ExternalInt16Array> array, int index); |
4977 inline void set(int index, int16_t value); | 4989 inline void set(int index, int16_t value); |
4978 | 4990 |
4979 static Handle<Object> SetValue(Handle<ExternalInt16Array> array, | 4991 static Handle<Object> SetValue(Handle<ExternalInt16Array> array, |
4980 uint32_t index, | 4992 uint32_t index, |
4981 Handle<Object> value); | 4993 Handle<Object> value); |
4982 | 4994 |
4983 // This accessor applies the correct conversion from Smi, HeapNumber | 4995 // This accessor applies the correct conversion from Smi, HeapNumber |
4984 // and undefined. | 4996 // and undefined. |
4985 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 4997 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
4986 | 4998 |
4987 // Casting. | 4999 // Casting. |
4988 static inline ExternalInt16Array* cast(Object* obj); | 5000 static inline ExternalInt16Array* cast(Object* obj); |
4989 | 5001 |
4990 // Dispatched behavior. | 5002 // Dispatched behavior. |
4991 DECLARE_PRINTER(ExternalInt16Array) | 5003 DECLARE_PRINTER(ExternalInt16Array) |
4992 DECLARE_VERIFIER(ExternalInt16Array) | 5004 DECLARE_VERIFIER(ExternalInt16Array) |
4993 | 5005 |
4994 private: | 5006 private: |
4995 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt16Array); | 5007 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt16Array); |
4996 }; | 5008 }; |
4997 | 5009 |
4998 | 5010 |
4999 class ExternalUint16Array: public ExternalArray { | 5011 class ExternalUint16Array: public ExternalArray { |
5000 public: | 5012 public: |
5001 // Setter and getter. | 5013 // Setter and getter. |
5002 inline uint16_t get_scalar(int index); | 5014 inline uint16_t get_scalar(int index); |
5003 MUST_USE_RESULT inline MaybeObject* get(int index); | 5015 MUST_USE_RESULT inline Object* get(int index); |
| 5016 static inline Handle<Object> get(Handle<ExternalUint16Array> array, |
| 5017 int index); |
5004 inline void set(int index, uint16_t value); | 5018 inline void set(int index, uint16_t value); |
5005 | 5019 |
5006 static Handle<Object> SetValue(Handle<ExternalUint16Array> array, | 5020 static Handle<Object> SetValue(Handle<ExternalUint16Array> array, |
5007 uint32_t index, | 5021 uint32_t index, |
5008 Handle<Object> value); | 5022 Handle<Object> value); |
5009 | 5023 |
5010 // This accessor applies the correct conversion from Smi, HeapNumber | 5024 // This accessor applies the correct conversion from Smi, HeapNumber |
5011 // and undefined. | 5025 // and undefined. |
5012 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5026 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5013 | 5027 |
5014 // Casting. | 5028 // Casting. |
5015 static inline ExternalUint16Array* cast(Object* obj); | 5029 static inline ExternalUint16Array* cast(Object* obj); |
5016 | 5030 |
5017 // Dispatched behavior. | 5031 // Dispatched behavior. |
5018 DECLARE_PRINTER(ExternalUint16Array) | 5032 DECLARE_PRINTER(ExternalUint16Array) |
5019 DECLARE_VERIFIER(ExternalUint16Array) | 5033 DECLARE_VERIFIER(ExternalUint16Array) |
5020 | 5034 |
5021 private: | 5035 private: |
5022 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint16Array); | 5036 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint16Array); |
5023 }; | 5037 }; |
5024 | 5038 |
5025 | 5039 |
5026 class ExternalInt32Array: public ExternalArray { | 5040 class ExternalInt32Array: public ExternalArray { |
5027 public: | 5041 public: |
5028 // Setter and getter. | 5042 // Setter and getter. |
5029 inline int32_t get_scalar(int index); | 5043 inline int32_t get_scalar(int index); |
5030 MUST_USE_RESULT inline MaybeObject* get(int index); | 5044 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 5045 static inline Handle<Object> get(Handle<ExternalInt32Array> array, int index); |
5031 inline void set(int index, int32_t value); | 5046 inline void set(int index, int32_t value); |
5032 | 5047 |
5033 static Handle<Object> SetValue(Handle<ExternalInt32Array> array, | 5048 static Handle<Object> SetValue(Handle<ExternalInt32Array> array, |
5034 uint32_t index, | 5049 uint32_t index, |
5035 Handle<Object> value); | 5050 Handle<Object> value); |
5036 | 5051 |
5037 // This accessor applies the correct conversion from Smi, HeapNumber | 5052 // This accessor applies the correct conversion from Smi, HeapNumber |
5038 // and undefined. | 5053 // and undefined. |
5039 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5054 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5040 | 5055 |
5041 // Casting. | 5056 // Casting. |
5042 static inline ExternalInt32Array* cast(Object* obj); | 5057 static inline ExternalInt32Array* cast(Object* obj); |
5043 | 5058 |
5044 // Dispatched behavior. | 5059 // Dispatched behavior. |
5045 DECLARE_PRINTER(ExternalInt32Array) | 5060 DECLARE_PRINTER(ExternalInt32Array) |
5046 DECLARE_VERIFIER(ExternalInt32Array) | 5061 DECLARE_VERIFIER(ExternalInt32Array) |
5047 | 5062 |
5048 private: | 5063 private: |
5049 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt32Array); | 5064 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt32Array); |
5050 }; | 5065 }; |
5051 | 5066 |
5052 | 5067 |
5053 class ExternalUint32Array: public ExternalArray { | 5068 class ExternalUint32Array: public ExternalArray { |
5054 public: | 5069 public: |
5055 // Setter and getter. | 5070 // Setter and getter. |
5056 inline uint32_t get_scalar(int index); | 5071 inline uint32_t get_scalar(int index); |
5057 MUST_USE_RESULT inline MaybeObject* get(int index); | 5072 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 5073 static inline Handle<Object> get(Handle<ExternalUint32Array> array, |
| 5074 int index); |
5058 inline void set(int index, uint32_t value); | 5075 inline void set(int index, uint32_t value); |
5059 | 5076 |
5060 static Handle<Object> SetValue(Handle<ExternalUint32Array> array, | 5077 static Handle<Object> SetValue(Handle<ExternalUint32Array> array, |
5061 uint32_t index, | 5078 uint32_t index, |
5062 Handle<Object> value); | 5079 Handle<Object> value); |
5063 | 5080 |
5064 // This accessor applies the correct conversion from Smi, HeapNumber | 5081 // This accessor applies the correct conversion from Smi, HeapNumber |
5065 // and undefined. | 5082 // and undefined. |
5066 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5083 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5067 | 5084 |
5068 // Casting. | 5085 // Casting. |
5069 static inline ExternalUint32Array* cast(Object* obj); | 5086 static inline ExternalUint32Array* cast(Object* obj); |
5070 | 5087 |
5071 // Dispatched behavior. | 5088 // Dispatched behavior. |
5072 DECLARE_PRINTER(ExternalUint32Array) | 5089 DECLARE_PRINTER(ExternalUint32Array) |
5073 DECLARE_VERIFIER(ExternalUint32Array) | 5090 DECLARE_VERIFIER(ExternalUint32Array) |
5074 | 5091 |
5075 private: | 5092 private: |
5076 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint32Array); | 5093 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint32Array); |
5077 }; | 5094 }; |
5078 | 5095 |
5079 | 5096 |
5080 class ExternalFloat32Array: public ExternalArray { | 5097 class ExternalFloat32Array: public ExternalArray { |
5081 public: | 5098 public: |
5082 // Setter and getter. | 5099 // Setter and getter. |
5083 inline float get_scalar(int index); | 5100 inline float get_scalar(int index); |
5084 MUST_USE_RESULT inline MaybeObject* get(int index); | 5101 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 5102 static inline Handle<Object> get(Handle<ExternalFloat32Array> array, |
| 5103 int index); |
5085 inline void set(int index, float value); | 5104 inline void set(int index, float value); |
5086 | 5105 |
5087 static Handle<Object> SetValue(Handle<ExternalFloat32Array> array, | 5106 static Handle<Object> SetValue(Handle<ExternalFloat32Array> array, |
5088 uint32_t index, | 5107 uint32_t index, |
5089 Handle<Object> value); | 5108 Handle<Object> value); |
5090 | 5109 |
5091 // This accessor applies the correct conversion from Smi, HeapNumber | 5110 // This accessor applies the correct conversion from Smi, HeapNumber |
5092 // and undefined. | 5111 // and undefined. |
5093 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5112 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5094 | 5113 |
5095 // Casting. | 5114 // Casting. |
5096 static inline ExternalFloat32Array* cast(Object* obj); | 5115 static inline ExternalFloat32Array* cast(Object* obj); |
5097 | 5116 |
5098 // Dispatched behavior. | 5117 // Dispatched behavior. |
5099 DECLARE_PRINTER(ExternalFloat32Array) | 5118 DECLARE_PRINTER(ExternalFloat32Array) |
5100 DECLARE_VERIFIER(ExternalFloat32Array) | 5119 DECLARE_VERIFIER(ExternalFloat32Array) |
5101 | 5120 |
5102 private: | 5121 private: |
5103 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat32Array); | 5122 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat32Array); |
5104 }; | 5123 }; |
5105 | 5124 |
5106 | 5125 |
5107 class ExternalFloat64Array: public ExternalArray { | 5126 class ExternalFloat64Array: public ExternalArray { |
5108 public: | 5127 public: |
5109 // Setter and getter. | 5128 // Setter and getter. |
5110 inline double get_scalar(int index); | 5129 inline double get_scalar(int index); |
5111 MUST_USE_RESULT inline MaybeObject* get(int index); | 5130 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 5131 static inline Handle<Object> get(Handle<ExternalFloat64Array> array, |
| 5132 int index); |
5112 inline void set(int index, double value); | 5133 inline void set(int index, double value); |
5113 | 5134 |
5114 static Handle<Object> SetValue(Handle<ExternalFloat64Array> array, | 5135 static Handle<Object> SetValue(Handle<ExternalFloat64Array> array, |
5115 uint32_t index, | 5136 uint32_t index, |
5116 Handle<Object> value); | 5137 Handle<Object> value); |
5117 | 5138 |
5118 // This accessor applies the correct conversion from Smi, HeapNumber | 5139 // This accessor applies the correct conversion from Smi, HeapNumber |
5119 // and undefined. | 5140 // and undefined. |
5120 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5141 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5121 | 5142 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5162 static inline int ElementOffset(int index) { | 5183 static inline int ElementOffset(int index) { |
5163 return kDataOffset + index * sizeof(ElementType); | 5184 return kDataOffset + index * sizeof(ElementType); |
5164 } | 5185 } |
5165 | 5186 |
5166 static inline int SizeFor(int length) { | 5187 static inline int SizeFor(int length) { |
5167 return ElementOffset(length); | 5188 return ElementOffset(length); |
5168 } | 5189 } |
5169 | 5190 |
5170 inline ElementType get_scalar(int index); | 5191 inline ElementType get_scalar(int index); |
5171 MUST_USE_RESULT inline MaybeObject* get(int index); | 5192 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 5193 static inline Handle<Object> get(Handle<FixedTypedArray> array, int index); |
5172 inline void set(int index, ElementType value); | 5194 inline void set(int index, ElementType value); |
5173 | 5195 |
5174 static inline ElementType from_int(int value); | 5196 static inline ElementType from_int(int value); |
5175 static inline ElementType from_double(double value); | 5197 static inline ElementType from_double(double value); |
5176 | 5198 |
5177 // This accessor applies the correct conversion from Smi, HeapNumber | 5199 // This accessor applies the correct conversion from Smi, HeapNumber |
5178 // and undefined. | 5200 // and undefined. |
5179 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 5201 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
5180 | 5202 |
5181 static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array, | 5203 static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array, |
5182 uint32_t index, | 5204 uint32_t index, |
5183 Handle<Object> value); | 5205 Handle<Object> value); |
5184 | 5206 |
5185 DECLARE_PRINTER(FixedTypedArray) | 5207 DECLARE_PRINTER(FixedTypedArray) |
5186 DECLARE_VERIFIER(FixedTypedArray) | 5208 DECLARE_VERIFIER(FixedTypedArray) |
5187 | 5209 |
5188 private: | 5210 private: |
5189 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); | 5211 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); |
5190 }; | 5212 }; |
5191 | 5213 |
5192 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ | 5214 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ |
5193 class Type##ArrayTraits { \ | 5215 class Type##ArrayTraits { \ |
5194 public: \ | 5216 public: \ |
5195 typedef elementType ElementType; \ | 5217 typedef elementType ElementType; \ |
5196 static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ | 5218 static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ |
5197 static const char* Designator() { return #type " array"; } \ | 5219 static const char* Designator() { return #type " array"; } \ |
5198 static inline MaybeObject* ToObject(Heap* heap, elementType scalar); \ | 5220 static inline MaybeObject* ToObject(Heap* heap, elementType scalar); \ |
| 5221 static inline Handle<Object> ToHandle(Isolate* isolate, \ |
| 5222 elementType scalar); \ |
5199 static inline elementType defaultValue(); \ | 5223 static inline elementType defaultValue(); \ |
5200 }; \ | 5224 }; \ |
5201 \ | 5225 \ |
5202 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; | 5226 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; |
5203 | 5227 |
5204 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) | 5228 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) |
5205 | 5229 |
5206 #undef FIXED_TYPED_ARRAY_TRAITS | 5230 #undef FIXED_TYPED_ARRAY_TRAITS |
5207 | 5231 |
5208 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 5232 // DeoptimizationInputData is a fixed array used to hold the deoptimization |
(...skipping 5771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10980 } else { | 11004 } else { |
10981 value &= ~(1 << bit_position); | 11005 value &= ~(1 << bit_position); |
10982 } | 11006 } |
10983 return value; | 11007 return value; |
10984 } | 11008 } |
10985 }; | 11009 }; |
10986 | 11010 |
10987 } } // namespace v8::internal | 11011 } } // namespace v8::internal |
10988 | 11012 |
10989 #endif // V8_OBJECTS_H_ | 11013 #endif // V8_OBJECTS_H_ |
OLD | NEW |