Chromium Code Reviews| 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 5928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5939 static intptr_t value_offset() { | 5939 static intptr_t value_offset() { |
| 5940 return OFFSET_OF(RawInt32x4, value_); | 5940 return OFFSET_OF(RawInt32x4, value_); |
| 5941 } | 5941 } |
| 5942 | 5942 |
| 5943 private: | 5943 private: |
| 5944 FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance); | 5944 FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance); |
| 5945 friend class Class; | 5945 friend class Class; |
| 5946 }; | 5946 }; |
| 5947 | 5947 |
| 5948 | 5948 |
| 5949 class Float64x2 : public Instance { | |
| 5950 public: | |
| 5951 static RawFloat64x2* New(double value0, double value1, | |
| 5952 Heap::Space space = Heap::kNew); | |
| 5953 static RawFloat64x2* New(simd128_value_t value, | |
| 5954 Heap::Space space = Heap::kNew); | |
|
srdjan
2014/01/29 23:49:42
Fix indent.
Cutch
2014/01/30 18:27:27
Done.
| |
| 5955 | |
| 5956 double x() const; | |
| 5957 double y() const; | |
| 5958 | |
| 5959 void set_x(double x) const; | |
| 5960 void set_y(double y) const; | |
| 5961 | |
| 5962 simd128_value_t value() const; | |
| 5963 void set_value(simd128_value_t value) const; | |
| 5964 | |
| 5965 static intptr_t InstanceSize() { | |
| 5966 return RoundedAllocationSize(sizeof(RawFloat64x2)); | |
| 5967 } | |
| 5968 | |
| 5969 static intptr_t value_offset() { | |
| 5970 return OFFSET_OF(RawFloat64x2, value_); | |
| 5971 } | |
| 5972 | |
| 5973 private: | |
| 5974 FINAL_HEAP_OBJECT_IMPLEMENTATION(Float64x2, Instance); | |
| 5975 friend class Class; | |
| 5976 }; | |
| 5977 | |
| 5978 | |
| 5949 class TypedData : public Instance { | 5979 class TypedData : public Instance { |
| 5950 public: | 5980 public: |
| 5951 intptr_t Length() const { | 5981 intptr_t Length() const { |
| 5952 ASSERT(!IsNull()); | 5982 ASSERT(!IsNull()); |
| 5953 return Smi::Value(raw_ptr()->length_); | 5983 return Smi::Value(raw_ptr()->length_); |
| 5954 } | 5984 } |
| 5955 | 5985 |
| 5956 intptr_t ElementSizeInBytes() const { | 5986 intptr_t ElementSizeInBytes() const { |
| 5957 intptr_t cid = raw()->GetClassId(); | 5987 intptr_t cid = raw()->GetClassId(); |
| 5958 return ElementSizeInBytes(cid); | 5988 return ElementSizeInBytes(cid); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 5987 TYPED_GETTER_SETTER(Int16, int16_t) | 6017 TYPED_GETTER_SETTER(Int16, int16_t) |
| 5988 TYPED_GETTER_SETTER(Uint16, uint16_t) | 6018 TYPED_GETTER_SETTER(Uint16, uint16_t) |
| 5989 TYPED_GETTER_SETTER(Int32, int32_t) | 6019 TYPED_GETTER_SETTER(Int32, int32_t) |
| 5990 TYPED_GETTER_SETTER(Uint32, uint32_t) | 6020 TYPED_GETTER_SETTER(Uint32, uint32_t) |
| 5991 TYPED_GETTER_SETTER(Int64, int64_t) | 6021 TYPED_GETTER_SETTER(Int64, int64_t) |
| 5992 TYPED_GETTER_SETTER(Uint64, uint64_t) | 6022 TYPED_GETTER_SETTER(Uint64, uint64_t) |
| 5993 TYPED_GETTER_SETTER(Float32, float) | 6023 TYPED_GETTER_SETTER(Float32, float) |
| 5994 TYPED_GETTER_SETTER(Float64, double) | 6024 TYPED_GETTER_SETTER(Float64, double) |
| 5995 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) | 6025 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) |
| 5996 TYPED_GETTER_SETTER(Int32x4, simd128_value_t) | 6026 TYPED_GETTER_SETTER(Int32x4, simd128_value_t) |
| 6027 TYPED_GETTER_SETTER(Float64x2, simd128_value_t) | |
| 5997 | 6028 |
| 5998 #undef TYPED_GETTER_SETTER | 6029 #undef TYPED_GETTER_SETTER |
| 5999 | 6030 |
| 6000 static intptr_t length_offset() { | 6031 static intptr_t length_offset() { |
| 6001 return OFFSET_OF(RawTypedData, length_); | 6032 return OFFSET_OF(RawTypedData, length_); |
| 6002 } | 6033 } |
| 6003 | 6034 |
| 6004 static intptr_t data_offset() { | 6035 static intptr_t data_offset() { |
| 6005 return OFFSET_OF(RawTypedData, data_); | 6036 return OFFSET_OF(RawTypedData, data_); |
| 6006 } | 6037 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6116 TYPED_GETTER_SETTER(Uint8, uint8_t) | 6147 TYPED_GETTER_SETTER(Uint8, uint8_t) |
| 6117 TYPED_GETTER_SETTER(Int16, int16_t) | 6148 TYPED_GETTER_SETTER(Int16, int16_t) |
| 6118 TYPED_GETTER_SETTER(Uint16, uint16_t) | 6149 TYPED_GETTER_SETTER(Uint16, uint16_t) |
| 6119 TYPED_GETTER_SETTER(Int32, int32_t) | 6150 TYPED_GETTER_SETTER(Int32, int32_t) |
| 6120 TYPED_GETTER_SETTER(Uint32, uint32_t) | 6151 TYPED_GETTER_SETTER(Uint32, uint32_t) |
| 6121 TYPED_GETTER_SETTER(Int64, int64_t) | 6152 TYPED_GETTER_SETTER(Int64, int64_t) |
| 6122 TYPED_GETTER_SETTER(Uint64, uint64_t) | 6153 TYPED_GETTER_SETTER(Uint64, uint64_t) |
| 6123 TYPED_GETTER_SETTER(Float32, float) | 6154 TYPED_GETTER_SETTER(Float32, float) |
| 6124 TYPED_GETTER_SETTER(Float64, double) | 6155 TYPED_GETTER_SETTER(Float64, double) |
| 6125 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) | 6156 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) |
| 6126 TYPED_GETTER_SETTER(Int32x4, simd128_value_t); | 6157 TYPED_GETTER_SETTER(Int32x4, simd128_value_t) |
| 6158 TYPED_GETTER_SETTER(Float64x2, simd128_value_t) | |
| 6127 | 6159 |
| 6128 #undef TYPED_GETTER_SETTER | 6160 #undef TYPED_GETTER_SETTER |
| 6129 | 6161 |
| 6130 FinalizablePersistentHandle* AddFinalizer( | 6162 FinalizablePersistentHandle* AddFinalizer( |
| 6131 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; | 6163 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; |
| 6132 | 6164 |
| 6133 static intptr_t length_offset() { | 6165 static intptr_t length_offset() { |
| 6134 return OFFSET_OF(RawExternalTypedData, length_); | 6166 return OFFSET_OF(RawExternalTypedData, length_); |
| 6135 } | 6167 } |
| 6136 | 6168 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6635 | 6667 |
| 6636 | 6668 |
| 6637 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6669 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6638 intptr_t index) { | 6670 intptr_t index) { |
| 6639 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6671 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6640 } | 6672 } |
| 6641 | 6673 |
| 6642 } // namespace dart | 6674 } // namespace dart |
| 6643 | 6675 |
| 6644 #endif // VM_OBJECT_H_ | 6676 #endif // VM_OBJECT_H_ |
| OLD | NEW |