| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4027 | 4027 |
| 4028 // Check if this type represents the 'int' type. | 4028 // Check if this type represents the 'int' type. |
| 4029 bool IsIntType() const; | 4029 bool IsIntType() const; |
| 4030 | 4030 |
| 4031 // Check if this type represents the 'double' type. | 4031 // Check if this type represents the 'double' type. |
| 4032 bool IsDoubleType() const; | 4032 bool IsDoubleType() const; |
| 4033 | 4033 |
| 4034 // Check if this type represents the 'Float32x4' type. | 4034 // Check if this type represents the 'Float32x4' type. |
| 4035 bool IsFloat32x4Type() const; | 4035 bool IsFloat32x4Type() const; |
| 4036 | 4036 |
| 4037 // Check if this type represents the 'Uint32x4' type. | 4037 // Check if this type represents the 'Int32x4' type. |
| 4038 bool IsUint32x4Type() const; | 4038 bool IsInt32x4Type() const; |
| 4039 | 4039 |
| 4040 // Check if this type represents the 'num' type. | 4040 // Check if this type represents the 'num' type. |
| 4041 bool IsNumberType() const; | 4041 bool IsNumberType() const; |
| 4042 | 4042 |
| 4043 // Check if this type represents the 'String' type. | 4043 // Check if this type represents the 'String' type. |
| 4044 bool IsStringType() const; | 4044 bool IsStringType() const; |
| 4045 | 4045 |
| 4046 // Check if this type represents the 'Function' type. | 4046 // Check if this type represents the 'Function' type. |
| 4047 bool IsFunctionType() const; | 4047 bool IsFunctionType() const; |
| 4048 | 4048 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4149 | 4149 |
| 4150 // The 'Mint' type. | 4150 // The 'Mint' type. |
| 4151 static RawType* MintType(); | 4151 static RawType* MintType(); |
| 4152 | 4152 |
| 4153 // The 'double' type. | 4153 // The 'double' type. |
| 4154 static RawType* Double(); | 4154 static RawType* Double(); |
| 4155 | 4155 |
| 4156 // The 'Float32x4' type. | 4156 // The 'Float32x4' type. |
| 4157 static RawType* Float32x4(); | 4157 static RawType* Float32x4(); |
| 4158 | 4158 |
| 4159 // The 'Uint32x4' type. | 4159 // The 'Int32x4' type. |
| 4160 static RawType* Uint32x4(); | 4160 static RawType* Int32x4(); |
| 4161 | 4161 |
| 4162 // The 'num' type. | 4162 // The 'num' type. |
| 4163 static RawType* Number(); | 4163 static RawType* Number(); |
| 4164 | 4164 |
| 4165 // The 'String' type. | 4165 // The 'String' type. |
| 4166 static RawType* StringType(); | 4166 static RawType* StringType(); |
| 4167 | 4167 |
| 4168 // The 'Array' type. | 4168 // The 'Array' type. |
| 4169 static RawType* ArrayType(); | 4169 static RawType* ArrayType(); |
| 4170 | 4170 |
| (...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5636 static intptr_t value_offset() { | 5636 static intptr_t value_offset() { |
| 5637 return OFFSET_OF(RawFloat32x4, value_); | 5637 return OFFSET_OF(RawFloat32x4, value_); |
| 5638 } | 5638 } |
| 5639 | 5639 |
| 5640 private: | 5640 private: |
| 5641 FINAL_HEAP_OBJECT_IMPLEMENTATION(Float32x4, Instance); | 5641 FINAL_HEAP_OBJECT_IMPLEMENTATION(Float32x4, Instance); |
| 5642 friend class Class; | 5642 friend class Class; |
| 5643 }; | 5643 }; |
| 5644 | 5644 |
| 5645 | 5645 |
| 5646 class Uint32x4 : public Instance { | 5646 class Int32x4 : public Instance { |
| 5647 public: | 5647 public: |
| 5648 static RawUint32x4* New(uint32_t value0, uint32_t value1, uint32_t value2, | 5648 static RawInt32x4* New(int32_t value0, int32_t value1, int32_t value2, |
| 5649 uint32_t value3, Heap::Space space = Heap::kNew); | 5649 int32_t value3, Heap::Space space = Heap::kNew); |
| 5650 static RawUint32x4* New(simd128_value_t value, | 5650 static RawInt32x4* New(simd128_value_t value, |
| 5651 Heap::Space space = Heap::kNew); | 5651 Heap::Space space = Heap::kNew); |
| 5652 | 5652 |
| 5653 uint32_t x() const; | 5653 int32_t x() const; |
| 5654 uint32_t y() const; | 5654 int32_t y() const; |
| 5655 uint32_t z() const; | 5655 int32_t z() const; |
| 5656 uint32_t w() const; | 5656 int32_t w() const; |
| 5657 | 5657 |
| 5658 void set_x(uint32_t x) const; | 5658 void set_x(int32_t x) const; |
| 5659 void set_y(uint32_t y) const; | 5659 void set_y(int32_t y) const; |
| 5660 void set_z(uint32_t z) const; | 5660 void set_z(int32_t z) const; |
| 5661 void set_w(uint32_t w) const; | 5661 void set_w(int32_t w) const; |
| 5662 | 5662 |
| 5663 simd128_value_t value() const; | 5663 simd128_value_t value() const; |
| 5664 void set_value(simd128_value_t value) const; | 5664 void set_value(simd128_value_t value) const; |
| 5665 | 5665 |
| 5666 static intptr_t InstanceSize() { | 5666 static intptr_t InstanceSize() { |
| 5667 return RoundedAllocationSize(sizeof(RawUint32x4)); | 5667 return RoundedAllocationSize(sizeof(RawInt32x4)); |
| 5668 } | 5668 } |
| 5669 | 5669 |
| 5670 static intptr_t value_offset() { | 5670 static intptr_t value_offset() { |
| 5671 return OFFSET_OF(RawUint32x4, value_); | 5671 return OFFSET_OF(RawInt32x4, value_); |
| 5672 } | 5672 } |
| 5673 | 5673 |
| 5674 private: | 5674 private: |
| 5675 FINAL_HEAP_OBJECT_IMPLEMENTATION(Uint32x4, Instance); | 5675 FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance); |
| 5676 friend class Class; | 5676 friend class Class; |
| 5677 }; | 5677 }; |
| 5678 | 5678 |
| 5679 | 5679 |
| 5680 class TypedData : public Instance { | 5680 class TypedData : public Instance { |
| 5681 public: | 5681 public: |
| 5682 intptr_t Length() const { | 5682 intptr_t Length() const { |
| 5683 ASSERT(!IsNull()); | 5683 ASSERT(!IsNull()); |
| 5684 return Smi::Value(raw_ptr()->length_); | 5684 return Smi::Value(raw_ptr()->length_); |
| 5685 } | 5685 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5717 TYPED_GETTER_SETTER(Uint8, uint8_t) | 5717 TYPED_GETTER_SETTER(Uint8, uint8_t) |
| 5718 TYPED_GETTER_SETTER(Int16, int16_t) | 5718 TYPED_GETTER_SETTER(Int16, int16_t) |
| 5719 TYPED_GETTER_SETTER(Uint16, uint16_t) | 5719 TYPED_GETTER_SETTER(Uint16, uint16_t) |
| 5720 TYPED_GETTER_SETTER(Int32, int32_t) | 5720 TYPED_GETTER_SETTER(Int32, int32_t) |
| 5721 TYPED_GETTER_SETTER(Uint32, uint32_t) | 5721 TYPED_GETTER_SETTER(Uint32, uint32_t) |
| 5722 TYPED_GETTER_SETTER(Int64, int64_t) | 5722 TYPED_GETTER_SETTER(Int64, int64_t) |
| 5723 TYPED_GETTER_SETTER(Uint64, uint64_t) | 5723 TYPED_GETTER_SETTER(Uint64, uint64_t) |
| 5724 TYPED_GETTER_SETTER(Float32, float) | 5724 TYPED_GETTER_SETTER(Float32, float) |
| 5725 TYPED_GETTER_SETTER(Float64, double) | 5725 TYPED_GETTER_SETTER(Float64, double) |
| 5726 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) | 5726 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) |
| 5727 TYPED_GETTER_SETTER(Uint32x4, simd128_value_t) | 5727 TYPED_GETTER_SETTER(Int32x4, simd128_value_t) |
| 5728 | 5728 |
| 5729 #undef TYPED_GETTER_SETTER | 5729 #undef TYPED_GETTER_SETTER |
| 5730 | 5730 |
| 5731 static intptr_t length_offset() { | 5731 static intptr_t length_offset() { |
| 5732 return OFFSET_OF(RawTypedData, length_); | 5732 return OFFSET_OF(RawTypedData, length_); |
| 5733 } | 5733 } |
| 5734 | 5734 |
| 5735 static intptr_t data_offset() { | 5735 static intptr_t data_offset() { |
| 5736 return OFFSET_OF(RawTypedData, data_); | 5736 return OFFSET_OF(RawTypedData, data_); |
| 5737 } | 5737 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5851 TYPED_GETTER_SETTER(Uint8, uint8_t) | 5851 TYPED_GETTER_SETTER(Uint8, uint8_t) |
| 5852 TYPED_GETTER_SETTER(Int16, int16_t) | 5852 TYPED_GETTER_SETTER(Int16, int16_t) |
| 5853 TYPED_GETTER_SETTER(Uint16, uint16_t) | 5853 TYPED_GETTER_SETTER(Uint16, uint16_t) |
| 5854 TYPED_GETTER_SETTER(Int32, int32_t) | 5854 TYPED_GETTER_SETTER(Int32, int32_t) |
| 5855 TYPED_GETTER_SETTER(Uint32, uint32_t) | 5855 TYPED_GETTER_SETTER(Uint32, uint32_t) |
| 5856 TYPED_GETTER_SETTER(Int64, int64_t) | 5856 TYPED_GETTER_SETTER(Int64, int64_t) |
| 5857 TYPED_GETTER_SETTER(Uint64, uint64_t) | 5857 TYPED_GETTER_SETTER(Uint64, uint64_t) |
| 5858 TYPED_GETTER_SETTER(Float32, float) | 5858 TYPED_GETTER_SETTER(Float32, float) |
| 5859 TYPED_GETTER_SETTER(Float64, double) | 5859 TYPED_GETTER_SETTER(Float64, double) |
| 5860 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) | 5860 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) |
| 5861 TYPED_GETTER_SETTER(Uint32x4, simd128_value_t); | 5861 TYPED_GETTER_SETTER(Int32x4, simd128_value_t); |
| 5862 | 5862 |
| 5863 #undef TYPED_GETTER_SETTER | 5863 #undef TYPED_GETTER_SETTER |
| 5864 | 5864 |
| 5865 FinalizablePersistentHandle* AddFinalizer( | 5865 FinalizablePersistentHandle* AddFinalizer( |
| 5866 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; | 5866 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; |
| 5867 | 5867 |
| 5868 static intptr_t length_offset() { | 5868 static intptr_t length_offset() { |
| 5869 return OFFSET_OF(RawExternalTypedData, length_); | 5869 return OFFSET_OF(RawExternalTypedData, length_); |
| 5870 } | 5870 } |
| 5871 | 5871 |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6373 | 6373 |
| 6374 | 6374 |
| 6375 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6375 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6376 intptr_t index) { | 6376 intptr_t index) { |
| 6377 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6377 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6378 } | 6378 } |
| 6379 | 6379 |
| 6380 } // namespace dart | 6380 } // namespace dart |
| 6381 | 6381 |
| 6382 #endif // VM_OBJECT_H_ | 6382 #endif // VM_OBJECT_H_ |
| OLD | NEW |