Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 89ac974e89e27b4c2e4c5a0b34ae5153cc3084f6..e2414d290046927d3d3f4a7e13d3b09e0311d5df 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -533,21 +533,17 @@ class OneByteStringKey : public SequentialStringKey<uint8_t> { |
}; |
-template<class Char> |
-class SubStringKey : public HashTableKey { |
+class SeqOneByteSubStringKey : public HashTableKey { |
public: |
- SubStringKey(Handle<String> string, int from, int length) |
+ SeqOneByteSubStringKey(Handle<SeqOneByteString> string, int from, int length) |
: string_(string), from_(from), length_(length) { |
- if (string_->IsSlicedString()) { |
- string_ = Handle<String>(Unslice(*string_, &from_)); |
- } |
- DCHECK(string_->IsSeqString() || string->IsExternalString()); |
+ DCHECK(string_->IsSeqOneByteString()); |
} |
virtual uint32_t Hash() V8_OVERRIDE { |
DCHECK(length_ >= 0); |
DCHECK(from_ + length_ <= string_->length()); |
- const Char* chars = GetChars() + from_; |
+ const uint8_t* chars = string_->GetChars() + from_; |
hash_field_ = StringHasher::HashSequentialString( |
chars, length_, string_->GetHeap()->HashSeed()); |
uint32_t result = hash_field_ >> String::kHashShift; |
@@ -563,17 +559,7 @@ class SubStringKey : public HashTableKey { |
virtual Handle<Object> AsHandle(Isolate* isolate) V8_OVERRIDE; |
private: |
- const Char* GetChars(); |
- String* Unslice(String* string, int* offset) { |
- while (string->IsSlicedString()) { |
- SlicedString* sliced = SlicedString::cast(string); |
- *offset += sliced->offset(); |
- string = sliced->parent(); |
- } |
- return string; |
- } |
- |
- Handle<String> string_; |
+ Handle<SeqOneByteString> string_; |
int from_; |
int length_; |
uint32_t hash_field_; |