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

Side by Side Diff: src/math.js

Issue 5437002: Add generated code to calculate Math.log and to search Transcendental cache f... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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/ia32/full-codegen-ia32.cc ('k') | src/runtime.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // has to be -0, which wouldn't be the case with the shift. 106 // has to be -0, which wouldn't be the case with the shift.
107 return TO_UINT32(x); 107 return TO_UINT32(x);
108 } else { 108 } else {
109 return %Math_floor(x); 109 return %Math_floor(x);
110 } 110 }
111 } 111 }
112 112
113 // ECMA 262 - 15.8.2.10 113 // ECMA 262 - 15.8.2.10
114 function MathLog(x) { 114 function MathLog(x) {
115 if (!IS_NUMBER(x)) x = ToNumber(x); 115 if (!IS_NUMBER(x)) x = ToNumber(x);
116 return %Math_log(x); 116 return %_MathLog(x);
117 } 117 }
118 118
119 // ECMA 262 - 15.8.2.11 119 // ECMA 262 - 15.8.2.11
120 function MathMax(arg1, arg2) { // length == 2 120 function MathMax(arg1, arg2) { // length == 2
121 var length = %_ArgumentsLength(); 121 var length = %_ArgumentsLength();
122 if (length == 0) { 122 if (length == 0) {
123 return -1/0; // Compiler constant-folds this to -Infinity. 123 return -1/0; // Compiler constant-folds this to -Infinity.
124 } 124 }
125 var r = arg1; 125 var r = arg1;
126 if (!IS_NUMBER(r)) r = ToNumber(r); 126 if (!IS_NUMBER(r)) r = ToNumber(r);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 "tan", MathTan, 255 "tan", MathTan,
256 "atan2", MathAtan2, 256 "atan2", MathAtan2,
257 "pow", MathPow, 257 "pow", MathPow,
258 "max", MathMax, 258 "max", MathMax,
259 "min", MathMin 259 "min", MathMin
260 )); 260 ));
261 }; 261 };
262 262
263 263
264 SetupMath(); 264 SetupMath();
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698