Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: src/bootstrapper.cc

Issue 1983593002: [builtins] Move EncodeURI from runtime to builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 8461bef082ad6c5d17876e4210bdf63438c5d28e..a11749b8c11dc77d0b0141bf992c15483b03e5ee 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2819,11 +2819,22 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
native_context()->set_string_function_prototype_map(
HeapObject::cast(string_function->initial_map()->prototype())->map());
+ Handle<JSGlobalObject> global_object =
+ handle(native_context()->global_object());
+
+ // Install Global.encodeURI.
+ SimpleInstallFunction(global_object, "encodeURI", Builtins::kGlobalEncodeURI,
+ 1, false);
+
+ // Install Global.encodeURIComponent.
+ SimpleInstallFunction(global_object, "encodeURIComponent",
+ Builtins::kGlobalEncodeURIComponent, 1, false);
+
// Install Global.eval.
{
- Handle<JSFunction> eval = SimpleInstallFunction(
- handle(native_context()->global_object()), factory()->eval_string(),
- Builtins::kGlobalEval, 1, false);
+ Handle<JSFunction> eval =
+ SimpleInstallFunction(global_object, factory()->eval_string(),
+ Builtins::kGlobalEval, 1, false);
native_context()->set_global_eval_fun(*eval);
}
@@ -2866,8 +2877,7 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
{
Handle<String> key = factory()->Promise_string();
Handle<JSFunction> function = Handle<JSFunction>::cast(
- JSReceiver::GetProperty(handle(native_context()->global_object()), key)
- .ToHandleChecked());
+ JSReceiver::GetProperty(global_object, key).ToHandleChecked());
JSFunction::EnsureHasInitialMap(function);
function->initial_map()->set_instance_type(JS_PROMISE_TYPE);
function->shared()->set_construct_stub(
« no previous file with comments | « BUILD.gn ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698