OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Actual value of root register is offset from the root array's start | 46 // Actual value of root register is offset from the root array's start |
47 // to take advantage of negitive 8-bit displacement values. | 47 // to take advantage of negitive 8-bit displacement values. |
48 const int kRootRegisterBias = 128; | 48 const int kRootRegisterBias = 128; |
49 | 49 |
50 // Convenience for platform-independent signatures. | 50 // Convenience for platform-independent signatures. |
51 typedef Operand MemOperand; | 51 typedef Operand MemOperand; |
52 | 52 |
53 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; | 53 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
54 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; | 54 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
55 | 55 |
| 56 enum SmiOperationConstraint { |
| 57 PRESERVE_SOURCE_REGISTER, |
| 58 BAILOUT_ON_NO_OVERFLOW, |
| 59 BAILOUT_ON_OVERFLOW, |
| 60 NUMBER_OF_CONSTRAINTS |
| 61 }; |
| 62 |
| 63 STATIC_ASSERT(NUMBER_OF_CONSTRAINTS <= 8); |
| 64 |
| 65 class SmiOperationExecutionMode : public EnumSet<SmiOperationConstraint, byte> { |
| 66 public: |
| 67 SmiOperationExecutionMode() : EnumSet<SmiOperationConstraint, byte>(0) { } |
| 68 explicit SmiOperationExecutionMode(byte bits) |
| 69 : EnumSet<SmiOperationConstraint, byte>(bits) { } |
| 70 }; |
| 71 |
56 bool AreAliased(Register r1, Register r2, Register r3, Register r4); | 72 bool AreAliased(Register r1, Register r2, Register r3, Register r4); |
57 | 73 |
58 // Forward declaration. | 74 // Forward declaration. |
59 class JumpTarget; | 75 class JumpTarget; |
60 | 76 |
61 struct SmiIndex { | 77 struct SmiIndex { |
62 SmiIndex(Register index_register, ScaleFactor scale) | 78 SmiIndex(Register index_register, ScaleFactor scale) |
63 : reg(index_register), | 79 : reg(index_register), |
64 scale(scale) {} | 80 scale(scale) {} |
65 Register reg; | 81 Register reg; |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 556 |
541 // Add an integer constant to a tagged smi, giving a tagged smi as result. | 557 // Add an integer constant to a tagged smi, giving a tagged smi as result. |
542 // No overflow testing on the result is done. | 558 // No overflow testing on the result is done. |
543 void SmiAddConstant(const Operand& dst, Smi* constant); | 559 void SmiAddConstant(const Operand& dst, Smi* constant); |
544 | 560 |
545 // Add an integer constant to a tagged smi, giving a tagged smi as result, | 561 // Add an integer constant to a tagged smi, giving a tagged smi as result, |
546 // or jumping to a label if the result cannot be represented by a smi. | 562 // or jumping to a label if the result cannot be represented by a smi. |
547 void SmiAddConstant(Register dst, | 563 void SmiAddConstant(Register dst, |
548 Register src, | 564 Register src, |
549 Smi* constant, | 565 Smi* constant, |
550 Label* on_not_smi_result, | 566 SmiOperationExecutionMode mode, |
| 567 Label* bailout_label, |
551 Label::Distance near_jump = Label::kFar); | 568 Label::Distance near_jump = Label::kFar); |
552 | 569 |
553 // Subtract an integer constant from a tagged smi, giving a tagged smi as | 570 // Subtract an integer constant from a tagged smi, giving a tagged smi as |
554 // result. No testing on the result is done. Sets the N and Z flags | 571 // result. No testing on the result is done. Sets the N and Z flags |
555 // based on the value of the resulting integer. | 572 // based on the value of the resulting integer. |
556 void SmiSubConstant(Register dst, Register src, Smi* constant); | 573 void SmiSubConstant(Register dst, Register src, Smi* constant); |
557 | 574 |
558 // Subtract an integer constant from a tagged smi, giving a tagged smi as | 575 // Subtract an integer constant from a tagged smi, giving a tagged smi as |
559 // result, or jumping to a label if the result cannot be represented by a smi. | 576 // result, or jumping to a label if the result cannot be represented by a smi. |
560 void SmiSubConstant(Register dst, | 577 void SmiSubConstant(Register dst, |
561 Register src, | 578 Register src, |
562 Smi* constant, | 579 Smi* constant, |
563 Label* on_not_smi_result, | 580 SmiOperationExecutionMode mode, |
| 581 Label* bailout_label, |
564 Label::Distance near_jump = Label::kFar); | 582 Label::Distance near_jump = Label::kFar); |
565 | 583 |
566 // Negating a smi can give a negative zero or too large positive value. | 584 // Negating a smi can give a negative zero or too large positive value. |
567 // NOTICE: This operation jumps on success, not failure! | 585 // NOTICE: This operation jumps on success, not failure! |
568 void SmiNeg(Register dst, | 586 void SmiNeg(Register dst, |
569 Register src, | 587 Register src, |
570 Label* on_smi_result, | 588 Label* on_smi_result, |
571 Label::Distance near_jump = Label::kFar); | 589 Label::Distance near_jump = Label::kFar); |
572 | 590 |
573 // Adds smi values and return the result as a smi. | 591 // Adds smi values and return the result as a smi. |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 masm->popfq(); \ | 1613 masm->popfq(); \ |
1596 } \ | 1614 } \ |
1597 masm-> | 1615 masm-> |
1598 #else | 1616 #else |
1599 #define ACCESS_MASM(masm) masm-> | 1617 #define ACCESS_MASM(masm) masm-> |
1600 #endif | 1618 #endif |
1601 | 1619 |
1602 } } // namespace v8::internal | 1620 } } // namespace v8::internal |
1603 | 1621 |
1604 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1622 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |