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

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

Issue 620113002: Removed the Isolate* field from literal nodes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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') | no next file » | 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 ea8474ff52f6c81db9124be8a7af3edefed969c9..4df6ac01a03a7ddef1fa401c6b0707677bc1950b 100644
--- a/src/ast-value-factory.cc
+++ b/src/ast-value-factory.cc
@@ -117,14 +117,15 @@ bool AstRawString::IsOneByteEqualTo(const char* data) const {
bool AstRawString::Compare(void* a, void* b) {
- AstRawString* string1 = reinterpret_cast<AstRawString*>(a);
- AstRawString* string2 = reinterpret_cast<AstRawString*>(b);
- if (string1->is_one_byte_ != string2->is_one_byte_) return false;
- if (string1->hash_ != string2->hash_) return false;
- int length = string1->literal_bytes_.length();
- if (string2->literal_bytes_.length() != length) return false;
- return memcmp(string1->literal_bytes_.start(),
- string2->literal_bytes_.start(), length) == 0;
+ 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;
}
« no previous file with comments | « src/ast-value-factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698