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

Unified Diff: src/objects-inl.h

Issue 663313003: Cleanup ConsStringIteratorOp. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 4e964f82310d48567a97577df574cd43db4204eb..33363238c4d28a056421c19d32e1e3935c13bb64 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3693,28 +3693,26 @@ const uint16_t* ExternalTwoByteString::ExternalTwoByteStringGetData(
}
-int ConsStringIteratorOp::OffsetForDepth(int depth) {
- return depth & kDepthMask;
-}
+int ConsStringIterator::OffsetForDepth(int depth) { return depth & kDepthMask; }
-void ConsStringIteratorOp::PushLeft(ConsString* string) {
+void ConsStringIterator::PushLeft(ConsString* string) {
frames_[depth_++ & kDepthMask] = string;
}
-void ConsStringIteratorOp::PushRight(ConsString* string) {
+void ConsStringIterator::PushRight(ConsString* string) {
// Inplace update.
frames_[(depth_-1) & kDepthMask] = string;
}
-void ConsStringIteratorOp::AdjustMaximumDepth() {
+void ConsStringIterator::AdjustMaximumDepth() {
if (depth_ > maximum_depth_) maximum_depth_ = depth_;
}
-void ConsStringIteratorOp::Pop() {
+void ConsStringIterator::Pop() {
DCHECK(depth_ > 0);
DCHECK(depth_ <= maximum_depth_);
depth_--;
@@ -3730,11 +3728,8 @@ uint16_t StringCharacterStream::GetNext() {
}
-StringCharacterStream::StringCharacterStream(String* string,
- ConsStringIteratorOp* op,
- int offset)
- : is_one_byte_(false),
- op_(op) {
+StringCharacterStream::StringCharacterStream(String* string, int offset)
+ : is_one_byte_(false) {
Reset(string, offset);
}
@@ -3743,9 +3738,9 @@ void StringCharacterStream::Reset(String* string, int offset) {
buffer8_ = NULL;
end_ = NULL;
ConsString* cons_string = String::VisitFlat(this, string, offset);
- op_->Reset(cons_string, offset);
+ iter_.Reset(cons_string, offset);
if (cons_string != NULL) {
- string = op_->Next(&offset);
+ string = iter_.Next(&offset);
if (string != NULL) String::VisitFlat(this, string, offset);
}
}
@@ -3754,7 +3749,7 @@ void StringCharacterStream::Reset(String* string, int offset) {
bool StringCharacterStream::HasMore() {
if (buffer8_ != end_) return true;
int offset;
- String* string = op_->Next(&offset);
+ String* string = iter_.Next(&offset);
DCHECK_EQ(offset, 0);
if (string == NULL) return false;
String::VisitFlat(this, string);
@@ -6630,9 +6625,9 @@ uint32_t IteratingStringHasher::Hash(String* string, uint32_t seed) {
// The string was flat.
if (cons_string == NULL) return hasher.GetHashField();
// This is a ConsString, iterate across it.
- ConsStringIteratorOp op(cons_string);
+ ConsStringIterator iter(cons_string);
int offset;
- while (NULL != (string = op.Next(&offset))) {
+ while (NULL != (string = iter.Next(&offset))) {
String::VisitFlat(&hasher, string, offset);
}
return hasher.GetHashField();
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698