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

Side by Side Diff: src/objects.h

Issue 136333011: MIPS: Specialize FixedTypedArray<> set and get functions to solve unaligned double access. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: small fix 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
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4888 4888
4889 template <class Traits> 4889 template <class Traits>
4890 class FixedTypedArray: public FixedTypedArrayBase { 4890 class FixedTypedArray: public FixedTypedArrayBase {
4891 public: 4891 public:
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 ElementOffset(int index) {
4899 return kDataOffset + index * sizeof(ElementType);
4900 }
4901
4898 static inline int SizeFor(int length) { 4902 static inline int SizeFor(int length) {
4899 return kDataOffset + length * sizeof(ElementType); 4903 return ElementOffset(length);
4900 } 4904 }
4901 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
(...skipping 5857 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698