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

Unified Diff: src/objects.cc

Issue 11000: Periodic merge of bleeding_edge to experimental code generator branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
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 | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 868)
+++ src/objects.cc (working copy)
@@ -3501,6 +3501,57 @@
}
+FlatStringReader* FlatStringReader::top_ = NULL;
+
+
+FlatStringReader::FlatStringReader(Handle<String> str)
+ : str_(str.location()),
+ length_(str->length()),
+ prev_(top_) {
+ top_ = this;
+ RefreshState();
+}
+
+
+FlatStringReader::FlatStringReader(Vector<const char> input)
+ : str_(NULL),
+ is_ascii_(true),
+ length_(input.length()),
+ start_(input.start()),
+ prev_(top_) {
+ top_ = this;
+}
+
+
+FlatStringReader::~FlatStringReader() {
+ ASSERT_EQ(top_, this);
+ top_ = prev_;
+}
+
+
+void FlatStringReader::RefreshState() {
+ if (str_ == NULL) return;
+ Handle<String> str(str_);
+ StringShape shape(*str);
+ ASSERT(str->IsFlat(shape));
+ is_ascii_ = shape.IsAsciiRepresentation();
+ if (is_ascii_) {
+ start_ = str->ToAsciiVector().start();
+ } else {
+ start_ = str->ToUC16Vector().start();
+ }
+}
+
+
+void FlatStringReader::PostGarbageCollectionProcessing() {
+ FlatStringReader* current = top_;
+ while (current != NULL) {
+ current->RefreshState();
+ current = current->prev_;
+ }
+}
+
+
void StringInputBuffer::Seek(unsigned pos) {
Reset(pos, input_);
}
@@ -5745,8 +5796,8 @@
class RegExpKey : public HashTableKey {
public:
RegExpKey(String* string, JSRegExp::Flags flags)
- : string_(string),
- flags_(Smi::FromInt(flags.value())) { }
+ : string_(string),
+ flags_(Smi::FromInt(flags.value())) { }
bool IsMatch(Object* obj) {
FixedArray* val = FixedArray::cast(obj);
@@ -6137,7 +6188,7 @@
class MapNameKey : public HashTableKey {
public:
MapNameKey(Map* map, String* name)
- : map_(map), name_(name) { }
+ : map_(map), name_(name) { }
bool IsMatch(Object* other) {
if (!other->IsFixedArray()) return false;
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698