Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Side by Side Diff: runtime/vm/object.h

Issue 148043003: Add Float64x2, Float64x2List, etc... with runtime and dart2js implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5921 matching lines...) Expand 10 before | Expand all | Expand 10 after
5932 static intptr_t value_offset() { 5932 static intptr_t value_offset() {
5933 return OFFSET_OF(RawInt32x4, value_); 5933 return OFFSET_OF(RawInt32x4, value_);
5934 } 5934 }
5935 5935
5936 private: 5936 private:
5937 FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance); 5937 FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance);
5938 friend class Class; 5938 friend class Class;
5939 }; 5939 };
5940 5940
5941 5941
5942 class Float64x2 : public Instance {
5943 public:
5944 static RawFloat64x2* New(double value0, double value1,
5945 Heap::Space space = Heap::kNew);
5946 static RawFloat64x2* New(simd128_value_t value,
5947 Heap::Space space = Heap::kNew);
5948
5949 double x() const;
5950 double y() const;
5951
5952 void set_x(double x) const;
5953 void set_y(double y) const;
5954
5955 simd128_value_t value() const;
5956 void set_value(simd128_value_t value) const;
5957
5958 static intptr_t InstanceSize() {
5959 return RoundedAllocationSize(sizeof(RawFloat64x2));
5960 }
5961
5962 static intptr_t value_offset() {
5963 return OFFSET_OF(RawFloat64x2, value_);
5964 }
5965
5966 private:
5967 FINAL_HEAP_OBJECT_IMPLEMENTATION(Float64x2, Instance);
5968 friend class Class;
5969 };
5970
5971
5942 class TypedData : public Instance { 5972 class TypedData : public Instance {
5943 public: 5973 public:
5944 intptr_t Length() const { 5974 intptr_t Length() const {
5945 ASSERT(!IsNull()); 5975 ASSERT(!IsNull());
5946 return Smi::Value(raw_ptr()->length_); 5976 return Smi::Value(raw_ptr()->length_);
5947 } 5977 }
5948 5978
5949 intptr_t ElementSizeInBytes() const { 5979 intptr_t ElementSizeInBytes() const {
5950 intptr_t cid = raw()->GetClassId(); 5980 intptr_t cid = raw()->GetClassId();
5951 return ElementSizeInBytes(cid); 5981 return ElementSizeInBytes(cid);
(...skipping 28 matching lines...) Expand all
5980 TYPED_GETTER_SETTER(Int16, int16_t) 6010 TYPED_GETTER_SETTER(Int16, int16_t)
5981 TYPED_GETTER_SETTER(Uint16, uint16_t) 6011 TYPED_GETTER_SETTER(Uint16, uint16_t)
5982 TYPED_GETTER_SETTER(Int32, int32_t) 6012 TYPED_GETTER_SETTER(Int32, int32_t)
5983 TYPED_GETTER_SETTER(Uint32, uint32_t) 6013 TYPED_GETTER_SETTER(Uint32, uint32_t)
5984 TYPED_GETTER_SETTER(Int64, int64_t) 6014 TYPED_GETTER_SETTER(Int64, int64_t)
5985 TYPED_GETTER_SETTER(Uint64, uint64_t) 6015 TYPED_GETTER_SETTER(Uint64, uint64_t)
5986 TYPED_GETTER_SETTER(Float32, float) 6016 TYPED_GETTER_SETTER(Float32, float)
5987 TYPED_GETTER_SETTER(Float64, double) 6017 TYPED_GETTER_SETTER(Float64, double)
5988 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) 6018 TYPED_GETTER_SETTER(Float32x4, simd128_value_t)
5989 TYPED_GETTER_SETTER(Int32x4, simd128_value_t) 6019 TYPED_GETTER_SETTER(Int32x4, simd128_value_t)
6020 TYPED_GETTER_SETTER(Float64x2, simd128_value_t)
5990 6021
5991 #undef TYPED_GETTER_SETTER 6022 #undef TYPED_GETTER_SETTER
5992 6023
5993 static intptr_t length_offset() { 6024 static intptr_t length_offset() {
5994 return OFFSET_OF(RawTypedData, length_); 6025 return OFFSET_OF(RawTypedData, length_);
5995 } 6026 }
5996 6027
5997 static intptr_t data_offset() { 6028 static intptr_t data_offset() {
5998 return OFFSET_OF(RawTypedData, data_); 6029 return OFFSET_OF(RawTypedData, data_);
5999 } 6030 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
6109 TYPED_GETTER_SETTER(Uint8, uint8_t) 6140 TYPED_GETTER_SETTER(Uint8, uint8_t)
6110 TYPED_GETTER_SETTER(Int16, int16_t) 6141 TYPED_GETTER_SETTER(Int16, int16_t)
6111 TYPED_GETTER_SETTER(Uint16, uint16_t) 6142 TYPED_GETTER_SETTER(Uint16, uint16_t)
6112 TYPED_GETTER_SETTER(Int32, int32_t) 6143 TYPED_GETTER_SETTER(Int32, int32_t)
6113 TYPED_GETTER_SETTER(Uint32, uint32_t) 6144 TYPED_GETTER_SETTER(Uint32, uint32_t)
6114 TYPED_GETTER_SETTER(Int64, int64_t) 6145 TYPED_GETTER_SETTER(Int64, int64_t)
6115 TYPED_GETTER_SETTER(Uint64, uint64_t) 6146 TYPED_GETTER_SETTER(Uint64, uint64_t)
6116 TYPED_GETTER_SETTER(Float32, float) 6147 TYPED_GETTER_SETTER(Float32, float)
6117 TYPED_GETTER_SETTER(Float64, double) 6148 TYPED_GETTER_SETTER(Float64, double)
6118 TYPED_GETTER_SETTER(Float32x4, simd128_value_t) 6149 TYPED_GETTER_SETTER(Float32x4, simd128_value_t)
6119 TYPED_GETTER_SETTER(Int32x4, simd128_value_t); 6150 TYPED_GETTER_SETTER(Int32x4, simd128_value_t)
6151 TYPED_GETTER_SETTER(Float64x2, simd128_value_t)
6120 6152
6121 #undef TYPED_GETTER_SETTER 6153 #undef TYPED_GETTER_SETTER
6122 6154
6123 FinalizablePersistentHandle* AddFinalizer( 6155 FinalizablePersistentHandle* AddFinalizer(
6124 void* peer, Dart_WeakPersistentHandleFinalizer callback) const; 6156 void* peer, Dart_WeakPersistentHandleFinalizer callback) const;
6125 6157
6126 static intptr_t length_offset() { 6158 static intptr_t length_offset() {
6127 return OFFSET_OF(RawExternalTypedData, length_); 6159 return OFFSET_OF(RawExternalTypedData, length_);
6128 } 6160 }
6129 6161
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
6628 6660
6629 6661
6630 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6662 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6631 intptr_t index) { 6663 intptr_t index) {
6632 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6664 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6633 } 6665 }
6634 6666
6635 } // namespace dart 6667 } // namespace dart
6636 6668
6637 #endif // VM_OBJECT_H_ 6669 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698