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

Side by Side Diff: src/objects-inl.h

Issue 344203005: MIPS: Make object accessors more const-correct. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 #define READ_DOUBLE_FIELD(p, offset) \ 1168 #define READ_DOUBLE_FIELD(p, offset) \
1169 (*reinterpret_cast<const double*>(FIELD_ADDR_CONST(p, offset))) 1169 (*reinterpret_cast<const double*>(FIELD_ADDR_CONST(p, offset)))
1170 #else // V8_TARGET_ARCH_MIPS 1170 #else // V8_TARGET_ARCH_MIPS
1171 // Prevent gcc from using load-double (mips ldc1) on (possibly) 1171 // Prevent gcc from using load-double (mips ldc1) on (possibly)
1172 // non-64-bit aligned HeapNumber::value. 1172 // non-64-bit aligned HeapNumber::value.
1173 static inline double read_double_field(const void* p, int offset) { 1173 static inline double read_double_field(const void* p, int offset) {
1174 union conversion { 1174 union conversion {
1175 double d; 1175 double d;
1176 uint32_t u[2]; 1176 uint32_t u[2];
1177 } c; 1177 } c;
1178 c.u[0] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR_CONST(p, offset))); 1178 c.u[0] = (*reinterpret_cast<const uint32_t*>(
1179 c.u[1] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR_CONST(p, offset + 4))); 1179 FIELD_ADDR_CONST(p, offset)));
1180 c.u[1] = (*reinterpret_cast<const uint32_t*>(
1181 FIELD_ADDR_CONST(p, offset + 4)));
1180 return c.d; 1182 return c.d;
1181 } 1183 }
1182 #define READ_DOUBLE_FIELD(p, offset) read_double_field(p, offset) 1184 #define READ_DOUBLE_FIELD(p, offset) read_double_field(p, offset)
1183 #endif // V8_TARGET_ARCH_MIPS 1185 #endif // V8_TARGET_ARCH_MIPS
1184 1186
1185 #ifndef V8_TARGET_ARCH_MIPS 1187 #ifndef V8_TARGET_ARCH_MIPS
1186 #define WRITE_DOUBLE_FIELD(p, offset, value) \ 1188 #define WRITE_DOUBLE_FIELD(p, offset, value) \
1187 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) 1189 (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value)
1188 #else // V8_TARGET_ARCH_MIPS 1190 #else // V8_TARGET_ARCH_MIPS
1189 // Prevent gcc from using store-double (mips sdc1) on (possibly) 1191 // Prevent gcc from using store-double (mips sdc1) on (possibly)
(...skipping 5803 matching lines...) Expand 10 before | Expand all | Expand 10 after
6993 #undef READ_SHORT_FIELD 6995 #undef READ_SHORT_FIELD
6994 #undef WRITE_SHORT_FIELD 6996 #undef WRITE_SHORT_FIELD
6995 #undef READ_BYTE_FIELD 6997 #undef READ_BYTE_FIELD
6996 #undef WRITE_BYTE_FIELD 6998 #undef WRITE_BYTE_FIELD
6997 #undef NOBARRIER_READ_BYTE_FIELD 6999 #undef NOBARRIER_READ_BYTE_FIELD
6998 #undef NOBARRIER_WRITE_BYTE_FIELD 7000 #undef NOBARRIER_WRITE_BYTE_FIELD
6999 7001
7000 } } // namespace v8::internal 7002 } } // namespace v8::internal
7001 7003
7002 #endif // V8_OBJECTS_INL_H_ 7004 #endif // V8_OBJECTS_INL_H_
OLDNEW
« 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