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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 test(value, Immediate(kSmiTagMask)); | 464 test(value, Immediate(kSmiTagMask)); |
465 j(zero, smi_label, distance); | 465 j(zero, smi_label, distance); |
466 } | 466 } |
467 // Jump if register contain a non-smi. | 467 // Jump if register contain a non-smi. |
468 inline void JumpIfNotSmi(Register value, Label* not_smi_label, | 468 inline void JumpIfNotSmi(Register value, Label* not_smi_label, |
469 Label::Distance distance = Label::kFar) { | 469 Label::Distance distance = Label::kFar) { |
470 test(value, Immediate(kSmiTagMask)); | 470 test(value, Immediate(kSmiTagMask)); |
471 j(not_zero, not_smi_label, distance); | 471 j(not_zero, not_smi_label, distance); |
472 } | 472 } |
473 | 473 |
| 474 // Jump if the value cannot be represented by a smi. |
| 475 inline void JumpIfNotValidSmiValue(Register value, Register scratch, |
| 476 Label* on_invalid, |
| 477 Label::Distance distance = Label::kFar) { |
| 478 mov(scratch, value); |
| 479 add(scratch, Immediate(0x40000000U)); |
| 480 j(sign, on_invalid, distance); |
| 481 } |
| 482 |
| 483 // Jump if the unsigned integer value cannot be represented by a smi. |
| 484 inline void JumpIfUIntNotValidSmiValue( |
| 485 Register value, Label* on_invalid, |
| 486 Label::Distance distance = Label::kFar) { |
| 487 cmp(value, Immediate(0x40000000U)); |
| 488 j(above_equal, on_invalid, distance); |
| 489 } |
| 490 |
474 void LoadInstanceDescriptors(Register map, Register descriptors); | 491 void LoadInstanceDescriptors(Register map, Register descriptors); |
475 void EnumLength(Register dst, Register map); | 492 void EnumLength(Register dst, Register map); |
476 void NumberOfOwnDescriptors(Register dst, Register map); | 493 void NumberOfOwnDescriptors(Register dst, Register map); |
477 void LoadAccessor(Register dst, Register holder, int accessor_index, | 494 void LoadAccessor(Register dst, Register holder, int accessor_index, |
478 AccessorComponent accessor); | 495 AccessorComponent accessor); |
479 | 496 |
480 template<typename Field> | 497 template<typename Field> |
481 void DecodeField(Register reg) { | 498 void DecodeField(Register reg) { |
482 static const int shift = Field::kShift; | 499 static const int shift = Field::kShift; |
483 static const int mask = Field::kMask >> Field::kShift; | 500 static const int mask = Field::kMask >> Field::kShift; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 } \ | 1024 } \ |
1008 masm-> | 1025 masm-> |
1009 #else | 1026 #else |
1010 #define ACCESS_MASM(masm) masm-> | 1027 #define ACCESS_MASM(masm) masm-> |
1011 #endif | 1028 #endif |
1012 | 1029 |
1013 } // namespace internal | 1030 } // namespace internal |
1014 } // namespace v8 | 1031 } // namespace v8 |
1015 | 1032 |
1016 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1033 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |