Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4892 typedef typename Traits::ElementType ElementType; | 4892 typedef typename Traits::ElementType ElementType; |
| 4893 static const InstanceType kInstanceType = Traits::kInstanceType; | 4893 static const InstanceType kInstanceType = Traits::kInstanceType; |
| 4894 | 4894 |
| 4895 // Casting: | 4895 // Casting: |
| 4896 static inline FixedTypedArray<Traits>* cast(Object* obj); | 4896 static inline FixedTypedArray<Traits>* cast(Object* obj); |
| 4897 | 4897 |
| 4898 static inline int SizeFor(int length) { | 4898 static inline int SizeFor(int length) { |
| 4899 return kDataOffset + length * sizeof(ElementType); | 4899 return kDataOffset + length * sizeof(ElementType); |
| 4900 } | 4900 } |
| 4901 | 4901 |
| 4902 static inline int ElementOffset(int index) { | |
| 4903 return SizeFor(index); | |
|
Dmitry Lomov (no reviews)
2014/01/30 18:34:03
Please express them the other way round, i.e. Size
kilvadyb
2014/01/30 19:24:52
Done.
| |
| 4904 } | |
| 4905 | |
| 4902 inline ElementType get_scalar(int index); | 4906 inline ElementType get_scalar(int index); |
| 4903 MUST_USE_RESULT inline MaybeObject* get(int index); | 4907 MUST_USE_RESULT inline MaybeObject* get(int index); |
| 4904 inline void set(int index, ElementType value); | 4908 inline void set(int index, ElementType value); |
| 4905 | 4909 |
| 4906 // This accessor applies the correct conversion from Smi, HeapNumber | 4910 // This accessor applies the correct conversion from Smi, HeapNumber |
| 4907 // and undefined. | 4911 // and undefined. |
| 4908 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 4912 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
| 4909 | 4913 |
| 4910 static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array, | 4914 static Handle<Object> SetValue(Handle<FixedTypedArray<Traits> > array, |
| 4911 uint32_t index, | 4915 uint32_t index, |
| (...skipping 5855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10767 } else { | 10771 } else { |
| 10768 value &= ~(1 << bit_position); | 10772 value &= ~(1 << bit_position); |
| 10769 } | 10773 } |
| 10770 return value; | 10774 return value; |
| 10771 } | 10775 } |
| 10772 }; | 10776 }; |
| 10773 | 10777 |
| 10774 } } // namespace v8::internal | 10778 } } // namespace v8::internal |
| 10775 | 10779 |
| 10776 #endif // V8_OBJECTS_H_ | 10780 #endif // V8_OBJECTS_H_ |
| OLD | NEW |