OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 var InitTrigonometricFunctions; | 213 var InitTrigonometricFunctions; |
214 | 214 |
215 | 215 |
216 // Define constants and interpolation functions. | 216 // Define constants and interpolation functions. |
217 // Also define the initialization function that populates the lookup table | 217 // Also define the initialization function that populates the lookup table |
218 // and then wires up the function definitions. | 218 // and then wires up the function definitions. |
219 function SetupTrigonometricFunctions() { | 219 function SetupTrigonometricFunctions() { |
220 var samples = 1800; // Table size. | 220 var samples = 4489; // Table size. Chosen to satisify Sunspider. |
Jakob Kummerow
2013/11/14 09:56:07
nit: s/isi/is/
But high-level, I think it's worth
| |
221 var pi = 3.1415926535897932; | 221 var pi = 3.1415926535897932; |
222 var pi_half = pi / 2; | 222 var pi_half = pi / 2; |
223 var inverse_pi_half = 2 / pi; | 223 var inverse_pi_half = 2 / pi; |
224 var two_pi = 2 * pi; | 224 var two_pi = 2 * pi; |
225 var four_pi = 4 * pi; | 225 var four_pi = 4 * pi; |
226 var interval = pi_half / samples; | 226 var interval = pi_half / samples; |
227 var inverse_interval = samples / pi_half; | 227 var inverse_interval = samples / pi_half; |
228 var table_sin; | 228 var table_sin; |
229 var table_cos_interval; | 229 var table_cos_interval; |
230 | 230 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 "min", MathMin, | 359 "min", MathMin, |
360 "imul", MathImul | 360 "imul", MathImul |
361 )); | 361 )); |
362 | 362 |
363 %SetInlineBuiltinFlag(MathSin); | 363 %SetInlineBuiltinFlag(MathSin); |
364 %SetInlineBuiltinFlag(MathCos); | 364 %SetInlineBuiltinFlag(MathCos); |
365 %SetInlineBuiltinFlag(MathTan); | 365 %SetInlineBuiltinFlag(MathTan); |
366 } | 366 } |
367 | 367 |
368 SetUpMath(); | 368 SetUpMath(); |
OLD | NEW |