OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 #include "src/string-builder.h" | 10 #include "src/string-builder.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 IncrementalStringBuilder builder(isolate); | 49 IncrementalStringBuilder builder(isolate); |
50 builder.AppendCString("Symbol("); | 50 builder.AppendCString("Symbol("); |
51 if (symbol->name()->IsString()) { | 51 if (symbol->name()->IsString()) { |
52 builder.AppendString(handle(String::cast(symbol->name()), isolate)); | 52 builder.AppendString(handle(String::cast(symbol->name()), isolate)); |
53 } | 53 } |
54 builder.AppendCharacter(')'); | 54 builder.AppendCharacter(')'); |
55 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish()); | 55 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish()); |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 RUNTIME_FUNCTION(Runtime_SymbolRegistry) { | |
60 HandleScope scope(isolate); | |
61 DCHECK(args.length() == 0); | |
62 return *isolate->GetSymbolRegistry(); | |
63 } | |
64 | |
65 | |
66 RUNTIME_FUNCTION(Runtime_SymbolIsPrivate) { | 59 RUNTIME_FUNCTION(Runtime_SymbolIsPrivate) { |
67 SealHandleScope shs(isolate); | 60 SealHandleScope shs(isolate); |
68 DCHECK(args.length() == 1); | 61 DCHECK(args.length() == 1); |
69 CONVERT_ARG_CHECKED(Symbol, symbol, 0); | 62 CONVERT_ARG_CHECKED(Symbol, symbol, 0); |
70 return isolate->heap()->ToBoolean(symbol->is_private()); | 63 return isolate->heap()->ToBoolean(symbol->is_private()); |
71 } | 64 } |
72 } // namespace internal | 65 } // namespace internal |
73 } // namespace v8 | 66 } // namespace v8 |
OLD | NEW |