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

Side by Side Diff: src/math.js

Issue 384003003: Replace AddProperty by AddNamedProperty to speed up the common case (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/i18n.js ('k') | src/messages.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declarations have been made 7 // This file relies on the fact that the following declarations have been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Object = global.Object; 9 // var $Object = global.Object;
10 10
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 (dy - kCosXIntervalTable[index + 1]) * t1)) 253 (dy - kCosXIntervalTable[index + 1]) * t1))
254 * (1 - (phase & 2)) + 0; 254 * (1 - (phase & 2)) + 0;
255 } 255 }
256 256
257 // ------------------------------------------------------------------- 257 // -------------------------------------------------------------------
258 258
259 function SetUpMath() { 259 function SetUpMath() {
260 %CheckIsBootstrapping(); 260 %CheckIsBootstrapping();
261 261
262 %SetPrototype($Math, $Object.prototype); 262 %SetPrototype($Math, $Object.prototype);
263 %AddProperty(global, "Math", $Math, DONT_ENUM); 263 %AddNamedProperty(global, "Math", $Math, DONT_ENUM);
264 %FunctionSetInstanceClassName(MathConstructor, 'Math'); 264 %FunctionSetInstanceClassName(MathConstructor, 'Math');
265 265
266 // Set up math constants. 266 // Set up math constants.
267 InstallConstants($Math, $Array( 267 InstallConstants($Math, $Array(
268 // ECMA-262, section 15.8.1.1. 268 // ECMA-262, section 15.8.1.1.
269 "E", 2.7182818284590452354, 269 "E", 2.7182818284590452354,
270 // ECMA-262, section 15.8.1.2. 270 // ECMA-262, section 15.8.1.2.
271 "LN10", 2.302585092994046, 271 "LN10", 2.302585092994046,
272 // ECMA-262, section 15.8.1.3. 272 // ECMA-262, section 15.8.1.3.
273 "LN2", 0.6931471805599453, 273 "LN2", 0.6931471805599453,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 %SetInlineBuiltinFlag(MathCeil); 306 %SetInlineBuiltinFlag(MathCeil);
307 %SetInlineBuiltinFlag(MathRandom); 307 %SetInlineBuiltinFlag(MathRandom);
308 %SetInlineBuiltinFlag(MathSin); 308 %SetInlineBuiltinFlag(MathSin);
309 %SetInlineBuiltinFlag(MathCos); 309 %SetInlineBuiltinFlag(MathCos);
310 %SetInlineBuiltinFlag(MathTan); 310 %SetInlineBuiltinFlag(MathTan);
311 %SetInlineBuiltinFlag(TrigonometricInterpolation); 311 %SetInlineBuiltinFlag(TrigonometricInterpolation);
312 } 312 }
313 313
314 SetUpMath(); 314 SetUpMath();
OLDNEW
« no previous file with comments | « src/i18n.js ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698