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 {
class RegExpAssertion: public RegExpTree {
public:
enum Type {
START_OF_LINE, START_OF_INPUT, END_OF_LINE, END_OF_INPUT,
BOUNDARY, NON_BOUNDARY
START_OF_LINE,
START_OF_INPUT,
END_OF_LINE,
END_OF_INPUT,
BOUNDARY,
NON_BOUNDARY
};
explicit RegExpAssertion(Type type) : type_(type) { }
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
// modification, are permitted provided that the following conditions are
// met:
......
......@@ -2087,8 +2087,8 @@ void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges) {
ranges->Add(CharacterRange::Singleton(chars[i]));
}
}
} else if (from() <= kRangeCanonicalizeMax
&& to() <= kRangeCanonicalizeMax) {
} else if (from() <= kRangeCanonicalizeMax &&
to() <= kRangeCanonicalizeMax) {
// If this is a range we expand the characters block by block,
// expanding contiguous subranges (blocks) one at a time.
// The approach is as follows. For a given start character we
......@@ -2496,7 +2496,7 @@ void DispatchTableConstructor::VisitBackReference(BackReferenceNode* that) {
static int CompareRangeByFrom(const CharacterRange* a,
const CharacterRange* b) {
return Spaceship<uc16>(a->from(), b->from());
return Compare<uc16>(a->from(), b->from());
}
......
......@@ -183,10 +183,7 @@ class CharacterRange {
CharacterRange() : from_(0), to_(0) { }
// For compatibility with the CHECK_OK macro
CharacterRange(void* null) { ASSERT_EQ(NULL, null); } //NOLINT
CharacterRange(uc16 from, uc16 to)
: from_(from),
to_(to) {
}
CharacterRange(uc16 from, uc16 to) : from_(from), to_(to) { }
static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges);
static inline CharacterRange Singleton(uc16 value) {
return CharacterRange(value, value);
......@@ -325,8 +322,8 @@ class OutSet: public ZoneObject {
OutSet* Extend(unsigned value);
bool Get(unsigned value);
static const unsigned kFirstLimit = 32;
private:
private:
// Destructively set a value in this set. In most cases you want
// to use Extend instead to ensure that only one instance exists
// that contains the same values.
......@@ -351,8 +348,7 @@ class DispatchTable {
public:
class Entry {
public:
Entry()
: from_(0), to_(0), out_set_(NULL) { }
Entry() : from_(0), to_(0), out_set_(NULL) { }
Entry(uc16 from, uc16 to, OutSet* out_set)
: from_(from), to_(to), out_set_(out_set) { }
uc16 from() { return from_; }
......
......@@ -111,7 +111,7 @@ void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
template<typename T, class P>
void List<T, P>::Sort() {
Sort(PointerSpaceship<T>);
Sort(PointerValueCompare<T>);
}
......
......@@ -84,7 +84,7 @@ static inline T RoundUp(T x, int m) {
template <typename T>
static int Spaceship(const T& a, const T& b) {
static int Compare(const T& a, const T& b) {
if (a == b)
return 0;
else if (a < b)
......@@ -95,8 +95,8 @@ static int Spaceship(const T& a, const T& b) {
template <typename T>
static int PointerSpaceship(const T* a, const T* b) {
return Spaceship<T>(*a, *b);
static int PointerValueCompare(const T* a, const T* b) {
return Compare<T>(*a, *b);
}
......@@ -344,7 +344,7 @@ class Vector {
}
void Sort() {
Sort(PointerSpaceship<T>);
Sort(PointerValueCompare<T>);
}
// 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
// modification, are permitted provided that the following conditions are
// 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