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

Unified Diff: src/ast-value-factory.cc

Issue 1069423003: Remove comparison operator and helper function from AstRawString interface (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/ast-value-factory.h ('k') | src/modules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast-value-factory.cc
diff --git a/src/ast-value-factory.cc b/src/ast-value-factory.cc
index ff2010007f9bc3f4d33e9c6d5656f04da7bae20c..4bc0c6901d5b2584d94c0f66c66ab3096e46037f 100644
--- a/src/ast-value-factory.cc
+++ b/src/ast-value-factory.cc
@@ -114,19 +114,6 @@ bool AstRawString::IsOneByteEqualTo(const char* data) const {
}
-bool AstRawString::Compare(void* a, void* b) {
- return *static_cast<AstRawString*>(a) == *static_cast<AstRawString*>(b);
-}
-
-bool AstRawString::operator==(const AstRawString& rhs) const {
- if (is_one_byte_ != rhs.is_one_byte_) return false;
- if (hash_ != rhs.hash_) return false;
- int len = literal_bytes_.length();
- if (rhs.literal_bytes_.length() != len) return false;
- return memcmp(literal_bytes_.start(), rhs.literal_bytes_.start(), len) == 0;
-}
-
-
void AstConsString::Internalize(Isolate* isolate) {
// AstRawStrings are internalized before AstConsStrings so left and right are
// already internalized.
@@ -382,4 +369,13 @@ AstRawString* AstValueFactory::GetString(uint32_t hash, bool is_one_byte,
}
+bool AstValueFactory::AstRawStringCompare(void* a, void* b) {
+ const AstRawString* lhs = static_cast<AstRawString*>(a);
+ const AstRawString* rhs = static_cast<AstRawString*>(b);
+ if (lhs->is_one_byte() != rhs->is_one_byte()) return false;
+ if (lhs->hash() != rhs->hash()) return false;
+ int len = lhs->byte_length();
+ if (rhs->byte_length() != len) return false;
+ return memcmp(lhs->raw_data(), rhs->raw_data(), len) == 0;
+}
} } // namespace v8::internal
« no previous file with comments | « src/ast-value-factory.h ('k') | src/modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698