OLD | NEW |
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 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #include "assembler.h" | 8 #include "assembler.h" |
9 #include "frames.h" | 9 #include "frames.h" |
10 #include "globals.h" | 10 #include "globals.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 | 491 |
492 void LoadInstanceDescriptors(Register map, Register descriptors); | 492 void LoadInstanceDescriptors(Register map, Register descriptors); |
493 void EnumLength(Register dst, Register map); | 493 void EnumLength(Register dst, Register map); |
494 void NumberOfOwnDescriptors(Register dst, Register map); | 494 void NumberOfOwnDescriptors(Register dst, Register map); |
495 | 495 |
496 template<typename Field> | 496 template<typename Field> |
497 void DecodeField(Register reg) { | 497 void DecodeField(Register reg) { |
498 static const int shift = Field::kShift; | 498 static const int shift = Field::kShift; |
499 static const int mask = Field::kMask >> Field::kShift; | 499 static const int mask = Field::kMask >> Field::kShift; |
500 sar(reg, shift); | 500 if (shift != 0) { |
| 501 sar(reg, shift); |
| 502 } |
501 and_(reg, Immediate(mask)); | 503 and_(reg, Immediate(mask)); |
502 } | 504 } |
| 505 |
| 506 template<typename Field> |
| 507 void DecodeFieldToSmi(Register reg) { |
| 508 static const int shift = Field::kShift; |
| 509 static const int mask = (Field::kMask >> Field::kShift) << kSmiTagSize; |
| 510 STATIC_ASSERT((mask & (0x80000000u >> (kSmiTagSize - 1))) == 0); |
| 511 STATIC_ASSERT(kSmiTag == 0); |
| 512 if (shift < kSmiTagSize) { |
| 513 shl(reg, kSmiTagSize - shift); |
| 514 } else if (shift > kSmiTagSize) { |
| 515 sar(reg, shift - kSmiTagSize); |
| 516 } |
| 517 and_(reg, Immediate(mask)); |
| 518 } |
| 519 |
503 void LoadPowerOf2(XMMRegister dst, Register scratch, int power); | 520 void LoadPowerOf2(XMMRegister dst, Register scratch, int power); |
504 | 521 |
505 // Abort execution if argument is not a number, enabled via --debug-code. | 522 // Abort execution if argument is not a number, enabled via --debug-code. |
506 void AssertNumber(Register object); | 523 void AssertNumber(Register object); |
507 | 524 |
508 // Abort execution if argument is not a smi, enabled via --debug-code. | 525 // Abort execution if argument is not a smi, enabled via --debug-code. |
509 void AssertSmi(Register object); | 526 void AssertSmi(Register object); |
510 | 527 |
511 // Abort execution if argument is a smi, enabled via --debug-code. | 528 // Abort execution if argument is a smi, enabled via --debug-code. |
512 void AssertNotSmi(Register object); | 529 void AssertNotSmi(Register object); |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } \ | 1100 } \ |
1084 masm-> | 1101 masm-> |
1085 #else | 1102 #else |
1086 #define ACCESS_MASM(masm) masm-> | 1103 #define ACCESS_MASM(masm) masm-> |
1087 #endif | 1104 #endif |
1088 | 1105 |
1089 | 1106 |
1090 } } // namespace v8::internal | 1107 } } // namespace v8::internal |
1091 | 1108 |
1092 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1109 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |