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

Unified Diff: src/factory.cc

Issue 2903533002: Revert of [es2015] Precompute the descriptive string for symbols. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/factory.h ('k') | src/heap-symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 9c73a519ae0512cbb6284c89395d55f47b116464..3948eec3a722461b50bfdc241322fedb837f6060 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -16,7 +16,6 @@
#include "src/objects/frame-array-inl.h"
#include "src/objects/module-info.h"
#include "src/objects/scope-info.h"
-#include "src/string-builder.h"
namespace v8 {
namespace internal {
@@ -910,38 +909,9 @@
Symbol);
}
-MaybeHandle<Symbol> Factory::NewSymbol(Handle<Object> name) {
- DCHECK(name->IsString() || name->IsUndefined(isolate()));
- Handle<Symbol> symbol = NewSymbol();
- if (name->IsString()) {
- // Compute the descriptive string for the {symbol}.
- Handle<String> descriptive_string;
- IncrementalStringBuilder builder(isolate());
- builder.AppendCString("Symbol(");
- builder.AppendString(Handle<String>::cast(name));
- builder.AppendCharacter(')');
- ASSIGN_RETURN_ON_EXCEPTION(isolate(), descriptive_string, builder.Finish(),
- Symbol);
-
- // Make sure those strings are flattened.
- name = String::Flatten(Handle<String>::cast(name), TENURED);
- descriptive_string = String::Flatten(descriptive_string, TENURED);
-
- symbol->set_name(String::cast(*name));
- symbol->set_descriptive_string(*descriptive_string);
- }
- return symbol;
-}
Handle<Symbol> Factory::NewPrivateSymbol() {
Handle<Symbol> symbol = NewSymbol();
- symbol->set_is_private(true);
- return symbol;
-}
-
-MaybeHandle<Symbol> Factory::NewPrivateSymbol(Handle<Object> name) {
- Handle<Symbol> symbol;
- ASSIGN_RETURN_ON_EXCEPTION(isolate(), symbol, NewSymbol(name), Symbol);
symbol->set_is_private(true);
return symbol;
}
« no previous file with comments | « src/factory.h ('k') | src/heap-symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698