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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); | 1672 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); |
1673 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); | 1673 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); |
1674 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); | 1674 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); |
1675 SimpleInstallFunction(math, "atan2", Builtins::kMathAtan2, 2, true); | 1675 SimpleInstallFunction(math, "atan2", Builtins::kMathAtan2, 2, true); |
1676 SimpleInstallFunction(math, "atanh", Builtins::kMathAtanh, 1, true); | 1676 SimpleInstallFunction(math, "atanh", Builtins::kMathAtanh, 1, true); |
1677 SimpleInstallFunction(math, "ceil", Builtins::kMathCeil, 1, true); | 1677 SimpleInstallFunction(math, "ceil", Builtins::kMathCeil, 1, true); |
1678 SimpleInstallFunction(math, "cbrt", Builtins::kMathCbrt, 1, true); | 1678 SimpleInstallFunction(math, "cbrt", Builtins::kMathCbrt, 1, true); |
1679 SimpleInstallFunction(math, "expm1", Builtins::kMathExpm1, 1, true); | 1679 SimpleInstallFunction(math, "expm1", Builtins::kMathExpm1, 1, true); |
1680 SimpleInstallFunction(math, "clz32", Builtins::kMathClz32, 1, true); | 1680 SimpleInstallFunction(math, "clz32", Builtins::kMathClz32, 1, true); |
1681 SimpleInstallFunction(math, "cos", Builtins::kMathCos, 1, true); | 1681 SimpleInstallFunction(math, "cos", Builtins::kMathCos, 1, true); |
| 1682 SimpleInstallFunction(math, "cosh", Builtins::kMathCosh, 1, true); |
1682 Handle<JSFunction> math_exp = | 1683 Handle<JSFunction> math_exp = |
1683 SimpleInstallFunction(math, "exp", Builtins::kMathExp, 1, true); | 1684 SimpleInstallFunction(math, "exp", Builtins::kMathExp, 1, true); |
1684 native_context()->set_math_exp(*math_exp); | 1685 native_context()->set_math_exp(*math_exp); |
1685 Handle<JSFunction> math_floor = | 1686 Handle<JSFunction> math_floor = |
1686 SimpleInstallFunction(math, "floor", Builtins::kMathFloor, 1, true); | 1687 SimpleInstallFunction(math, "floor", Builtins::kMathFloor, 1, true); |
1687 native_context()->set_math_floor(*math_floor); | 1688 native_context()->set_math_floor(*math_floor); |
1688 SimpleInstallFunction(math, "fround", Builtins::kMathFround, 1, true); | 1689 SimpleInstallFunction(math, "fround", Builtins::kMathFround, 1, true); |
1689 SimpleInstallFunction(math, "imul", Builtins::kMathImul, 2, true); | 1690 SimpleInstallFunction(math, "imul", Builtins::kMathImul, 2, true); |
1690 Handle<JSFunction> math_log = | 1691 Handle<JSFunction> math_log = |
1691 SimpleInstallFunction(math, "log", Builtins::kMathLog, 1, true); | 1692 SimpleInstallFunction(math, "log", Builtins::kMathLog, 1, true); |
1692 native_context()->set_math_log(*math_log); | 1693 native_context()->set_math_log(*math_log); |
1693 SimpleInstallFunction(math, "log1p", Builtins::kMathLog1p, 1, true); | 1694 SimpleInstallFunction(math, "log1p", Builtins::kMathLog1p, 1, true); |
1694 SimpleInstallFunction(math, "log2", Builtins::kMathLog2, 1, true); | 1695 SimpleInstallFunction(math, "log2", Builtins::kMathLog2, 1, true); |
1695 SimpleInstallFunction(math, "log10", Builtins::kMathLog10, 1, true); | 1696 SimpleInstallFunction(math, "log10", Builtins::kMathLog10, 1, true); |
1696 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); | 1697 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); |
1697 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); | 1698 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); |
1698 Handle<JSFunction> math_pow = | 1699 Handle<JSFunction> math_pow = |
1699 SimpleInstallFunction(math, "pow", Builtins::kMathPow, 2, true); | 1700 SimpleInstallFunction(math, "pow", Builtins::kMathPow, 2, true); |
1700 native_context()->set_math_pow(*math_pow); | 1701 native_context()->set_math_pow(*math_pow); |
1701 SimpleInstallFunction(math, "round", Builtins::kMathRound, 1, true); | 1702 SimpleInstallFunction(math, "round", Builtins::kMathRound, 1, true); |
1702 SimpleInstallFunction(math, "sin", Builtins::kMathSin, 1, true); | 1703 SimpleInstallFunction(math, "sin", Builtins::kMathSin, 1, true); |
| 1704 SimpleInstallFunction(math, "sinh", Builtins::kMathSinh, 1, true); |
1703 Handle<JSFunction> math_sqrt = | 1705 Handle<JSFunction> math_sqrt = |
1704 SimpleInstallFunction(math, "sqrt", Builtins::kMathSqrt, 1, true); | 1706 SimpleInstallFunction(math, "sqrt", Builtins::kMathSqrt, 1, true); |
1705 native_context()->set_math_sqrt(*math_sqrt); | 1707 native_context()->set_math_sqrt(*math_sqrt); |
1706 SimpleInstallFunction(math, "tan", Builtins::kMathTan, 1, true); | 1708 SimpleInstallFunction(math, "tan", Builtins::kMathTan, 1, true); |
| 1709 SimpleInstallFunction(math, "tanh", Builtins::kMathTanh, 1, true); |
1707 SimpleInstallFunction(math, "trunc", Builtins::kMathTrunc, 1, true); | 1710 SimpleInstallFunction(math, "trunc", Builtins::kMathTrunc, 1, true); |
1708 | 1711 |
1709 // Install math constants. | 1712 // Install math constants. |
1710 double const kE = base::ieee754::exp(1.0); | 1713 double const kE = base::ieee754::exp(1.0); |
1711 JSObject::AddProperty( | 1714 JSObject::AddProperty( |
1712 math, factory->NewStringFromAsciiChecked("E"), factory->NewNumber(kE), | 1715 math, factory->NewStringFromAsciiChecked("E"), factory->NewNumber(kE), |
1713 static_cast<PropertyAttributes>(DONT_DELETE | DONT_ENUM | READ_ONLY)); | 1716 static_cast<PropertyAttributes>(DONT_DELETE | DONT_ENUM | READ_ONLY)); |
1714 JSObject::AddProperty( | 1717 JSObject::AddProperty( |
1715 math, factory->NewStringFromAsciiChecked("LN10"), | 1718 math, factory->NewStringFromAsciiChecked("LN10"), |
1716 factory->NewNumber(base::ieee754::log(10.0)), | 1719 factory->NewNumber(base::ieee754::log(10.0)), |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 Handle<AccessorInfo> script_is_embedder_debug_script = | 2609 Handle<AccessorInfo> script_is_embedder_debug_script = |
2607 Accessors::ScriptIsEmbedderDebugScriptInfo(isolate, attribs); | 2610 Accessors::ScriptIsEmbedderDebugScriptInfo(isolate, attribs); |
2608 { | 2611 { |
2609 AccessorConstantDescriptor d( | 2612 AccessorConstantDescriptor d( |
2610 Handle<Name>(Name::cast(script_is_embedder_debug_script->name())), | 2613 Handle<Name>(Name::cast(script_is_embedder_debug_script->name())), |
2611 script_is_embedder_debug_script, attribs); | 2614 script_is_embedder_debug_script, attribs); |
2612 script_map->AppendDescriptor(&d); | 2615 script_map->AppendDescriptor(&d); |
2613 } | 2616 } |
2614 | 2617 |
2615 { | 2618 { |
2616 // TODO(mvstanton): Remove this when MathSinh, MathCosh and MathTanh are | |
2617 // no longer implemented in fdlibm.js. | |
2618 SimpleInstallFunction(container, "MathExpm1", Builtins::kMathExpm1, 1, | |
2619 true); | |
2620 } | |
2621 | |
2622 { | |
2623 PrototypeIterator iter(native_context->sloppy_async_function_map()); | 2619 PrototypeIterator iter(native_context->sloppy_async_function_map()); |
2624 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>()); | 2620 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>()); |
2625 | 2621 |
2626 static const bool kUseStrictFunctionMap = true; | 2622 static const bool kUseStrictFunctionMap = true; |
2627 Handle<JSFunction> async_function_constructor = InstallFunction( | 2623 Handle<JSFunction> async_function_constructor = InstallFunction( |
2628 container, "AsyncFunction", JS_FUNCTION_TYPE, JSFunction::kSize, | 2624 container, "AsyncFunction", JS_FUNCTION_TYPE, JSFunction::kSize, |
2629 async_function_prototype, Builtins::kAsyncFunctionConstructor, | 2625 async_function_prototype, Builtins::kAsyncFunctionConstructor, |
2630 kUseStrictFunctionMap); | 2626 kUseStrictFunctionMap); |
2631 async_function_constructor->set_prototype_or_initial_map( | 2627 async_function_constructor->set_prototype_or_initial_map( |
2632 native_context->sloppy_async_function_map()); | 2628 native_context->sloppy_async_function_map()); |
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3948 } | 3944 } |
3949 | 3945 |
3950 | 3946 |
3951 // Called when the top-level V8 mutex is destroyed. | 3947 // Called when the top-level V8 mutex is destroyed. |
3952 void Bootstrapper::FreeThreadResources() { | 3948 void Bootstrapper::FreeThreadResources() { |
3953 DCHECK(!IsActive()); | 3949 DCHECK(!IsActive()); |
3954 } | 3950 } |
3955 | 3951 |
3956 } // namespace internal | 3952 } // namespace internal |
3957 } // namespace v8 | 3953 } // namespace v8 |
OLD | NEW |