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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 JSFunction::SetInstancePrototype( | 1512 JSFunction::SetInstancePrototype( |
1513 cons, | 1513 cons, |
1514 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | 1514 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
1515 cons->shared()->set_instance_class_name(*name); | 1515 cons->shared()->set_instance_class_name(*name); |
1516 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); | 1516 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); |
1517 DCHECK(math->IsJSObject()); | 1517 DCHECK(math->IsJSObject()); |
1518 JSObject::AddProperty(global, name, math, DONT_ENUM); | 1518 JSObject::AddProperty(global, name, math, DONT_ENUM); |
1519 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); | 1519 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); |
1520 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); | 1520 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); |
1521 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); | 1521 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); |
| 1522 SimpleInstallFunction(math, "ceil", Builtins::kMathCeil, 1, true); |
1522 Handle<JSFunction> math_floor = | 1523 Handle<JSFunction> math_floor = |
1523 SimpleInstallFunction(math, "floor", Builtins::kMathFloor, 1, true); | 1524 SimpleInstallFunction(math, "floor", Builtins::kMathFloor, 1, true); |
1524 native_context()->set_math_floor(*math_floor); | 1525 native_context()->set_math_floor(*math_floor); |
1525 SimpleInstallFunction(math, "fround", Builtins::kMathFround, 1, true); | 1526 SimpleInstallFunction(math, "fround", Builtins::kMathFround, 1, true); |
1526 SimpleInstallFunction(math, "imul", Builtins::kMathImul, 2, true); | 1527 SimpleInstallFunction(math, "imul", Builtins::kMathImul, 2, true); |
1527 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); | 1528 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); |
1528 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); | 1529 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); |
| 1530 SimpleInstallFunction(math, "round", Builtins::kMathRound, 1, true); |
1529 Handle<JSFunction> math_sqrt = | 1531 Handle<JSFunction> math_sqrt = |
1530 SimpleInstallFunction(math, "sqrt", Builtins::kMathSqrt, 1, true); | 1532 SimpleInstallFunction(math, "sqrt", Builtins::kMathSqrt, 1, true); |
1531 native_context()->set_math_sqrt(*math_sqrt); | 1533 native_context()->set_math_sqrt(*math_sqrt); |
| 1534 SimpleInstallFunction(math, "trunc", Builtins::kMathTrunc, 1, true); |
1532 } | 1535 } |
1533 | 1536 |
1534 { // -- A r r a y B u f f e r | 1537 { // -- A r r a y B u f f e r |
1535 Handle<JSFunction> array_buffer_fun = | 1538 Handle<JSFunction> array_buffer_fun = |
1536 InstallArrayBuffer(global, "ArrayBuffer"); | 1539 InstallArrayBuffer(global, "ArrayBuffer"); |
1537 InstallWithIntrinsicDefaultProto(isolate, array_buffer_fun, | 1540 InstallWithIntrinsicDefaultProto(isolate, array_buffer_fun, |
1538 Context::ARRAY_BUFFER_FUN_INDEX); | 1541 Context::ARRAY_BUFFER_FUN_INDEX); |
1539 } | 1542 } |
1540 | 1543 |
1541 { // -- T y p e d A r r a y s | 1544 { // -- T y p e d A r r a y s |
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3627 } | 3630 } |
3628 | 3631 |
3629 | 3632 |
3630 // Called when the top-level V8 mutex is destroyed. | 3633 // Called when the top-level V8 mutex is destroyed. |
3631 void Bootstrapper::FreeThreadResources() { | 3634 void Bootstrapper::FreeThreadResources() { |
3632 DCHECK(!IsActive()); | 3635 DCHECK(!IsActive()); |
3633 } | 3636 } |
3634 | 3637 |
3635 } // namespace internal | 3638 } // namespace internal |
3636 } // namespace v8 | 3639 } // namespace v8 |
OLD | NEW |