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

Unified Diff: src/ast.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 | « no previous file | src/ast-numbering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index e5842c292e57b139f7073dd3f05c9508aa2db411..a6a06269cb3385a333f08a8b7a52a5b3903e2af0 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -10,6 +10,7 @@
#include "src/assembler.h"
#include "src/ast-value-factory.h"
#include "src/bailout-reason.h"
+#include "src/base/flags.h"
#include "src/factory.h"
#include "src/isolate.h"
#include "src/jsregexp.h"
@@ -137,9 +138,6 @@ typedef ZoneList<Handle<Object>> ZoneObjectList;
friend class AstNodeFactory;
-enum AstPropertiesFlag { kDontSelfOptimize, kDontCrankshaft };
-
-
class FeedbackVectorRequirements {
public:
FeedbackVectorRequirements(int slots, int ic_slots)
@@ -175,11 +173,18 @@ typedef List<VariableICSlotPair> ICSlotCache;
class AstProperties final BASE_EMBEDDED {
public:
- class Flags : public EnumSet<AstPropertiesFlag, int> {};
+ enum Flag {
+ kNoFlags = 0,
+ kDontSelfOptimize = 1 << 0,
+ kDontCrankshaft = 1 << 1
+ };
+
+ typedef base::Flags<Flag> Flags;
explicit AstProperties(Zone* zone) : node_count_(0), spec_(zone) {}
- Flags* flags() { return &flags_; }
+ Flags& flags() { return flags_; }
+ Flags flags() const { return flags_; }
int node_count() { return node_count_; }
void add_node_count(int count) { node_count_ += count; }
@@ -197,6 +202,8 @@ class AstProperties final BASE_EMBEDDED {
ZoneFeedbackVectorSpec spec_;
};
+DEFINE_OPERATORS_FOR_FLAGS(AstProperties::Flags)
+
class AstNode: public ZoneObject {
public:
@@ -2587,7 +2594,7 @@ class FunctionLiteral final : public Expression {
FunctionKind kind() const { return FunctionKindBits::decode(bitfield_); }
int ast_node_count() { return ast_properties_.node_count(); }
- AstProperties::Flags* flags() { return ast_properties_.flags(); }
+ AstProperties::Flags flags() const { return ast_properties_.flags(); }
void set_ast_properties(AstProperties* ast_properties) {
ast_properties_ = *ast_properties;
}
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698