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

Unified Diff: src/objects-inl.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: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 3f178c0abac12075a204d05e98b7877321b7e97b..aadf823a4a02227c0316b08ee402c0467fb810da 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3675,6 +3675,16 @@ typename Traits::ElementType FixedTypedArray<Traits>::get_scalar(int index) {
return ptr[index];
}
+
+template<> inline
+FixedTypedArray<Float64ArrayTraits>::ElementType
+ FixedTypedArray<Float64ArrayTraits>::get_scalar(int index) {
+ ASSERT((index >= 0) && (index < this->length()));
+ return READ_DOUBLE_FIELD(
+ this, FixedTypedArray<Float64ArrayTraits>::SizeFor(index));
Dmitry Lomov (no reviews) 2014/01/30 16:55:22 I am not too happy with using SizeFor here - it do
kilvadyb 2014/01/30 18:27:05 Done.
+}
+
+
template <class Traits>
void FixedTypedArray<Traits>::set(int index, ElementType value) {
ASSERT((index >= 0) && (index < this->length()));
@@ -3684,6 +3694,15 @@ void FixedTypedArray<Traits>::set(int index, ElementType value) {
}
+template<> inline
+void FixedTypedArray<Float64ArrayTraits>::set(
+ int index, Float64ArrayTraits::ElementType value) {
+ ASSERT((index >= 0) && (index < this->length()));
+ WRITE_DOUBLE_FIELD(
+ this, FixedTypedArray<Float64ArrayTraits>::SizeFor(index), value);
Dmitry Lomov (no reviews) 2014/01/30 16:55:22 Ditto
kilvadyb 2014/01/30 18:27:05 Done.
+}
+
+
template <class Traits>
MaybeObject* FixedTypedArray<Traits>::get(int index) {
return Traits::ToObject(GetHeap(), get_scalar(index));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698