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

Unified Diff: src/factory.cc

Issue 1149863005: Move hash code from hidden string to a private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix global object hash code. This eated about 5% of weak collection performance Created 5 years, 7 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 06373d2d8a39f62c0f98db6fd4978270f486f350..817a897399a6d64bbeac5ad59b3108a20674321e 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -705,10 +705,15 @@ Handle<Symbol> Factory::NewPrivateSymbol() {
}
-Handle<Symbol> Factory::NewPrivateOwnSymbol() {
+Handle<Symbol> Factory::NewPrivateOwnSymbol(Handle<Object> name) {
Handle<Symbol> symbol = NewSymbol();
symbol->set_is_private(true);
symbol->set_is_own(true);
+ if (name->IsString()) {
+ symbol->set_name(*name);
+ } else {
+ DCHECK(name->IsUndefined());
+ }
return symbol;
}

Powered by Google App Engine
This is Rietveld 408576698