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

Side by Side Diff: src/prologue.js

Issue 1143993003: Use shared container to manage imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed test for no-snap Created 5 years, 7 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/object-observe.js ('k') | src/promise.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 })
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698