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

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

Issue 7191007: Cleanup: use JumpIf[Not]Smi() whenever we can (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 // Modifies the register even if it does not contain a Smi! 283 // Modifies the register even if it does not contain a Smi!
284 void SmiUntag(Register reg, Label* is_smi) { 284 void SmiUntag(Register reg, Label* is_smi) {
285 ASSERT(kSmiTagSize == 1); 285 ASSERT(kSmiTagSize == 1);
286 sar(reg, kSmiTagSize); 286 sar(reg, kSmiTagSize);
287 ASSERT(kSmiTag == 0); 287 ASSERT(kSmiTag == 0);
288 j(not_carry, is_smi); 288 j(not_carry, is_smi);
289 } 289 }
290 290
291 // Jump the register contains a smi. 291 // Jump the register contains a smi.
292 inline void JumpIfSmi(Register value, Label* smi_label) { 292 inline void JumpIfSmi(Register value,
293 Label* smi_label,
294 Label::Distance distance = Label::kFar) {
293 test(value, Immediate(kSmiTagMask)); 295 test(value, Immediate(kSmiTagMask));
294 j(zero, smi_label); 296 j(zero, smi_label, distance);
295 } 297 }
296 // Jump if register contain a non-smi. 298 // Jump if register contain a non-smi.
297 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { 299 inline void JumpIfNotSmi(Register value,
300 Label* not_smi_label,
301 Label::Distance distance = Label::kFar) {
298 test(value, Immediate(kSmiTagMask)); 302 test(value, Immediate(kSmiTagMask));
299 j(not_zero, not_smi_label); 303 j(not_zero, not_smi_label, distance);
300 } 304 }
301 305
302 void LoadInstanceDescriptors(Register map, Register descriptors); 306 void LoadInstanceDescriptors(Register map, Register descriptors);
303 307
304 void LoadPowerOf2(XMMRegister dst, Register scratch, int power); 308 void LoadPowerOf2(XMMRegister dst, Register scratch, int power);
305 309
306 // Abort execution if argument is not a number. Used in debug code. 310 // Abort execution if argument is not a number. Used in debug code.
307 void AbortIfNotNumber(Register object); 311 void AbortIfNotNumber(Register object);
308 312
309 // Abort execution if argument is not a smi. Used in debug code. 313 // Abort execution if argument is not a smi. Used in debug code.
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 } \ 780 } \
777 masm-> 781 masm->
778 #else 782 #else
779 #define ACCESS_MASM(masm) masm-> 783 #define ACCESS_MASM(masm) masm->
780 #endif 784 #endif
781 785
782 786
783 } } // namespace v8::internal 787 } } // namespace v8::internal
784 788
785 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 789 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698