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

Side by Side Diff: src/runtime/runtime-symbol.cc

Issue 2551763003: v8::Private::ForApi should be context-independent. (Closed)
Patch Set: fix Created 4 years 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698