Commit 2d60b728 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[ast cleanup] Remove unnecessary macro magic in AstValueFactory

We can use member initializers instead of the OTHER_CONSTANTS macro to
handle the declaration of oddball AstValue members in AstValueFactory.

Bug: v8:6921
Change-Id: I701e2fd36f854cfc0d835981d060622070b5bfba
Reviewed-on: https://chromium-review.googlesource.com/719395Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48611}
parent 11291891
...@@ -372,13 +372,6 @@ class AstStringConstants final { ...@@ -372,13 +372,6 @@ class AstStringConstants final {
DISALLOW_COPY_AND_ASSIGN(AstStringConstants); DISALLOW_COPY_AND_ASSIGN(AstStringConstants);
}; };
#define OTHER_CONSTANTS(F) \
F(true_value) \
F(false_value) \
F(null_value) \
F(undefined_value) \
F(the_hole_value)
class AstValueFactory { class AstValueFactory {
public: public:
AstValueFactory(Zone* zone, const AstStringConstants* string_constants, AstValueFactory(Zone* zone, const AstStringConstants* string_constants,
...@@ -393,9 +386,6 @@ class AstValueFactory { ...@@ -393,9 +386,6 @@ class AstValueFactory {
empty_cons_string_(nullptr), empty_cons_string_(nullptr),
zone_(zone), zone_(zone),
hash_seed_(hash_seed) { hash_seed_(hash_seed) {
#define F(name) name##_ = nullptr;
OTHER_CONSTANTS(F)
#undef F
DCHECK_EQ(hash_seed, string_constants->hash_seed()); DCHECK_EQ(hash_seed, string_constants->hash_seed());
std::fill(smis_, smis_ + arraysize(smis_), nullptr); std::fill(smis_, smis_ + arraysize(smis_), nullptr);
std::fill(one_character_strings_, std::fill(one_character_strings_,
...@@ -502,13 +492,13 @@ class AstValueFactory { ...@@ -502,13 +492,13 @@ class AstValueFactory {
uint32_t hash_seed_; uint32_t hash_seed_;
#define F(name) AstValue* name##_; AstValue* true_value_ = nullptr;
OTHER_CONSTANTS(F) AstValue* false_value_ = nullptr;
#undef F AstValue* null_value_ = nullptr;
AstValue* undefined_value_ = nullptr;
AstValue* the_hole_value_ = nullptr;
}; };
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
#undef OTHER_CONSTANTS
#endif // V8_AST_AST_VALUE_FACTORY_H_ #endif // V8_AST_AST_VALUE_FACTORY_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment