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

Side by Side Diff: src/prologue.js

Issue 1294803004: Native context: run prologue.js before runtime.js (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: also change BUILD.gn 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/bootstrapper.cc ('k') | src/runtime.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 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 for (var i = 0; i < constants.length; i += 2) { 69 for (var i = 0; i < constants.length; i += 2) {
70 var name = constants[i]; 70 var name = constants[i];
71 var k = constants[i + 1]; 71 var k = constants[i + 1];
72 %AddNamedProperty(object, name, k, attributes); 72 %AddNamedProperty(object, name, k, attributes);
73 } 73 }
74 %ToFastProperties(object); 74 %ToFastProperties(object);
75 } 75 }
76 76
77 77
78 function InstallFunctions(object, attributes, functions) { 78 function InstallFunctions(object, attributes, functions) {
79 %CheckIsBootstrapping(); 79 %InstallFunctionsFromArray(object, attributes, functions);
80 %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
81 for (var i = 0; i < functions.length; i += 2) {
82 var key = functions[i];
83 var f = functions[i + 1];
84 SetFunctionName(f, key);
85 %FunctionRemovePrototype(f);
86 %AddNamedProperty(object, key, f, attributes);
87 %SetNativeFlag(f);
88 }
89 %ToFastProperties(object);
90 } 80 }
91 81
92 82
93 // Helper function to install a getter-only accessor property. 83 // Helper function to install a getter-only accessor property.
94 function InstallGetter(object, name, getter, attributes) { 84 function InstallGetter(object, name, getter, attributes) {
95 %CheckIsBootstrapping(); 85 %CheckIsBootstrapping();
96 if (typeof attributes == "undefined") { 86 if (typeof attributes == "undefined") {
97 attributes = DONT_ENUM; 87 attributes = DONT_ENUM;
98 } 88 }
99 SetFunctionName(getter, name, "get"); 89 SetFunctionName(getter, name, "get");
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 "InstallConstants", InstallConstants, 249 "InstallConstants", InstallConstants,
260 "InstallFunctions", InstallFunctions, 250 "InstallFunctions", InstallFunctions,
261 "InstallGetter", InstallGetter, 251 "InstallGetter", InstallGetter,
262 "InstallGetterSetter", InstallGetterSetter, 252 "InstallGetterSetter", InstallGetterSetter,
263 "SetUpLockedPrototype", SetUpLockedPrototype, 253 "SetUpLockedPrototype", SetUpLockedPrototype,
264 "PostNatives", PostNatives, 254 "PostNatives", PostNatives,
265 "PostExperimentals", PostExperimentals, 255 "PostExperimentals", PostExperimentals,
266 "PostDebug", PostDebug, 256 "PostDebug", PostDebug,
267 ]); 257 ]);
268 258
269 // TODO(yangguo): run prologue.js before runtime.js
270 ExportToRuntime(function(to) {
271 to.ToNumber = $toNumber;
272 to.ToString = $toString;
273 to.ToInteger = $toInteger;
274 to.ToLength = $toLength;
275 });
276
277 }) 259 })
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698