OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 (function(global, utils) { | |
6 | |
7 "use strict"; | |
8 | |
9 %CheckIsBootstrapping(); | |
10 | |
11 // ----------------------------------------------------------------------- | |
12 // Utils | |
13 | |
14 var imports = UNDEFINED; | |
15 var exports = UNDEFINED; | |
16 | |
17 | |
18 utils.Export = function Export(f) { | |
19 f.next = exports; | |
20 exports = f; | |
21 }; | |
22 | |
23 | |
24 utils.Import = function Import(f) { | |
25 f.next = imports; | |
26 imports = f; | |
27 }; | |
28 | |
29 // ----------------------------------------------------------------------- | |
30 // To be called by bootstrapper | |
31 | |
32 utils.PostNatives = function() { | |
33 %CheckIsBootstrapping(); | |
34 | |
35 var container = {}; | |
36 for ( ; !IS_UNDEFINED(exports); exports = exports.next) exports(container); | |
37 for ( ; !IS_UNDEFINED(imports); imports = imports.next) imports(container); | |
38 | |
39 var expose_to_experimental = [ | |
40 "MathMax", | |
41 "MathMin", | |
42 ]; | |
43 var experimental = {}; | |
44 %OptimizeObjectForAddingMultipleProperties( | |
45 experimental, expose_to_experimental.length); | |
46 for (var key of expose_to_experimental) experimental[key] = container[key]; | |
47 %ToFastProperties(experimental); | |
48 container = UNDEFINED; | |
49 | |
50 utils.Export = UNDEFINED; | |
51 utils.PostNatives = UNDEFINED; | |
52 utils.Import = function ImportFromExperimental(f) { | |
53 f(experimental); | |
54 }; | |
55 }; | |
56 | |
57 }) | |
OLD | NEW |