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

Unified Diff: src/objects.cc

Issue 394793002: Verify that source string matches serialized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index fc78e53ca90242a36e730d7283e6eb2bfcd902d0..d5f7f75c18ccb2ea6a9e5139c3b38a2c17a31139 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9332,38 +9332,6 @@ bool String::IsTwoByteEqualTo(Vector<const uc16> str) {
}
-class IteratingStringHasher: public StringHasher {
- public:
- static inline uint32_t Hash(String* string, uint32_t seed) {
- IteratingStringHasher hasher(string->length(), seed);
- // Nothing to do.
- if (hasher.has_trivial_hash()) return hasher.GetHashField();
- ConsString* cons_string = String::VisitFlat(&hasher, string);
- // The string was flat.
- if (cons_string == NULL) return hasher.GetHashField();
- // This is a ConsString, iterate across it.
- ConsStringIteratorOp op(cons_string);
- int offset;
- while (NULL != (string = op.Next(&offset))) {
- String::VisitFlat(&hasher, string, offset);
- }
- return hasher.GetHashField();
- }
- inline void VisitOneByteString(const uint8_t* chars, int length) {
- AddCharacters(chars, length);
- }
- inline void VisitTwoByteString(const uint16_t* chars, int length) {
- AddCharacters(chars, length);
- }
-
- private:
- inline IteratingStringHasher(int len, uint32_t seed)
- : StringHasher(len, seed) {
- }
- DISALLOW_COPY_AND_ASSIGN(IteratingStringHasher);
-};
-
-
uint32_t String::ComputeAndSetHash() {
// Should only be called if hash code has not yet been computed.
ASSERT(!HasHashCode());
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | test/cctest/test-serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698