OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 | 1662 |
1663 { // -- M a t h | 1663 { // -- M a t h |
1664 Handle<String> name = factory->InternalizeUtf8String("Math"); | 1664 Handle<String> name = factory->InternalizeUtf8String("Math"); |
1665 Handle<JSFunction> cons = factory->NewFunction(name); | 1665 Handle<JSFunction> cons = factory->NewFunction(name); |
1666 JSFunction::SetInstancePrototype( | 1666 JSFunction::SetInstancePrototype( |
1667 cons, | 1667 cons, |
1668 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | 1668 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
1669 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); | 1669 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); |
1670 DCHECK(math->IsJSObject()); | 1670 DCHECK(math->IsJSObject()); |
1671 JSObject::AddProperty(global, name, math, DONT_ENUM); | 1671 JSObject::AddProperty(global, name, math, DONT_ENUM); |
| 1672 Handle<JSFunction> math_abs = |
| 1673 SimpleInstallFunction(math, "abs", Builtins::kMathAbs, 1, true); |
| 1674 native_context()->set_math_abs(*math_abs); |
1672 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); | 1675 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); |
1673 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); | 1676 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); |
1674 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); | 1677 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); |
1675 SimpleInstallFunction(math, "atan2", Builtins::kMathAtan2, 2, true); | 1678 SimpleInstallFunction(math, "atan2", Builtins::kMathAtan2, 2, true); |
1676 SimpleInstallFunction(math, "atanh", Builtins::kMathAtanh, 1, true); | 1679 SimpleInstallFunction(math, "atanh", Builtins::kMathAtanh, 1, true); |
1677 SimpleInstallFunction(math, "ceil", Builtins::kMathCeil, 1, true); | 1680 SimpleInstallFunction(math, "ceil", Builtins::kMathCeil, 1, true); |
1678 SimpleInstallFunction(math, "cbrt", Builtins::kMathCbrt, 1, true); | 1681 SimpleInstallFunction(math, "cbrt", Builtins::kMathCbrt, 1, true); |
1679 SimpleInstallFunction(math, "expm1", Builtins::kMathExpm1, 1, true); | 1682 SimpleInstallFunction(math, "expm1", Builtins::kMathExpm1, 1, true); |
1680 SimpleInstallFunction(math, "clz32", Builtins::kMathClz32, 1, true); | 1683 SimpleInstallFunction(math, "clz32", Builtins::kMathClz32, 1, true); |
1681 SimpleInstallFunction(math, "cos", Builtins::kMathCos, 1, true); | 1684 SimpleInstallFunction(math, "cos", Builtins::kMathCos, 1, true); |
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 } | 3947 } |
3945 | 3948 |
3946 | 3949 |
3947 // Called when the top-level V8 mutex is destroyed. | 3950 // Called when the top-level V8 mutex is destroyed. |
3948 void Bootstrapper::FreeThreadResources() { | 3951 void Bootstrapper::FreeThreadResources() { |
3949 DCHECK(!IsActive()); | 3952 DCHECK(!IsActive()); |
3950 } | 3953 } |
3951 | 3954 |
3952 } // namespace internal | 3955 } // namespace internal |
3953 } // namespace v8 | 3956 } // namespace v8 |
OLD | NEW |