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

Side by Side Diff: src/bootstrapper.cc

Issue 2728763006: Migrate some case conversion functions from JS to CPP builtins (Closed)
Patch Set: more specific #include Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3876 3876
3877 void Genesis::InitializeGlobal_icu_case_mapping() { 3877 void Genesis::InitializeGlobal_icu_case_mapping() {
3878 if (!FLAG_icu_case_mapping) return; 3878 if (!FLAG_icu_case_mapping) return;
3879 3879
3880 Handle<JSReceiver> exports_container( 3880 Handle<JSReceiver> exports_container(
3881 JSReceiver::cast(native_context()->exports_container())); 3881 JSReceiver::cast(native_context()->exports_container()));
3882 3882
3883 Handle<JSObject> string_prototype( 3883 Handle<JSObject> string_prototype(
3884 JSObject::cast(native_context()->string_function()->prototype())); 3884 JSObject::cast(native_context()->string_function()->prototype()));
3885 3885
3886 Handle<JSFunction> to_lower_case = Handle<JSFunction>::cast( 3886 {
3887 JSReceiver::GetProperty( 3887 Handle<String> name = factory()->InternalizeUtf8String("toLowerCase");
3888 exports_container, 3888 SetFunction(string_prototype,
3889 factory()->InternalizeUtf8String("ToLowerCaseI18N")) 3889 SimpleCreateFunction(isolate(), name,
3890 .ToHandleChecked()); 3890 Builtins::kStringPrototypeToLowerCaseI18N,
3891 SetFunction(string_prototype, to_lower_case, 3891 0, false),
3892 factory()->InternalizeUtf8String("toLowerCase")); 3892 name);
3893 3893 }
3894 Handle<JSFunction> to_upper_case = Handle<JSFunction>::cast( 3894 {
3895 JSReceiver::GetProperty( 3895 Handle<String> name = factory()->InternalizeUtf8String("toUpperCase");
3896 exports_container, 3896 SetFunction(string_prototype,
3897 factory()->InternalizeUtf8String("ToUpperCaseI18N")) 3897 SimpleCreateFunction(isolate(), name,
3898 .ToHandleChecked()); 3898 Builtins::kStringPrototypeToUpperCaseI18N,
3899 SetFunction(string_prototype, to_upper_case, 3899 0, false),
3900 factory()->InternalizeUtf8String("toUpperCase")); 3900 name);
3901 }
3901 3902
3902 Handle<JSFunction> to_locale_lower_case = Handle<JSFunction>::cast( 3903 Handle<JSFunction> to_locale_lower_case = Handle<JSFunction>::cast(
3903 JSReceiver::GetProperty( 3904 JSReceiver::GetProperty(
3904 exports_container, 3905 exports_container,
3905 factory()->InternalizeUtf8String("ToLocaleLowerCaseI18N")) 3906 factory()->InternalizeUtf8String("ToLocaleLowerCaseI18N"))
3906 .ToHandleChecked()); 3907 .ToHandleChecked());
3907 SetFunction(string_prototype, to_locale_lower_case, 3908 SetFunction(string_prototype, to_locale_lower_case,
3908 factory()->InternalizeUtf8String("toLocaleLowerCase")); 3909 factory()->InternalizeUtf8String("toLocaleLowerCase"));
3909 3910
3910 Handle<JSFunction> to_locale_upper_case = Handle<JSFunction>::cast( 3911 Handle<JSFunction> to_locale_upper_case = Handle<JSFunction>::cast(
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
5061 } 5062 }
5062 5063
5063 5064
5064 // Called when the top-level V8 mutex is destroyed. 5065 // Called when the top-level V8 mutex is destroyed.
5065 void Bootstrapper::FreeThreadResources() { 5066 void Bootstrapper::FreeThreadResources() {
5066 DCHECK(!IsActive()); 5067 DCHECK(!IsActive());
5067 } 5068 }
5068 5069
5069 } // namespace internal 5070 } // namespace internal
5070 } // namespace v8 5071 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | src/builtins/builtins.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698