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 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 { // -- M a t h | 1553 { // -- M a t h |
1554 Handle<String> name = factory->InternalizeUtf8String("Math"); | 1554 Handle<String> name = factory->InternalizeUtf8String("Math"); |
1555 Handle<JSFunction> cons = factory->NewFunction(name); | 1555 Handle<JSFunction> cons = factory->NewFunction(name); |
1556 JSFunction::SetInstancePrototype( | 1556 JSFunction::SetInstancePrototype( |
1557 cons, | 1557 cons, |
1558 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | 1558 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
1559 cons->shared()->set_instance_class_name(*name); | 1559 cons->shared()->set_instance_class_name(*name); |
1560 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); | 1560 Handle<JSObject> math = factory->NewJSObject(cons, TENURED); |
1561 DCHECK(math->IsJSObject()); | 1561 DCHECK(math->IsJSObject()); |
1562 JSObject::AddProperty(global, name, math, DONT_ENUM); | 1562 JSObject::AddProperty(global, name, math, DONT_ENUM); |
| 1563 SimpleInstallFunction(math, "acos", Builtins::kMathAcos, 1, true); |
| 1564 SimpleInstallFunction(math, "asin", Builtins::kMathAsin, 1, true); |
| 1565 SimpleInstallFunction(math, "atan", Builtins::kMathAtan, 1, true); |
| 1566 SimpleInstallFunction(math, "fround", Builtins::kMathFround, 1, true); |
| 1567 SimpleInstallFunction(math, "imul", Builtins::kMathImul, 2, true); |
1563 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); | 1568 SimpleInstallFunction(math, "max", Builtins::kMathMax, 2, false); |
1564 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); | 1569 SimpleInstallFunction(math, "min", Builtins::kMathMin, 2, false); |
1565 } | 1570 } |
1566 | 1571 |
1567 { // -- A r r a y B u f f e r | 1572 { // -- A r r a y B u f f e r |
1568 Handle<JSFunction> array_buffer_fun = | 1573 Handle<JSFunction> array_buffer_fun = |
1569 InstallArrayBuffer(global, "ArrayBuffer"); | 1574 InstallArrayBuffer(global, "ArrayBuffer"); |
1570 InstallWithIntrinsicDefaultProto(isolate, array_buffer_fun, | 1575 InstallWithIntrinsicDefaultProto(isolate, array_buffer_fun, |
1571 Context::ARRAY_BUFFER_FUN_INDEX); | 1576 Context::ARRAY_BUFFER_FUN_INDEX); |
1572 } | 1577 } |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3673 } | 3678 } |
3674 | 3679 |
3675 | 3680 |
3676 // Called when the top-level V8 mutex is destroyed. | 3681 // Called when the top-level V8 mutex is destroyed. |
3677 void Bootstrapper::FreeThreadResources() { | 3682 void Bootstrapper::FreeThreadResources() { |
3678 DCHECK(!IsActive()); | 3683 DCHECK(!IsActive()); |
3679 } | 3684 } |
3680 | 3685 |
3681 } // namespace internal | 3686 } // namespace internal |
3682 } // namespace v8 | 3687 } // namespace v8 |
OLD | NEW |