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

Unified Diff: src/runtime/runtime-symbol.cc

Issue 1344893002: [builtins] Unify the String constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/runtime/runtime.h ('k') | src/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-symbol.cc
diff --git a/src/runtime/runtime-symbol.cc b/src/runtime/runtime-symbol.cc
index 03bd76ce27f9eff9dc75872acd7c22e9aedee793..778c2417095ba7ed96c272dc8ffa7f16eea1f53a 100644
--- a/src/runtime/runtime-symbol.cc
+++ b/src/runtime/runtime-symbol.cc
@@ -5,7 +5,9 @@
#include "src/runtime/runtime-utils.h"
#include "src/arguments.h"
+#include "src/isolate-inl.h"
#include "src/objects-inl.h"
+#include "src/string-builder.h"
namespace v8 {
namespace internal {
@@ -38,6 +40,22 @@ RUNTIME_FUNCTION(Runtime_SymbolDescription) {
}
+RUNTIME_FUNCTION(Runtime_SymbolDescriptiveString) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(Symbol, symbol, 0);
+ IncrementalStringBuilder builder(isolate);
+ builder.AppendCString("Symbol(");
+ if (symbol->name()->IsString()) {
+ builder.AppendString(handle(String::cast(symbol->name()), isolate));
+ }
+ builder.AppendCharacter(')');
+ Handle<String> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, builder.Finish());
+ return *result;
+}
+
+
RUNTIME_FUNCTION(Runtime_SymbolRegistry) {
HandleScope scope(isolate);
DCHECK(args.length() == 0);
« no previous file with comments | « src/runtime/runtime.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698