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

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 6881003: Prevent deopt when assigning double values to typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes to make ia32 tests run Created 9 years, 8 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 Register scratch, 230 Register scratch,
231 Label* fail); 231 Label* fail);
232 232
233 // The contents of the scratch register will be overwritten. 233 // The contents of the scratch register will be overwritten.
234 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail); 234 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail);
235 235
236 // FCmp is similar to integer cmp, but requires unsigned 236 // FCmp is similar to integer cmp, but requires unsigned
237 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). 237 // jcc instructions (je, ja, jae, jb, jbe, je, and jz).
238 void FCmp(); 238 void FCmp();
239 239
240 void ClampUInt8(Register reg) {
241 NearLabel done;
242 test(reg, Immediate(0xFFFFFF00));
243 j(zero, &done);
244 setcc(negative, reg); // 1 if negative, 0 if positive.
245 dec_b(reg); // 0 if negative, 255 if positive.
246 bind(&done);
247 }
248
249 void ClampDoubleToUInt8(XMMRegister input_reg, Register result_reg) {
250 NearLabel above_zero;
251 NearLabel done;
252 NearLabel in_bounds;
253 ExternalReference zero = ExternalReference::address_of_zero();
254 movdbl(xmm0, Operand::StaticVariable(zero));
255 ucomisd(input_reg, xmm0);
256 j(above, &above_zero);
257 Set(result_reg, Immediate(0));
258 jmp(&done);
259 bind(&above_zero);
260 ExternalReference uint8_max_value =
261 ExternalReference::address_of_uint8_max_value();
262 movdbl(xmm0, Operand::StaticVariable(uint8_max_value));
263 ucomisd(input_reg, xmm0);
264 j(below_equal, &in_bounds);
265 Set(result_reg, Immediate(255));
266 jmp(&done);
267 bind(&in_bounds);
268 ExternalReference one_half =
269 ExternalReference::address_of_one_half();
270 movdbl(xmm0, Operand::StaticVariable(one_half));
271 addsd(input_reg, xmm0);
272 cvttsd2si(result_reg, Operand(input_reg));
273 bind(&done);
274 }
275
240 // Smi tagging support. 276 // Smi tagging support.
241 void SmiTag(Register reg) { 277 void SmiTag(Register reg) {
242 ASSERT(kSmiTag == 0); 278 ASSERT(kSmiTag == 0);
243 ASSERT(kSmiTagSize == 1); 279 ASSERT(kSmiTagSize == 1);
244 add(reg, Operand(reg)); 280 add(reg, Operand(reg));
245 } 281 }
246 void SmiUntag(Register reg) { 282 void SmiUntag(Register reg) {
247 sar(reg, kSmiTagSize); 283 sar(reg, kSmiTagSize);
248 } 284 }
249 285
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 } \ 831 } \
796 masm-> 832 masm->
797 #else 833 #else
798 #define ACCESS_MASM(masm) masm-> 834 #define ACCESS_MASM(masm) masm->
799 #endif 835 #endif
800 836
801 837
802 } } // namespace v8::internal 838 } } // namespace v8::internal
803 839
804 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 840 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« src/hydrogen.cc ('K') | « src/ia32/lithium-ia32.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698