Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 | 194 |
| 195 | 195 |
| 196 // ------------------------------------------------------------------- | 196 // ------------------------------------------------------------------- |
| 197 | 197 |
| 198 function SetupMath() { | 198 function SetupMath() { |
| 199 // Setup math constants. | 199 // Setup math constants. |
| 200 // ECMA-262, section 15.8.1.1. | 200 // ECMA-262, section 15.8.1.1. |
| 201 %OptimizeObjectForAddingMultipleProperties($Math, 8); | 201 %OptimizeObjectForAddingMultipleProperties($Math, 8); |
| 202 %SetProperty($Math, | 202 %SetProperty($Math, |
| 203 "E", | 203 "E", |
| 204 2.7182818284590452354, | 204 2.718281828459045, |
|
Mads Ager (chromium)
2011/02/11 11:06:57
We could keep the extra digits on this one to matc
| |
| 205 DONT_ENUM | DONT_DELETE | READ_ONLY); | 205 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 206 // ECMA-262, section 15.8.1.2. | 206 // ECMA-262, section 15.8.1.2. |
| 207 %SetProperty($Math, | 207 %SetProperty($Math, |
| 208 "LN10", | 208 "LN10", |
| 209 2.302585092994046, | 209 2.302585092994046, |
| 210 DONT_ENUM | DONT_DELETE | READ_ONLY); | 210 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 211 // ECMA-262, section 15.8.1.3. | 211 // ECMA-262, section 15.8.1.3. |
| 212 %SetProperty($Math, | 212 %SetProperty($Math, |
| 213 "LN2", | 213 "LN2", |
| 214 0.6931471805599453, | 214 0.6931471805599453, |
| 215 DONT_ENUM | DONT_DELETE | READ_ONLY); | 215 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 216 // ECMA-262, section 15.8.1.4. | 216 // ECMA-262, section 15.8.1.4. |
| 217 %SetProperty($Math, | 217 %SetProperty($Math, |
| 218 "LOG2E", | 218 "LOG2E", |
| 219 1.4426950408889634, | 219 1.4426950408889634, |
| 220 DONT_ENUM | DONT_DELETE | READ_ONLY); | 220 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 221 %SetProperty($Math, | 221 %SetProperty($Math, |
| 222 "LOG10E", | 222 "LOG10E", |
| 223 0.43429448190325176, | 223 0.4342944819032518, |
| 224 DONT_ENUM | DONT_DELETE | READ_ONLY); | 224 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 225 %SetProperty($Math, | 225 %SetProperty($Math, |
| 226 "PI", | 226 "PI", |
| 227 3.1415926535897932, | 227 3.141592653589793, |
|
Mads Ager (chromium)
2011/02/11 11:06:57
Ditto.
| |
| 228 DONT_ENUM | DONT_DELETE | READ_ONLY); | 228 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 229 %SetProperty($Math, | 229 %SetProperty($Math, |
| 230 "SQRT1_2", | 230 "SQRT1_2", |
| 231 0.7071067811865476, | 231 0.7071067811865476, |
| 232 DONT_ENUM | DONT_DELETE | READ_ONLY); | 232 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 233 %SetProperty($Math, | 233 %SetProperty($Math, |
| 234 "SQRT2", | 234 "SQRT2", |
| 235 1.4142135623730951, | 235 1.4142135623730951, |
| 236 DONT_ENUM | DONT_DELETE | READ_ONLY); | 236 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 237 %ToFastProperties($Math); | 237 %ToFastProperties($Math); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 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(); |
| OLD | NEW |