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

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

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.cc ('k') | src/ast-value-factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast-value-factory.h
diff --git a/src/ast-value-factory.h b/src/ast-value-factory.h
index b34a55b2a69a55d91a99b6c3cd44b38608cda232..8c4b694b2b98084b4ea0dba12870cc18ee8f4a93 100644
--- a/src/ast-value-factory.h
+++ b/src/ast-value-factory.h
@@ -70,6 +70,8 @@ class AstRawString : public AstString {
return literal_bytes_.length() / 2;
}
+ int byte_length() const { return literal_bytes_.length(); }
+
void Internalize(Isolate* isolate) OVERRIDE;
bool AsArrayIndex(uint32_t* index) const;
@@ -92,9 +94,6 @@ class AstRawString : public AstString {
uint32_t hash() const {
return hash_;
}
- static bool Compare(void* a, void* b);
-
- bool operator==(const AstRawString& rhs) const;
private:
friend class AstValueFactory;
@@ -277,7 +276,7 @@ class AstValue : public ZoneObject {
class AstValueFactory {
public:
AstValueFactory(Zone* zone, uint32_t hash_seed)
- : string_table_(AstRawString::Compare),
+ : string_table_(AstRawStringCompare),
zone_(zone),
isolate_(NULL),
hash_seed_(hash_seed) {
@@ -340,6 +339,8 @@ class AstValueFactory {
AstRawString* GetString(uint32_t hash, bool is_one_byte,
Vector<const byte> literal_bytes);
+ static bool AstRawStringCompare(void* a, void* b);
+
// All strings are copied here, one after another (no NULLs inbetween).
HashMap string_table_;
// For keeping track of all AstValues and AstRawStrings we've created (so that
« no previous file with comments | « src/ast.cc ('k') | src/ast-value-factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698