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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 SimpleInstallFunction(prototype, "includes", | 1580 SimpleInstallFunction(prototype, "includes", |
1581 Builtins::kStringPrototypeIncludes, 1, false); | 1581 Builtins::kStringPrototypeIncludes, 1, false); |
1582 SimpleInstallFunction(prototype, "indexOf", | 1582 SimpleInstallFunction(prototype, "indexOf", |
1583 Builtins::kStringPrototypeIndexOf, 1, false); | 1583 Builtins::kStringPrototypeIndexOf, 1, false); |
1584 SimpleInstallFunction(prototype, "lastIndexOf", | 1584 SimpleInstallFunction(prototype, "lastIndexOf", |
1585 Builtins::kStringPrototypeLastIndexOf, 1, false); | 1585 Builtins::kStringPrototypeLastIndexOf, 1, false); |
1586 SimpleInstallFunction(prototype, "localeCompare", | 1586 SimpleInstallFunction(prototype, "localeCompare", |
1587 Builtins::kStringPrototypeLocaleCompare, 1, true); | 1587 Builtins::kStringPrototypeLocaleCompare, 1, true); |
1588 SimpleInstallFunction(prototype, "normalize", | 1588 SimpleInstallFunction(prototype, "normalize", |
1589 Builtins::kStringPrototypeNormalize, 0, false); | 1589 Builtins::kStringPrototypeNormalize, 0, false); |
1590 SimpleInstallFunction(prototype, "split", Builtins::kStringPrototypeSplit, | |
1591 2, true); | |
1592 SimpleInstallFunction(prototype, "replace", | |
1593 Builtins::kStringPrototypeReplace, 2, true); | |
1594 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr, | 1590 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr, |
1595 2, true); | 1591 2, true); |
1596 SimpleInstallFunction(prototype, "substring", | 1592 SimpleInstallFunction(prototype, "substring", |
1597 Builtins::kStringPrototypeSubstring, 2, true); | 1593 Builtins::kStringPrototypeSubstring, 2, true); |
1598 SimpleInstallFunction(prototype, "startsWith", | 1594 SimpleInstallFunction(prototype, "startsWith", |
1599 Builtins::kStringPrototypeStartsWith, 1, false); | 1595 Builtins::kStringPrototypeStartsWith, 1, false); |
1600 SimpleInstallFunction(prototype, "toString", | 1596 SimpleInstallFunction(prototype, "toString", |
1601 Builtins::kStringPrototypeToString, 0, true); | 1597 Builtins::kStringPrototypeToString, 0, true); |
1602 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0, | 1598 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0, |
1603 false); | 1599 false); |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3797 isolate()->factory()->null_value()); | 3793 isolate()->factory()->null_value()); |
3798 native_context()->set_slow_object_with_null_prototype_map( | 3794 native_context()->set_slow_object_with_null_prototype_map( |
3799 *slow_object_with_null_prototype_map); | 3795 *slow_object_with_null_prototype_map); |
3800 | 3796 |
3801 // Store the map for the %StringPrototype% after the natives has been compiled | 3797 // Store the map for the %StringPrototype% after the natives has been compiled |
3802 // and the String function has been set up. | 3798 // and the String function has been set up. |
3803 Handle<JSFunction> string_function(native_context()->string_function()); | 3799 Handle<JSFunction> string_function(native_context()->string_function()); |
3804 DCHECK(JSObject::cast( | 3800 DCHECK(JSObject::cast( |
3805 string_function->initial_map()->prototype())->HasFastProperties()); | 3801 string_function->initial_map()->prototype())->HasFastProperties()); |
3806 native_context()->set_string_function_prototype_map( | 3802 native_context()->set_string_function_prototype_map( |
3807 HeapObject::cast(string_function->map()->prototype())->map()); | 3803 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
3808 | 3804 |
3809 Handle<JSGlobalObject> global_object = | 3805 Handle<JSGlobalObject> global_object = |
3810 handle(native_context()->global_object()); | 3806 handle(native_context()->global_object()); |
3811 | 3807 |
3812 // Install Global.decodeURI. | 3808 // Install Global.decodeURI. |
3813 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI, | 3809 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI, |
3814 1, false, kGlobalDecodeURI); | 3810 1, false, kGlobalDecodeURI); |
3815 | 3811 |
3816 // Install Global.decodeURIComponent. | 3812 // Install Global.decodeURIComponent. |
3817 SimpleInstallFunction(global_object, "decodeURIComponent", | 3813 SimpleInstallFunction(global_object, "decodeURIComponent", |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4844 } | 4840 } |
4845 | 4841 |
4846 | 4842 |
4847 // Called when the top-level V8 mutex is destroyed. | 4843 // Called when the top-level V8 mutex is destroyed. |
4848 void Bootstrapper::FreeThreadResources() { | 4844 void Bootstrapper::FreeThreadResources() { |
4849 DCHECK(!IsActive()); | 4845 DCHECK(!IsActive()); |
4850 } | 4846 } |
4851 | 4847 |
4852 } // namespace internal | 4848 } // namespace internal |
4853 } // namespace v8 | 4849 } // namespace v8 |
OLD | NEW |