Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: src/x64/macro-assembler-x64.h

Issue 1229233002: Remove more uses of the deprecated EnumSet template class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698