Cleanup SetUpMath to use InstallConstants helper.

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/127863002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 90fdb821
...@@ -285,44 +285,20 @@ function SetUpMath() { ...@@ -285,44 +285,20 @@ function SetUpMath() {
%FunctionSetInstanceClassName(MathConstructor, 'Math'); %FunctionSetInstanceClassName(MathConstructor, 'Math');
// Set up math constants. // Set up math constants.
// ECMA-262, section 15.8.1.1. InstallConstants($Math, $Array(
%OptimizeObjectForAddingMultipleProperties($Math, 8); // ECMA-262, section 15.8.1.1.
%SetProperty($Math, "E", 2.7182818284590452354,
"E", // ECMA-262, section 15.8.1.2.
2.7182818284590452354, "LN10", 2.302585092994046,
DONT_ENUM | DONT_DELETE | READ_ONLY); // ECMA-262, section 15.8.1.3.
// ECMA-262, section 15.8.1.2. "LN2", 0.6931471805599453,
%SetProperty($Math, // ECMA-262, section 15.8.1.4.
"LN10", "LOG2E", 1.4426950408889634,
2.302585092994046, "LOG10E", 0.4342944819032518,
DONT_ENUM | DONT_DELETE | READ_ONLY); "PI", 3.1415926535897932,
// ECMA-262, section 15.8.1.3. "SQRT1_2", 0.7071067811865476,
%SetProperty($Math, "SQRT2", 1.4142135623730951
"LN2", ));
0.6931471805599453,
DONT_ENUM | DONT_DELETE | READ_ONLY);
// ECMA-262, section 15.8.1.4.
%SetProperty($Math,
"LOG2E",
1.4426950408889634,
DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetProperty($Math,
"LOG10E",
0.4342944819032518,
DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetProperty($Math,
"PI",
3.1415926535897932,
DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetProperty($Math,
"SQRT1_2",
0.7071067811865476,
DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetProperty($Math,
"SQRT2",
1.4142135623730951,
DONT_ENUM | DONT_DELETE | READ_ONLY);
%ToFastProperties($Math);
// Set up non-enumerable functions of the Math object and // Set up non-enumerable functions of the Math object and
// set their names. // set their names.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment