OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef SRC_WASM_ASM_TYPES_H_ | 5 #ifndef SRC_WASM_ASM_TYPES_H_ |
6 #define SRC_WASM_ASM_TYPES_H_ | 6 #define SRC_WASM_ASM_TYPES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <type_traits> | 9 #include <type_traits> |
10 | 10 |
(...skipping 29 matching lines...) Loading... | |
40 V(Float, "float", 13, kAsmFloatQ) \ | 40 V(Float, "float", 13, kAsmFloatQ) \ |
41 /* Types used for expressing the Heap accesses. */ \ | 41 /* Types used for expressing the Heap accesses. */ \ |
42 V(Uint8Array, "Uint8Array", 14, kAsmHeap) \ | 42 V(Uint8Array, "Uint8Array", 14, kAsmHeap) \ |
43 V(Int8Array, "Int8Array", 15, kAsmHeap) \ | 43 V(Int8Array, "Int8Array", 15, kAsmHeap) \ |
44 V(Uint16Array, "Uint16Array", 16, kAsmHeap) \ | 44 V(Uint16Array, "Uint16Array", 16, kAsmHeap) \ |
45 V(Int16Array, "Int16Array", 17, kAsmHeap) \ | 45 V(Int16Array, "Int16Array", 17, kAsmHeap) \ |
46 V(Uint32Array, "Uint32Array", 18, kAsmHeap) \ | 46 V(Uint32Array, "Uint32Array", 18, kAsmHeap) \ |
47 V(Int32Array, "Int32Array", 19, kAsmHeap) \ | 47 V(Int32Array, "Int32Array", 19, kAsmHeap) \ |
48 V(Float32Array, "Float32Array", 20, kAsmHeap) \ | 48 V(Float32Array, "Float32Array", 20, kAsmHeap) \ |
49 V(Float64Array, "Float64Array", 21, kAsmHeap) \ | 49 V(Float64Array, "Float64Array", 21, kAsmHeap) \ |
50 V(FloatishDoubleQ, "floatish|double?", 22, kAsmFloatish | kAsmDoubleQ) \ | 50 V(Uint8ClampedArray, "Uint8CampledArray", 22, kAsmHeap) \ |
bradnelson
2016/06/13 22:42:10
Campled -> Clamped
However, I believe this one is
John
2016/06/14 14:55:02
But Campled is moar nice. :)
Anyway, I removed re
| |
51 V(FloatQDoubleQ, "float?|double?", 23, kAsmFloatQ | kAsmDoubleQ) \ | 51 /* Pseudo-types used in representing heap access for fp types.*/ \ |
52 V(FloatishDoubleQ, "floatish|double?", 23, kAsmFloatish | kAsmDoubleQ) \ | |
53 V(FloatQDoubleQ, "float?|double?", 24, kAsmFloatQ | kAsmDoubleQ) \ | |
52 /* None is used to represent errors in the type checker. */ \ | 54 /* None is used to represent errors in the type checker. */ \ |
53 V(None, "<none>", 31, 0) | 55 V(None, "<none>", 31, 0) |
54 | 56 |
55 // List of V(CamelName) | 57 // List of V(CamelName) |
56 #define FOR_EACH_ASM_CALLABLE_TYPE_LIST(V) \ | 58 #define FOR_EACH_ASM_CALLABLE_TYPE_LIST(V) \ |
57 V(FunctionType) \ | 59 V(FunctionType) \ |
58 V(OverloadedFunctionType) | 60 V(OverloadedFunctionType) |
59 | 61 |
60 class AsmValueType { | 62 class AsmValueType { |
61 public: | 63 public: |
(...skipping 131 matching lines...) Loading... | |
193 } | 195 } |
194 | 196 |
195 // Overloaded function types. Not creatable by asm source, but useful to | 197 // Overloaded function types. Not creatable by asm source, but useful to |
196 // represent the overloaded stdlib functions. | 198 // represent the overloaded stdlib functions. |
197 static AsmType* OverloadedFunction(Zone* zone) { | 199 static AsmType* OverloadedFunction(Zone* zone) { |
198 auto* f = new (zone) AsmOverloadedFunctionType(zone); | 200 auto* f = new (zone) AsmOverloadedFunctionType(zone); |
199 return reinterpret_cast<AsmType*>(f); | 201 return reinterpret_cast<AsmType*>(f); |
200 } | 202 } |
201 | 203 |
202 // The type for fround(src). | 204 // The type for fround(src). |
203 static AsmType* FroundType(Zone* zone, AsmType* src); | 205 static AsmType* FroundType(Zone* zone); |
204 | 206 |
205 // The (variadic) type for min and max. | 207 // The (variadic) type for min and max. |
206 static AsmType* MinMaxType(Zone* zone, AsmType* type); | 208 static AsmType* MinMaxType(Zone* zone, AsmType* dest, AsmType* src); |
207 | 209 |
208 std::string Name(); | 210 std::string Name(); |
209 // IsExactly returns true if this is the exact same type as that. For | 211 // IsExactly returns true if this is the exact same type as that. For |
210 // non-value types (e.g., callables), this returns this == that. | 212 // non-value types (e.g., callables), this returns this == that. |
211 bool IsExactly(AsmType* that); | 213 bool IsExactly(AsmType* that); |
212 // IsA is used to query whether this is an instance of that (i.e., if this is | 214 // IsA is used to query whether this is an instance of that (i.e., if this is |
213 // a type derived from that.) For non-value types (e.g., callables), this | 215 // a type derived from that.) For non-value types (e.g., callables), this |
214 // returns this == that. | 216 // returns this == that. |
215 bool IsA(AsmType* that); | 217 bool IsA(AsmType* that); |
216 | 218 |
(...skipping 29 matching lines...) Loading... | |
246 // Returns the store type if this is a heap type. AsmType::None is returned if | 248 // Returns the store type if this is a heap type. AsmType::None is returned if |
247 // this is not a heap type. | 249 // this is not a heap type. |
248 AsmType* StoreType(); | 250 AsmType* StoreType(); |
249 }; | 251 }; |
250 | 252 |
251 } // namespace wasm | 253 } // namespace wasm |
252 } // namespace internal | 254 } // namespace internal |
253 } // namespace v8 | 255 } // namespace v8 |
254 | 256 |
255 #endif // SRC_WASM_ASM_TYPES_H_ | 257 #endif // SRC_WASM_ASM_TYPES_H_ |
OLD | NEW |