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

Side by Side Diff: src/math.js

Issue 61593008: Magic fix for Math.sin/cos. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updated comments Created 7 years, 1 month 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 | « no previous file | no next file » | 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 // 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
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 // TODO(yangguo): The following table size has been chosen to satisfy
221 // Sunspider's brittle result verification. Reconsider relevance.
222 var samples = 4489;
221 var pi = 3.1415926535897932; 223 var pi = 3.1415926535897932;
222 var pi_half = pi / 2; 224 var pi_half = pi / 2;
223 var inverse_pi_half = 2 / pi; 225 var inverse_pi_half = 2 / pi;
224 var two_pi = 2 * pi; 226 var two_pi = 2 * pi;
225 var four_pi = 4 * pi; 227 var four_pi = 4 * pi;
226 var interval = pi_half / samples; 228 var interval = pi_half / samples;
227 var inverse_interval = samples / pi_half; 229 var inverse_interval = samples / pi_half;
228 var table_sin; 230 var table_sin;
229 var table_cos_interval; 231 var table_cos_interval;
230 232
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 "min", MathMin, 361 "min", MathMin,
360 "imul", MathImul 362 "imul", MathImul
361 )); 363 ));
362 364
363 %SetInlineBuiltinFlag(MathSin); 365 %SetInlineBuiltinFlag(MathSin);
364 %SetInlineBuiltinFlag(MathCos); 366 %SetInlineBuiltinFlag(MathCos);
365 %SetInlineBuiltinFlag(MathTan); 367 %SetInlineBuiltinFlag(MathTan);
366 } 368 }
367 369
368 SetUpMath(); 370 SetUpMath();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698