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

Side by Side Diff: src/harmony-math.js

Issue 280243002: Avoid name clashes of builtins and runtime functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/collection.js ('k') | src/hydrogen.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 // ES6 draft 09-27-13, section 20.2.2.28. 7 // ES6 draft 09-27-13, section 20.2.2.28.
8 function MathSign(x) { 8 function MathSign(x) {
9 x = TO_NUMBER_INLINE(x); 9 x = TO_NUMBER_INLINE(x);
10 if (x > 0) return 1; 10 if (x > 0) return 1;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 var summand = n * n - compensation; 125 var summand = n * n - compensation;
126 var preliminary = sum + summand; 126 var preliminary = sum + summand;
127 compensation = (preliminary - sum) - summand; 127 compensation = (preliminary - sum) - summand;
128 sum = preliminary; 128 sum = preliminary;
129 } 129 }
130 return MathSqrt(sum) * max; 130 return MathSqrt(sum) * max;
131 } 131 }
132 132
133 133
134 // ES6 draft 09-27-13, section 20.2.2.16. 134 // ES6 draft 09-27-13, section 20.2.2.16.
135 function MathFround(x) { 135 function MathFroundJS(x) {
136 return %MathFround(TO_NUMBER_INLINE(x)); 136 return %MathFround(TO_NUMBER_INLINE(x));
137 } 137 }
138 138
139 139
140 function MathClz32(x) { 140 function MathClz32(x) {
141 x = ToUint32(TO_NUMBER_INLINE(x)); 141 x = ToUint32(TO_NUMBER_INLINE(x));
142 if (x == 0) return 32; 142 if (x == 0) return 32;
143 var result = 0; 143 var result = 0;
144 // Binary search. 144 // Binary search.
145 if ((x & 0xFFFF0000) === 0) { x <<= 16; result += 16; }; 145 if ((x & 0xFFFF0000) === 0) { x <<= 16; result += 16; };
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 "trunc", MathTrunc, 227 "trunc", MathTrunc,
228 "sinh", MathSinh, 228 "sinh", MathSinh,
229 "cosh", MathCosh, 229 "cosh", MathCosh,
230 "tanh", MathTanh, 230 "tanh", MathTanh,
231 "asinh", MathAsinh, 231 "asinh", MathAsinh,
232 "acosh", MathAcosh, 232 "acosh", MathAcosh,
233 "atanh", MathAtanh, 233 "atanh", MathAtanh,
234 "log10", MathLog10, 234 "log10", MathLog10,
235 "log2", MathLog2, 235 "log2", MathLog2,
236 "hypot", MathHypot, 236 "hypot", MathHypot,
237 "fround", MathFround, 237 "fround", MathFroundJS,
238 "clz32", MathClz32, 238 "clz32", MathClz32,
239 "cbrt", MathCbrt, 239 "cbrt", MathCbrt,
240 "log1p", MathLog1p, 240 "log1p", MathLog1p,
241 "expm1", MathExpm1 241 "expm1", MathExpm1
242 )); 242 ));
243 } 243 }
244 244
245 245
246 ExtendMath(); 246 ExtendMath();
OLDNEW
« no previous file with comments | « src/collection.js ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698