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

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

Issue 2220363002: De-virtualize AstString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« src/ast/ast-value-factory.h ('K') | « src/ast/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/ast-value-factory.cc
diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc
index 63b40d2286a82cbe1ff7a939eaf89b731c3870ff..52b2050749f73b4d9b03503f4fb91452cf59f68c 100644
--- a/src/ast/ast-value-factory.cc
+++ b/src/ast/ast-value-factory.cc
@@ -82,6 +82,19 @@ class AstRawStringInternalizationKey : public HashTableKey {
const AstRawString* string_;
};
+int AstString::length() const {
+ if (is_raw_) {
+ return reinterpret_cast<const AstRawString*>(this)->length();
+ }
+ return reinterpret_cast<const AstConsString*>(this)->length();
+}
+
+void AstString::Internalize(Isolate* isolate) {
+ if (is_raw_) {
+ return reinterpret_cast<AstRawString*>(this)->Internalize(isolate);
+ }
+ return reinterpret_cast<AstConsString*>(this)->Internalize(isolate);
+}
void AstRawString::Internalize(Isolate* isolate) {
if (!string_.is_null()) return;
« src/ast/ast-value-factory.h ('K') | « src/ast/ast-value-factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698