Index: src/x64/macro-assembler-x64.h |
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h |
index 0016d99321e86168433fa0295493d6110aa1eae5..c1eda2a1de95e716cb9983c9497c26dff1f949c7 100644 |
--- a/src/x64/macro-assembler-x64.h |
+++ b/src/x64/macro-assembler-x64.h |
@@ -7,6 +7,7 @@ |
#include "src/assembler.h" |
#include "src/bailout-reason.h" |
+#include "src/base/flags.h" |
#include "src/frames.h" |
#include "src/globals.h" |
@@ -32,21 +33,15 @@ enum PointersToHereCheck { |
kPointersToHereAreAlwaysInteresting |
}; |
-enum SmiOperationConstraint { |
- PRESERVE_SOURCE_REGISTER, |
- BAILOUT_ON_NO_OVERFLOW, |
- BAILOUT_ON_OVERFLOW, |
- NUMBER_OF_CONSTRAINTS |
+enum class SmiOperationConstraint { |
+ kPreserveSourceRegister = 1 << 0, |
+ kBailoutOnNoOverflow = 1 << 1, |
+ kBailoutOnOverflow = 1 << 2 |
}; |
-STATIC_ASSERT(NUMBER_OF_CONSTRAINTS <= 8); |
+typedef base::Flags<SmiOperationConstraint> SmiOperationConstraints; |
-class SmiOperationExecutionMode : public EnumSet<SmiOperationConstraint, byte> { |
- public: |
- SmiOperationExecutionMode() : EnumSet<SmiOperationConstraint, byte>(0) { } |
- explicit SmiOperationExecutionMode(byte bits) |
- : EnumSet<SmiOperationConstraint, byte>(bits) { } |
-}; |
+DEFINE_OPERATORS_FOR_FLAGS(SmiOperationConstraints) |
#ifdef DEBUG |
bool AreAliased(Register reg1, |
@@ -546,11 +541,8 @@ class MacroAssembler: public Assembler { |
// Add an integer constant to a tagged smi, giving a tagged smi as result, |
// or jumping to a label if the result cannot be represented by a smi. |
- void SmiAddConstant(Register dst, |
- Register src, |
- Smi* constant, |
- SmiOperationExecutionMode mode, |
- Label* bailout_label, |
+ void SmiAddConstant(Register dst, Register src, Smi* constant, |
+ SmiOperationConstraints constraints, Label* bailout_label, |
Label::Distance near_jump = Label::kFar); |
// Subtract an integer constant from a tagged smi, giving a tagged smi as |
@@ -560,11 +552,8 @@ class MacroAssembler: public Assembler { |
// Subtract an integer constant from a tagged smi, giving a tagged smi as |
// result, or jumping to a label if the result cannot be represented by a smi. |
- void SmiSubConstant(Register dst, |
- Register src, |
- Smi* constant, |
- SmiOperationExecutionMode mode, |
- Label* bailout_label, |
+ void SmiSubConstant(Register dst, Register src, Smi* constant, |
+ SmiOperationConstraints constraints, Label* bailout_label, |
Label::Distance near_jump = Label::kFar); |
// Negating a smi can give a negative zero or too large positive value. |