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

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: small fix 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 | « src/objects.h ('k') | 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..1ea9441b7e5b3507f37075f87f862fdb53639d32 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3675,6 +3675,15 @@ 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, ElementOffset(index));
+}
+
+
template <class Traits>
void FixedTypedArray<Traits>::set(int index, ElementType value) {
ASSERT((index >= 0) && (index < this->length()));
@@ -3684,6 +3693,14 @@ 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, ElementOffset(index), value);
+}
+
+
template <class Traits>
MaybeObject* FixedTypedArray<Traits>::get(int index) {
return Traits::ToObject(GetHeap(), get_scalar(index));
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698