OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 4773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4784 inline int DataSize(InstanceType type); | 4784 inline int DataSize(InstanceType type); |
4785 | 4785 |
4786 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArrayBase); | 4786 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArrayBase); |
4787 }; | 4787 }; |
4788 | 4788 |
4789 | 4789 |
4790 template <class Traits> | 4790 template <class Traits> |
4791 class FixedTypedArray: public FixedTypedArrayBase { | 4791 class FixedTypedArray: public FixedTypedArrayBase { |
4792 public: | 4792 public: |
4793 typedef typename Traits::ElementType ElementType; | 4793 typedef typename Traits::ElementType ElementType; |
4794 static const InstanceType kInstanceType = Traits::kInstanceType; | 4794 enum { kInstanceType = Traits::kInstanceType }; |
4795 | 4795 |
4796 DECLARE_CAST(FixedTypedArray<Traits>) | 4796 DECLARE_CAST(FixedTypedArray<Traits>) |
4797 | 4797 |
4798 static inline int ElementOffset(int index) { | 4798 static inline int ElementOffset(int index) { |
4799 return kDataOffset + index * sizeof(ElementType); | 4799 return kDataOffset + index * sizeof(ElementType); |
4800 } | 4800 } |
4801 | 4801 |
4802 static inline int SizeFor(int length) { | 4802 static inline int SizeFor(int length) { |
4803 return ElementOffset(length); | 4803 return ElementOffset(length); |
4804 } | 4804 } |
(...skipping 11 matching lines...) Expand all Loading... |
4816 uint32_t index, | 4816 uint32_t index, |
4817 Handle<Object> value); | 4817 Handle<Object> value); |
4818 | 4818 |
4819 DECLARE_PRINTER(FixedTypedArray) | 4819 DECLARE_PRINTER(FixedTypedArray) |
4820 DECLARE_VERIFIER(FixedTypedArray) | 4820 DECLARE_VERIFIER(FixedTypedArray) |
4821 | 4821 |
4822 private: | 4822 private: |
4823 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); | 4823 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); |
4824 }; | 4824 }; |
4825 | 4825 |
4826 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ | 4826 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ |
4827 class Type##ArrayTraits { \ | 4827 class Type##ArrayTraits { \ |
4828 public: /* NOLINT */ \ | 4828 public: /* NOLINT */ \ |
4829 typedef elementType ElementType; \ | 4829 typedef elementType ElementType; \ |
4830 static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ | 4830 enum { kInstanceType = FIXED_##TYPE##_ARRAY_TYPE }; \ |
4831 static const char* Designator() { return #type " array"; } \ | 4831 static const char* Designator() { return #type " array"; } \ |
4832 static inline Handle<Object> ToHandle(Isolate* isolate, \ | 4832 static inline Handle<Object> ToHandle(Isolate* isolate, \ |
4833 elementType scalar); \ | 4833 elementType scalar); \ |
4834 static inline elementType defaultValue(); \ | 4834 static inline elementType defaultValue(); \ |
4835 }; \ | 4835 }; \ |
4836 \ | 4836 \ |
4837 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; | 4837 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; |
4838 | 4838 |
4839 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) | 4839 TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) |
4840 | 4840 |
4841 #undef FIXED_TYPED_ARRAY_TRAITS | 4841 #undef FIXED_TYPED_ARRAY_TRAITS |
4842 | 4842 |
4843 | 4843 |
4844 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 4844 // DeoptimizationInputData is a fixed array used to hold the deoptimization |
4845 // data for code generated by the Hydrogen/Lithium compiler. It also | 4845 // data for code generated by the Hydrogen/Lithium compiler. It also |
4846 // contains information about functions that were inlined. If N different | 4846 // contains information about functions that were inlined. If N different |
(...skipping 6125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10972 } else { | 10972 } else { |
10973 value &= ~(1 << bit_position); | 10973 value &= ~(1 << bit_position); |
10974 } | 10974 } |
10975 return value; | 10975 return value; |
10976 } | 10976 } |
10977 }; | 10977 }; |
10978 | 10978 |
10979 } } // namespace v8::internal | 10979 } } // namespace v8::internal |
10980 | 10980 |
10981 #endif // V8_OBJECTS_H_ | 10981 #endif // V8_OBJECTS_H_ |
OLD | NEW |