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

Unified Diff: src/objects-inl.h

Issue 882973002: [turbofan] Improve JSON output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ASAN Created 5 years, 11 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
« src/compiler/pipeline.cc ('K') | « src/objects.h ('k') | src/ostreams.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 402010e91a7d8058eb9d45971cdcc2e27f60dbb3..88ced6c4438e9bc587f5c262fdfc872fe342405d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -7521,6 +7521,49 @@ Object* JSMapIterator::CurrentValue() {
}
+class String::SubStringRange::iterator FINAL {
+ public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef int difference_type;
+ typedef uc16 value_type;
+ typedef uc16* pointer;
+ typedef uc16& reference;
+
+ iterator(const iterator& other)
+ : content_(other.content_), offset_(other.offset_) {}
+
+ uc16 operator*() { return content_.Get(offset_); }
+ bool operator==(const iterator& other) const {
+ return content_.UsesSameString(other.content_) && offset_ == other.offset_;
+ }
+ bool operator!=(const iterator& other) const {
+ return !content_.UsesSameString(other.content_) || offset_ != other.offset_;
+ }
+ iterator& operator++() {
+ ++offset_;
+ return *this;
+ }
+ iterator operator++(int);
+
+ private:
+ friend class String;
+ iterator(String* from, int offset)
+ : content_(from->GetFlatContent()), offset_(offset) {}
+ String::FlatContent content_;
+ int offset_;
+};
+
+
+String::SubStringRange::iterator String::SubStringRange::begin() {
+ return String::SubStringRange::iterator(string_, first_);
+}
+
+
+String::SubStringRange::iterator String::SubStringRange::end() {
+ return String::SubStringRange::iterator(string_, first_ + length_);
+}
+
+
#undef TYPE_CHECKER
#undef CAST_ACCESSOR
#undef INT_ACCESSORS
« src/compiler/pipeline.cc ('K') | « src/objects.h ('k') | src/ostreams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698