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

Side by Side Diff: src/symbol.js

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/string-iterator.js ('k') | src/v8natives.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 // Expects following symbols to be set in the bootstrapper during genesis: 5 // Expects following symbols to be set in the bootstrapper during genesis:
6 // - symbolHasInstance 6 // - symbolHasInstance
7 // - symbolIsConcatSpreadable 7 // - symbolIsConcatSpreadable
8 // - symbolIsRegExp 8 // - symbolIsRegExp
9 // - symbolIterator 9 // - symbolIterator
10 // - symbolToStringTag 10 // - symbolToStringTag
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 72
73 function SymbolKeyFor(symbol) { 73 function SymbolKeyFor(symbol) {
74 if (!IS_SYMBOL(symbol)) throw MakeTypeError(kSymbolKeyFor, symbol); 74 if (!IS_SYMBOL(symbol)) throw MakeTypeError(kSymbolKeyFor, symbol);
75 return %SymbolRegistry().keyFor[symbol]; 75 return %SymbolRegistry().keyFor[symbol];
76 } 76 }
77 77
78 78
79 // ES6 19.1.2.8 79 // ES6 19.1.2.8
80 function ObjectGetOwnPropertySymbols(obj) { 80 function ObjectGetOwnPropertySymbols(obj) {
81 obj = $toObject(obj); 81 obj = TO_OBJECT(obj);
82 82
83 // TODO(arv): Proxies use a shared trap for String and Symbol keys. 83 // TODO(arv): Proxies use a shared trap for String and Symbol keys.
84 84
85 return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_STRING); 85 return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_STRING);
86 } 86 }
87 87
88 //------------------------------------------------------------------- 88 //-------------------------------------------------------------------
89 89
90 %SetCode(GlobalSymbol, SymbolConstructor); 90 %SetCode(GlobalSymbol, SymbolConstructor);
91 %FunctionSetPrototype(GlobalSymbol, new GlobalObject()); 91 %FunctionSetPrototype(GlobalSymbol, new GlobalObject());
(...skipping 25 matching lines...) Expand all
117 "valueOf", SymbolValueOf 117 "valueOf", SymbolValueOf
118 ]); 118 ]);
119 119
120 utils.InstallFunctions(GlobalObject, DONT_ENUM, [ 120 utils.InstallFunctions(GlobalObject, DONT_ENUM, [
121 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols 121 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols
122 ]); 122 ]);
123 123
124 $symbolToString = SymbolToString; 124 $symbolToString = SymbolToString;
125 125
126 }) 126 })
OLDNEW
« no previous file with comments | « src/string-iterator.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698