Reviewers: danno, Paul Lind, kisg, palfia, dusmil, Jakob, Dmitry Lomov
(chromium),
Description:
MIPS: Specialize FixedTypedArray<> set and get functions to solve unaligned
double access.
BUG=
TEST=test-api/FixedFloat64Array
Please review this at https://codereview.chromium.org/136333011/
SVN Base: https://github.com/v8/v8.git@gbl
Affected files (+19, -0 lines):
M src/objects-inl.h
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));
+}
+
+
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);
+}
+
+
template <class Traits>
MaybeObject* FixedTypedArray<Traits>::get(int index) {
return Traits::ToObject(GetHeap(), get_scalar(index));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.