Merge code review fixes.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@845 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 144c8c79
...@@ -1266,8 +1266,12 @@ class RegExpText: public RegExpTree { ...@@ -1266,8 +1266,12 @@ class RegExpText: public RegExpTree {
class RegExpAssertion: public RegExpTree { class RegExpAssertion: public RegExpTree {
public: public:
enum Type { enum Type {
START_OF_LINE, START_OF_INPUT, END_OF_LINE, END_OF_INPUT, START_OF_LINE,
BOUNDARY, NON_BOUNDARY START_OF_INPUT,
END_OF_LINE,
END_OF_INPUT,
BOUNDARY,
NON_BOUNDARY
}; };
explicit RegExpAssertion(Type type) : type_(type) { } explicit RegExpAssertion(Type type) : type_(type) { }
virtual void* Accept(RegExpVisitor* visitor, void* data); virtual void* Accept(RegExpVisitor* visitor, void* data);
......
// Copyright 2006-2008 the V8 project authors. All rights reserved. // Copyright 2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are // modification, are permitted provided that the following conditions are
// met: // met:
......
...@@ -2087,8 +2087,8 @@ void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges) { ...@@ -2087,8 +2087,8 @@ void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges) {
ranges->Add(CharacterRange::Singleton(chars[i])); ranges->Add(CharacterRange::Singleton(chars[i]));
} }
} }
} else if (from() <= kRangeCanonicalizeMax } else if (from() <= kRangeCanonicalizeMax &&
&& to() <= kRangeCanonicalizeMax) { to() <= kRangeCanonicalizeMax) {
// If this is a range we expand the characters block by block, // If this is a range we expand the characters block by block,
// expanding contiguous subranges (blocks) one at a time. // expanding contiguous subranges (blocks) one at a time.
// The approach is as follows. For a given start character we // The approach is as follows. For a given start character we
...@@ -2496,7 +2496,7 @@ void DispatchTableConstructor::VisitBackReference(BackReferenceNode* that) { ...@@ -2496,7 +2496,7 @@ void DispatchTableConstructor::VisitBackReference(BackReferenceNode* that) {
static int CompareRangeByFrom(const CharacterRange* a, static int CompareRangeByFrom(const CharacterRange* a,
const CharacterRange* b) { const CharacterRange* b) {
return Spaceship<uc16>(a->from(), b->from()); return Compare<uc16>(a->from(), b->from());
} }
......
...@@ -183,10 +183,7 @@ class CharacterRange { ...@@ -183,10 +183,7 @@ class CharacterRange {
CharacterRange() : from_(0), to_(0) { } CharacterRange() : from_(0), to_(0) { }
// For compatibility with the CHECK_OK macro // For compatibility with the CHECK_OK macro
CharacterRange(void* null) { ASSERT_EQ(NULL, null); } //NOLINT CharacterRange(void* null) { ASSERT_EQ(NULL, null); } //NOLINT
CharacterRange(uc16 from, uc16 to) CharacterRange(uc16 from, uc16 to) : from_(from), to_(to) { }
: from_(from),
to_(to) {
}
static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges); static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges);
static inline CharacterRange Singleton(uc16 value) { static inline CharacterRange Singleton(uc16 value) {
return CharacterRange(value, value); return CharacterRange(value, value);
...@@ -325,8 +322,8 @@ class OutSet: public ZoneObject { ...@@ -325,8 +322,8 @@ class OutSet: public ZoneObject {
OutSet* Extend(unsigned value); OutSet* Extend(unsigned value);
bool Get(unsigned value); bool Get(unsigned value);
static const unsigned kFirstLimit = 32; static const unsigned kFirstLimit = 32;
private:
private:
// Destructively set a value in this set. In most cases you want // Destructively set a value in this set. In most cases you want
// to use Extend instead to ensure that only one instance exists // to use Extend instead to ensure that only one instance exists
// that contains the same values. // that contains the same values.
...@@ -351,8 +348,7 @@ class DispatchTable { ...@@ -351,8 +348,7 @@ class DispatchTable {
public: public:
class Entry { class Entry {
public: public:
Entry() Entry() : from_(0), to_(0), out_set_(NULL) { }
: from_(0), to_(0), out_set_(NULL) { }
Entry(uc16 from, uc16 to, OutSet* out_set) Entry(uc16 from, uc16 to, OutSet* out_set)
: from_(from), to_(to), out_set_(out_set) { } : from_(from), to_(to), out_set_(out_set) { }
uc16 from() { return from_; } uc16 from() { return from_; }
......
...@@ -111,7 +111,7 @@ void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) { ...@@ -111,7 +111,7 @@ void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
template<typename T, class P> template<typename T, class P>
void List<T, P>::Sort() { void List<T, P>::Sort() {
Sort(PointerSpaceship<T>); Sort(PointerValueCompare<T>);
} }
......
...@@ -84,7 +84,7 @@ static inline T RoundUp(T x, int m) { ...@@ -84,7 +84,7 @@ static inline T RoundUp(T x, int m) {
template <typename T> template <typename T>
static int Spaceship(const T& a, const T& b) { static int Compare(const T& a, const T& b) {
if (a == b) if (a == b)
return 0; return 0;
else if (a < b) else if (a < b)
...@@ -95,8 +95,8 @@ static int Spaceship(const T& a, const T& b) { ...@@ -95,8 +95,8 @@ static int Spaceship(const T& a, const T& b) {
template <typename T> template <typename T>
static int PointerSpaceship(const T* a, const T* b) { static int PointerValueCompare(const T* a, const T* b) {
return Spaceship<T>(*a, *b); return Compare<T>(*a, *b);
} }
...@@ -344,7 +344,7 @@ class Vector { ...@@ -344,7 +344,7 @@ class Vector {
} }
void Sort() { void Sort() {
Sort(PointerSpaceship<T>); Sort(PointerValueCompare<T>);
} }
// Releases the array underlying this vector. Once disposed the // Releases the array underlying this vector. Once disposed the
......
// Copyright 2006-2008 the V8 project authors. All rights reserved. // Copyright 2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are // modification, are permitted provided that the following conditions are
// met: // met:
......
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