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 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 HeapObject::cast(object_function->initial_map()->prototype())->map()); | 2748 HeapObject::cast(object_function->initial_map()->prototype())->map()); |
2749 | 2749 |
2750 // Store the map for the %StringPrototype% after the natives has been compiled | 2750 // Store the map for the %StringPrototype% after the natives has been compiled |
2751 // and the String function has been set up. | 2751 // and the String function has been set up. |
2752 Handle<JSFunction> string_function(native_context()->string_function()); | 2752 Handle<JSFunction> string_function(native_context()->string_function()); |
2753 DCHECK(JSObject::cast( | 2753 DCHECK(JSObject::cast( |
2754 string_function->initial_map()->prototype())->HasFastProperties()); | 2754 string_function->initial_map()->prototype())->HasFastProperties()); |
2755 native_context()->set_string_function_prototype_map( | 2755 native_context()->set_string_function_prototype_map( |
2756 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 2756 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
2757 | 2757 |
| 2758 // Install Global.encodeURI. |
| 2759 { |
| 2760 Handle<JSFunction> encode_uri = SimpleInstallFunction( |
| 2761 handle(native_context()->global_object()), "encodeURI", |
| 2762 Builtins::kGlobalEncodeURI, 1, false); |
| 2763 native_context()->set_global_encode_uri_fun(*encode_uri); |
| 2764 } |
| 2765 |
| 2766 // Install Global.encodeURIComponent. |
| 2767 { |
| 2768 Handle<JSFunction> encode_uri_component = SimpleInstallFunction( |
| 2769 handle(native_context()->global_object()), "encodeURIComponent", |
| 2770 Builtins::kGlobalEncodeURIComponent, 1, false); |
| 2771 native_context()->set_global_encode_uri_component_fun( |
| 2772 *encode_uri_component); |
| 2773 } |
| 2774 |
2758 // Install Global.eval. | 2775 // Install Global.eval. |
2759 { | 2776 { |
2760 Handle<JSFunction> eval = SimpleInstallFunction( | 2777 Handle<JSFunction> eval = SimpleInstallFunction( |
2761 handle(native_context()->global_object()), factory()->eval_string(), | 2778 handle(native_context()->global_object()), factory()->eval_string(), |
2762 Builtins::kGlobalEval, 1, false); | 2779 Builtins::kGlobalEval, 1, false); |
2763 native_context()->set_global_eval_fun(*eval); | 2780 native_context()->set_global_eval_fun(*eval); |
2764 } | 2781 } |
2765 | 2782 |
2766 // Install Array.prototype.concat | 2783 // Install Array.prototype.concat |
2767 { | 2784 { |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3700 } | 3717 } |
3701 | 3718 |
3702 | 3719 |
3703 // Called when the top-level V8 mutex is destroyed. | 3720 // Called when the top-level V8 mutex is destroyed. |
3704 void Bootstrapper::FreeThreadResources() { | 3721 void Bootstrapper::FreeThreadResources() { |
3705 DCHECK(!IsActive()); | 3722 DCHECK(!IsActive()); |
3706 } | 3723 } |
3707 | 3724 |
3708 } // namespace internal | 3725 } // namespace internal |
3709 } // namespace v8 | 3726 } // namespace v8 |
OLD | NEW |