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

Unified Diff: src/ast.h

Issue 9104: Dispatch tables (Closed)
Patch Set: Created 12 years, 1 month 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.cc » ('j') | src/jsregexp.cc » ('J')
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 191664dd34dc0b6dd1cc9d40d6724b35d2dc22c2..5708271e02b8e803f36799c6a0670ca8e3b5d0dc 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -34,6 +34,7 @@
#include "token.h"
#include "variables.h"
#include "macro-assembler.h"
+#include "jsregexp.h"
namespace v8 { namespace internal {
@@ -1258,48 +1259,8 @@ class RegExpAssertion: public RegExpTree {
};
-class CharacterRange {
- public:
- // For compatibility with the CHECK_OK macro
- CharacterRange(void* null) { ASSERT_EQ(NULL, null); } //NOLINT
- CharacterRange(uc32 from, uc32 to, bool is_character_class)
- : from_(from),
- to_(to),
- is_character_class_(is_character_class) {
- // Assert that truncating doesn't throw away information.
- ASSERT_EQ(from, from_);
- ASSERT_EQ(to_, to);
- }
- static inline CharacterRange CharacterClass(uc32 tag) {
- return CharacterRange(tag, tag, true);
- }
- static inline CharacterRange Singleton(uc32 value) {
- return CharacterRange(value, value, false);
- }
- static inline CharacterRange Range(uc32 from, uc32 to) {
- return CharacterRange(from, to, false);
- }
- unsigned from() { return from_; }
- unsigned to() { return to_; }
- bool is_character_class() { return is_character_class_; }
- bool IsSingleton() { return (from_ == to_) && !is_character_class(); }
- private:
- unsigned from_ : 16;
- unsigned to_ : 16;
- bool is_character_class_ : 1;
-};
-
-
-STATIC_CHECK(sizeof(CharacterRange) == 2 * sizeof(int)); // NOLINT
-
-
class RegExpCharacterClass: public RegExpTree {
public:
- explicit RegExpCharacterClass(CharacterRange range)
- : ranges_(new ZoneList<CharacterRange>(1)),
- is_negated_(false) {
- ranges_->Add(range);
- }
RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
: ranges_(ranges),
is_negated_(is_negated) { }
« no previous file with comments | « no previous file | src/ast.cc » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698