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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 SimpleInstallFunction(number_fun, "isNaN", Builtins::kNumberIsNaN, 1, true); | 1440 SimpleInstallFunction(number_fun, "isNaN", Builtins::kNumberIsNaN, 1, true); |
1441 SimpleInstallFunction(number_fun, "isSafeInteger", | 1441 SimpleInstallFunction(number_fun, "isSafeInteger", |
1442 Builtins::kNumberIsSafeInteger, 1, true); | 1442 Builtins::kNumberIsSafeInteger, 1, true); |
1443 | 1443 |
1444 // Install Number.parseFloat and Global.parseFloat. | 1444 // Install Number.parseFloat and Global.parseFloat. |
1445 Handle<JSFunction> parse_float_fun = SimpleInstallFunction( | 1445 Handle<JSFunction> parse_float_fun = SimpleInstallFunction( |
1446 number_fun, "parseFloat", Builtins::kNumberParseFloat, 1, true); | 1446 number_fun, "parseFloat", Builtins::kNumberParseFloat, 1, true); |
1447 JSObject::AddProperty(global_object, | 1447 JSObject::AddProperty(global_object, |
1448 factory->NewStringFromAsciiChecked("parseFloat"), | 1448 factory->NewStringFromAsciiChecked("parseFloat"), |
1449 parse_float_fun, DONT_ENUM); | 1449 parse_float_fun, DONT_ENUM); |
| 1450 |
| 1451 // Install Number.parseInt and Global.parseInt. |
| 1452 Handle<JSFunction> parse_int_fun = SimpleInstallFunction( |
| 1453 number_fun, "parseInt", Builtins::kNumberParseInt, 2, true); |
| 1454 JSObject::AddProperty(global_object, |
| 1455 factory->NewStringFromAsciiChecked("parseInt"), |
| 1456 parse_int_fun, DONT_ENUM); |
1450 } | 1457 } |
1451 | 1458 |
1452 { // --- B o o l e a n --- | 1459 { // --- B o o l e a n --- |
1453 Handle<JSFunction> boolean_fun = | 1460 Handle<JSFunction> boolean_fun = |
1454 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, | 1461 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, |
1455 isolate->initial_object_prototype(), | 1462 isolate->initial_object_prototype(), |
1456 Builtins::kBooleanConstructor); | 1463 Builtins::kBooleanConstructor); |
1457 boolean_fun->shared()->DontAdaptArguments(); | 1464 boolean_fun->shared()->DontAdaptArguments(); |
1458 boolean_fun->shared()->SetConstructStub( | 1465 boolean_fun->shared()->SetConstructStub( |
1459 *isolate->builtins()->BooleanConstructor_ConstructStub()); | 1466 *isolate->builtins()->BooleanConstructor_ConstructStub()); |
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4564 } | 4571 } |
4565 | 4572 |
4566 | 4573 |
4567 // Called when the top-level V8 mutex is destroyed. | 4574 // Called when the top-level V8 mutex is destroyed. |
4568 void Bootstrapper::FreeThreadResources() { | 4575 void Bootstrapper::FreeThreadResources() { |
4569 DCHECK(!IsActive()); | 4576 DCHECK(!IsActive()); |
4570 } | 4577 } |
4571 | 4578 |
4572 } // namespace internal | 4579 } // namespace internal |
4573 } // namespace v8 | 4580 } // namespace v8 |
OLD | NEW |