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

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

Issue 6709022: Re-establish mips basic infrastructure. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 9 years, 9 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 1183
1184 void HeapObject::ClearOverflow() { 1184 void HeapObject::ClearOverflow() {
1185 ASSERT(IsOverflowed()); 1185 ASSERT(IsOverflowed());
1186 MapWord first_word = map_word(); 1186 MapWord first_word = map_word();
1187 first_word.ClearOverflow(); 1187 first_word.ClearOverflow();
1188 set_map_word(first_word); 1188 set_map_word(first_word);
1189 } 1189 }
1190 1190
1191 1191
1192 double HeapNumber::value() { 1192 double HeapNumber::value() {
1193 #ifndef V8_TARGET_ARCH_MIPS
1193 return READ_DOUBLE_FIELD(this, kValueOffset); 1194 return READ_DOUBLE_FIELD(this, kValueOffset);
1195 #else // V8_TARGET_ARCH_MIPS
Søren Thygesen Gjesse 2011/03/21 16:05:19 I think this should be put into the macro READ_DOU
Paul Lind 2011/03/23 01:55:43 The code has been moved to the READ_DOUBLE_FIELD m
1196 // Prevent gcc from using load-double (mips ldc1) on (possibly)
1197 // non-64-bit aligned HeapNumber::value.
1198 union conversion {
1199 double d;
1200 uint32_t u[2];
1201 } c;
1202 c.u[0] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset)));
1203 c.u[1] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset + 4)));
1204 return c.d;
1205 #endif // V8_TARGET_ARCH_MIPS
1194 } 1206 }
1195 1207
1196 1208
1197 void HeapNumber::set_value(double value) { 1209 void HeapNumber::set_value(double value) {
1210 #ifndef V8_TARGET_ARCH_MIPS
1198 WRITE_DOUBLE_FIELD(this, kValueOffset, value); 1211 WRITE_DOUBLE_FIELD(this, kValueOffset, value);
1212 #else // V8_TARGET_ARCH_MIPS
Søren Thygesen Gjesse 2011/03/21 16:05:19 Ditto.
Paul Lind 2011/03/23 01:55:43 This one could have been implemented as pure macro
1213 // Prevent gcc from using store-double (mips sdc1) on (possibly)
1214 // non-64-bit aligned HeapNumber::value.
1215 union conversion {
1216 double d;
1217 uint32_t u[2];
1218 } c;
1219 c.d = value;
1220 (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset))) = c.u[0];
1221 (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset + 4))) = c.u[1];
1222 #endif // V8_TARGET_ARCH_MIPS
1199 } 1223 }
1200 1224
1201 1225
1202 int HeapNumber::get_exponent() { 1226 int HeapNumber::get_exponent() {
1203 return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >> 1227 return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >>
1204 kExponentShift) - kExponentBias; 1228 kExponentShift) - kExponentBias;
1205 } 1229 }
1206 1230
1207 1231
1208 int HeapNumber::get_sign() { 1232 int HeapNumber::get_sign() {
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 #undef WRITE_INT_FIELD 3960 #undef WRITE_INT_FIELD
3937 #undef READ_SHORT_FIELD 3961 #undef READ_SHORT_FIELD
3938 #undef WRITE_SHORT_FIELD 3962 #undef WRITE_SHORT_FIELD
3939 #undef READ_BYTE_FIELD 3963 #undef READ_BYTE_FIELD
3940 #undef WRITE_BYTE_FIELD 3964 #undef WRITE_BYTE_FIELD
3941 3965
3942 3966
3943 } } // namespace v8::internal 3967 } } // namespace v8::internal
3944 3968
3945 #endif // V8_OBJECTS_INL_H_ 3969 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/mips/disasm-mips.cc ('K') | « src/mips/virtual-frame-mips-inl.h ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698