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

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

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-simd.cc ('k') | src/string.js » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/runtime/runtime-utils.h" 8 #include "src/runtime/runtime-utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 Object::GetProperty(privates, name)); 44 Object::GetProperty(privates, name));
45 if (!symbol->IsSymbol()) { 45 if (!symbol->IsSymbol()) {
46 DCHECK(symbol->IsUndefined()); 46 DCHECK(symbol->IsUndefined());
47 symbol = isolate->factory()->NewPrivateSymbol(name); 47 symbol = isolate->factory()->NewPrivateSymbol(name);
48 JSObject::AddProperty(Handle<JSObject>::cast(privates), name, symbol, NONE); 48 JSObject::AddProperty(Handle<JSObject>::cast(privates), name, symbol, NONE);
49 } 49 }
50 return *symbol; 50 return *symbol;
51 } 51 }
52 52
53 53
54 RUNTIME_FUNCTION(Runtime_NewSymbolWrapper) {
55 HandleScope scope(isolate);
56 DCHECK(args.length() == 1);
57 CONVERT_ARG_HANDLE_CHECKED(Symbol, symbol, 0);
58 return *Object::ToObject(isolate, symbol).ToHandleChecked();
59 }
60
61
62 RUNTIME_FUNCTION(Runtime_SymbolDescription) { 54 RUNTIME_FUNCTION(Runtime_SymbolDescription) {
63 SealHandleScope shs(isolate); 55 SealHandleScope shs(isolate);
64 DCHECK(args.length() == 1); 56 DCHECK(args.length() == 1);
65 CONVERT_ARG_CHECKED(Symbol, symbol, 0); 57 CONVERT_ARG_CHECKED(Symbol, symbol, 0);
66 return symbol->name(); 58 return symbol->name();
67 } 59 }
68 60
69 61
70 RUNTIME_FUNCTION(Runtime_SymbolRegistry) { 62 RUNTIME_FUNCTION(Runtime_SymbolRegistry) {
71 HandleScope scope(isolate); 63 HandleScope scope(isolate);
72 DCHECK(args.length() == 0); 64 DCHECK(args.length() == 0);
73 return *isolate->GetSymbolRegistry(); 65 return *isolate->GetSymbolRegistry();
74 } 66 }
75 67
76 68
77 RUNTIME_FUNCTION(Runtime_SymbolIsPrivate) { 69 RUNTIME_FUNCTION(Runtime_SymbolIsPrivate) {
78 SealHandleScope shs(isolate); 70 SealHandleScope shs(isolate);
79 DCHECK(args.length() == 1); 71 DCHECK(args.length() == 1);
80 CONVERT_ARG_CHECKED(Symbol, symbol, 0); 72 CONVERT_ARG_CHECKED(Symbol, symbol, 0);
81 return isolate->heap()->ToBoolean(symbol->is_private()); 73 return isolate->heap()->ToBoolean(symbol->is_private());
82 } 74 }
83 } // namespace internal 75 } // namespace internal
84 } // namespace v8 76 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-simd.cc ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698