OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 for (var i = 0; i < methods.length; i += 2) { | 149 for (var i = 0; i < methods.length; i += 2) { |
150 var key = methods[i]; | 150 var key = methods[i]; |
151 var f = methods[i + 1]; | 151 var f = methods[i + 1]; |
152 %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); | 152 %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); |
153 %SetNativeFlag(f); | 153 %SetNativeFlag(f); |
154 } | 154 } |
155 %InternalSetPrototype(prototype, null); | 155 %InternalSetPrototype(prototype, null); |
156 %ToFastProperties(prototype); | 156 %ToFastProperties(prototype); |
157 } | 157 } |
158 | 158 |
| 159 |
| 160 var private_symbols = %ExportPrivateSymbols({}); |
| 161 |
| 162 function GetPrivateSymbol(name) { |
| 163 return private_symbols[name]; |
| 164 } |
| 165 |
159 // ----------------------------------------------------------------------- | 166 // ----------------------------------------------------------------------- |
160 // To be called by bootstrapper | 167 // To be called by bootstrapper |
161 | 168 |
162 function PostNatives(utils) { | 169 function PostNatives(utils) { |
163 %CheckIsBootstrapping(); | 170 %CheckIsBootstrapping(); |
164 | 171 |
165 for ( ; !IS_UNDEFINED(imports); imports = imports.next) { | 172 for ( ; !IS_UNDEFINED(imports); imports = imports.next) { |
166 imports(exports_container); | 173 imports(exports_container); |
167 } | 174 } |
168 | 175 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 imports_from_experimental(exports_container); | 236 imports_from_experimental(exports_container); |
230 } | 237 } |
231 var runtime_container = {}; | 238 var runtime_container = {}; |
232 for ( ; !IS_UNDEFINED(exports_to_runtime); | 239 for ( ; !IS_UNDEFINED(exports_to_runtime); |
233 exports_to_runtime = exports_to_runtime.next) { | 240 exports_to_runtime = exports_to_runtime.next) { |
234 exports_to_runtime(runtime_container); | 241 exports_to_runtime(runtime_container); |
235 } | 242 } |
236 %ImportExperimentalToRuntime(runtime_container); | 243 %ImportExperimentalToRuntime(runtime_container); |
237 | 244 |
238 exports_container = UNDEFINED; | 245 exports_container = UNDEFINED; |
| 246 private_symbols = UNDEFINED; |
239 | 247 |
240 utils.PostExperimentals = UNDEFINED; | 248 utils.PostExperimentals = UNDEFINED; |
241 utils.PostDebug = UNDEFINED; | 249 utils.PostDebug = UNDEFINED; |
242 utils.Import = UNDEFINED; | 250 utils.Import = UNDEFINED; |
243 utils.Export = UNDEFINED; | 251 utils.Export = UNDEFINED; |
244 } | 252 } |
245 | 253 |
246 | 254 |
247 function PostDebug(utils) { | 255 function PostDebug(utils) { |
248 for ( ; !IS_UNDEFINED(imports); imports = imports.next) { | 256 for ( ; !IS_UNDEFINED(imports); imports = imports.next) { |
249 imports(exports_container); | 257 imports(exports_container); |
250 } | 258 } |
251 | 259 |
252 exports_container = UNDEFINED; | 260 exports_container = UNDEFINED; |
| 261 private_symbols = UNDEFINED; |
253 | 262 |
254 utils.PostDebug = UNDEFINED; | 263 utils.PostDebug = UNDEFINED; |
255 utils.PostExperimentals = UNDEFINED; | 264 utils.PostExperimentals = UNDEFINED; |
256 utils.Import = UNDEFINED; | 265 utils.Import = UNDEFINED; |
257 utils.Export = UNDEFINED; | 266 utils.Export = UNDEFINED; |
258 } | 267 } |
259 | 268 |
260 // ----------------------------------------------------------------------- | 269 // ----------------------------------------------------------------------- |
261 | 270 |
262 %OptimizeObjectForAddingMultipleProperties(utils, 14); | 271 %OptimizeObjectForAddingMultipleProperties(utils, 15); |
263 | 272 |
264 utils.Import = Import; | 273 utils.Import = Import; |
265 utils.ImportNow = ImportNow; | 274 utils.ImportNow = ImportNow; |
266 utils.Export = Export; | 275 utils.Export = Export; |
267 utils.ExportToRuntime = ExportToRuntime; | 276 utils.ExportToRuntime = ExportToRuntime; |
268 utils.ImportFromExperimental = ImportFromExperimental; | 277 utils.ImportFromExperimental = ImportFromExperimental; |
| 278 utils.GetPrivateSymbol = GetPrivateSymbol; |
269 utils.SetFunctionName = SetFunctionName; | 279 utils.SetFunctionName = SetFunctionName; |
270 utils.InstallConstants = InstallConstants; | 280 utils.InstallConstants = InstallConstants; |
271 utils.InstallFunctions = InstallFunctions; | 281 utils.InstallFunctions = InstallFunctions; |
272 utils.InstallGetter = InstallGetter; | 282 utils.InstallGetter = InstallGetter; |
273 utils.InstallGetterSetter = InstallGetterSetter; | 283 utils.InstallGetterSetter = InstallGetterSetter; |
274 utils.SetUpLockedPrototype = SetUpLockedPrototype; | 284 utils.SetUpLockedPrototype = SetUpLockedPrototype; |
275 utils.PostNatives = PostNatives; | 285 utils.PostNatives = PostNatives; |
276 utils.PostExperimentals = PostExperimentals; | 286 utils.PostExperimentals = PostExperimentals; |
277 utils.PostDebug = PostDebug; | 287 utils.PostDebug = PostDebug; |
278 | 288 |
279 %ToFastProperties(utils); | 289 %ToFastProperties(utils); |
280 | 290 |
281 }) | 291 }) |
OLD | NEW |