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 "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 test(value, Immediate(kSmiTagMask)); | 481 test(value, Immediate(kSmiTagMask)); |
482 j(zero, smi_label, distance); | 482 j(zero, smi_label, distance); |
483 } | 483 } |
484 // Jump if register contain a non-smi. | 484 // Jump if register contain a non-smi. |
485 inline void JumpIfNotSmi(Register value, Label* not_smi_label, | 485 inline void JumpIfNotSmi(Register value, Label* not_smi_label, |
486 Label::Distance distance = Label::kFar) { | 486 Label::Distance distance = Label::kFar) { |
487 test(value, Immediate(kSmiTagMask)); | 487 test(value, Immediate(kSmiTagMask)); |
488 j(not_zero, not_smi_label, distance); | 488 j(not_zero, not_smi_label, distance); |
489 } | 489 } |
490 | 490 |
| 491 // Jump if the value cannot be represented by a smi. |
| 492 inline void JumpIfNotValidSmiValue(Register value, Register scratch, |
| 493 Label* on_invalid, |
| 494 Label::Distance distance = Label::kFar) { |
| 495 mov(scratch, value); |
| 496 add(scratch, Immediate(0x40000000U)); |
| 497 j(sign, on_invalid, distance); |
| 498 } |
| 499 |
| 500 // Jump if the unsigned integer value cannot be represented by a smi. |
| 501 inline void JumpIfUIntNotValidSmiValue( |
| 502 Register value, Label* on_invalid, |
| 503 Label::Distance distance = Label::kFar) { |
| 504 cmp(value, Immediate(0x40000000U)); |
| 505 j(above_equal, on_invalid, distance); |
| 506 } |
| 507 |
491 void LoadInstanceDescriptors(Register map, Register descriptors); | 508 void LoadInstanceDescriptors(Register map, Register descriptors); |
492 void EnumLength(Register dst, Register map); | 509 void EnumLength(Register dst, Register map); |
493 void NumberOfOwnDescriptors(Register dst, Register map); | 510 void NumberOfOwnDescriptors(Register dst, Register map); |
494 void LoadAccessor(Register dst, Register holder, int accessor_index, | 511 void LoadAccessor(Register dst, Register holder, int accessor_index, |
495 AccessorComponent accessor); | 512 AccessorComponent accessor); |
496 | 513 |
497 template<typename Field> | 514 template<typename Field> |
498 void DecodeField(Register reg) { | 515 void DecodeField(Register reg) { |
499 static const int shift = Field::kShift; | 516 static const int shift = Field::kShift; |
500 static const int mask = Field::kMask >> Field::kShift; | 517 static const int mask = Field::kMask >> Field::kShift; |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 } \ | 1042 } \ |
1026 masm-> | 1043 masm-> |
1027 #else | 1044 #else |
1028 #define ACCESS_MASM(masm) masm-> | 1045 #define ACCESS_MASM(masm) masm-> |
1029 #endif | 1046 #endif |
1030 | 1047 |
1031 } // namespace internal | 1048 } // namespace internal |
1032 } // namespace v8 | 1049 } // namespace v8 |
1033 | 1050 |
1034 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1051 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |