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

Side by Side Diff: src/bootstrapper.cc

Issue 1922453002: Migrate Object.getPrototypeOf from v8natives to builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 Handle<ScriptContextTable> script_context_table = 1049 Handle<ScriptContextTable> script_context_table =
1050 factory->NewScriptContextTable(); 1050 factory->NewScriptContextTable();
1051 native_context()->set_script_context_table(*script_context_table); 1051 native_context()->set_script_context_table(*script_context_table);
1052 InstallGlobalThisBinding(); 1052 InstallGlobalThisBinding();
1053 1053
1054 { // --- O b j e c t --- 1054 { // --- O b j e c t ---
1055 Handle<String> object_name = factory->Object_string(); 1055 Handle<String> object_name = factory->Object_string();
1056 Handle<JSFunction> object_function = isolate->object_function(); 1056 Handle<JSFunction> object_function = isolate->object_function();
1057 JSObject::AddProperty(global_object, object_name, object_function, 1057 JSObject::AddProperty(global_object, object_name, object_function,
1058 DONT_ENUM); 1058 DONT_ENUM);
1059
1059 SimpleInstallFunction(object_function, factory->assign_string(), 1060 SimpleInstallFunction(object_function, factory->assign_string(),
1060 Builtins::kObjectAssign, 2, false); 1061 Builtins::kObjectAssign, 2, false);
1061 SimpleInstallFunction(object_function, factory->create_string(), 1062 SimpleInstallFunction(object_function, factory->create_string(),
1062 Builtins::kObjectCreate, 2, false); 1063 Builtins::kObjectCreate, 2, false);
1063 Handle<JSFunction> object_freeze = SimpleInstallFunction(
1064 object_function, "freeze", Builtins::kObjectFreeze, 1, false);
1065 native_context()->set_object_freeze(*object_freeze);
1066 SimpleInstallFunction(object_function, "getOwnPropertyDescriptor", 1064 SimpleInstallFunction(object_function, "getOwnPropertyDescriptor",
1067 Builtins::kObjectGetOwnPropertyDescriptor, 2, false); 1065 Builtins::kObjectGetOwnPropertyDescriptor, 2, false);
1068 SimpleInstallFunction(object_function, "getOwnPropertyNames", 1066 SimpleInstallFunction(object_function, "getOwnPropertyNames",
1069 Builtins::kObjectGetOwnPropertyNames, 1, false); 1067 Builtins::kObjectGetOwnPropertyNames, 1, false);
1070 SimpleInstallFunction(object_function, "getOwnPropertySymbols", 1068 SimpleInstallFunction(object_function, "getOwnPropertySymbols",
1071 Builtins::kObjectGetOwnPropertySymbols, 1, false); 1069 Builtins::kObjectGetOwnPropertySymbols, 1, false);
1072 SimpleInstallFunction(object_function, "is", Builtins::kObjectIs, 2, true); 1070 SimpleInstallFunction(object_function, "is",
1073 Handle<JSFunction> object_is_extensible = 1071 Builtins::kObjectIs, 2, true);
1074 SimpleInstallFunction(object_function, "isExtensible", 1072 SimpleInstallFunction(object_function, "preventExtensions",
1075 Builtins::kObjectIsExtensible, 1, false); 1073 Builtins::kObjectPreventExtensions, 1, false);
1074 SimpleInstallFunction(object_function, "seal",
1075 Builtins::kObjectSeal, 1, false);
1076
1077 Handle<JSFunction> object_freeze = SimpleInstallFunction(
1078 object_function, "freeze", Builtins::kObjectFreeze, 1, false);
1079 native_context()->set_object_freeze(*object_freeze);
1080
1081 Handle<JSFunction> object_get_prototype_of = SimpleInstallFunction(
1082 object_function, "getPrototypeOf", Builtins::kObjectGetPrototypeOf,
1083 1, false);
1084 native_context()->set_object_get_prototype_of(*object_get_prototype_of);
1085
1086 Handle<JSFunction> object_is_extensible = SimpleInstallFunction(
1087 object_function, "isExtensible", Builtins::kObjectIsExtensible,
1088 1, false);
1076 native_context()->set_object_is_extensible(*object_is_extensible); 1089 native_context()->set_object_is_extensible(*object_is_extensible);
1090
1077 Handle<JSFunction> object_is_frozen = SimpleInstallFunction( 1091 Handle<JSFunction> object_is_frozen = SimpleInstallFunction(
1078 object_function, "isFrozen", Builtins::kObjectIsFrozen, 1, false); 1092 object_function, "isFrozen", Builtins::kObjectIsFrozen, 1, false);
1079 native_context()->set_object_is_frozen(*object_is_frozen); 1093 native_context()->set_object_is_frozen(*object_is_frozen);
1094
1080 Handle<JSFunction> object_is_sealed = SimpleInstallFunction( 1095 Handle<JSFunction> object_is_sealed = SimpleInstallFunction(
1081 object_function, "isSealed", Builtins::kObjectIsSealed, 1, false); 1096 object_function, "isSealed", Builtins::kObjectIsSealed, 1, false);
1082 native_context()->set_object_is_sealed(*object_is_sealed); 1097 native_context()->set_object_is_sealed(*object_is_sealed);
1098
1083 Handle<JSFunction> object_keys = SimpleInstallFunction( 1099 Handle<JSFunction> object_keys = SimpleInstallFunction(
1084 object_function, "keys", Builtins::kObjectKeys, 1, false); 1100 object_function, "keys", Builtins::kObjectKeys, 1, false);
1085 native_context()->set_object_keys(*object_keys); 1101 native_context()->set_object_keys(*object_keys);
1086 SimpleInstallFunction(object_function, "preventExtensions",
1087 Builtins::kObjectPreventExtensions, 1, false);
1088 SimpleInstallFunction(object_function, "seal", Builtins::kObjectSeal, 1,
1089 false);
1090 1102
1091 SimpleInstallFunction(isolate->initial_object_prototype(), "hasOwnProperty", 1103 SimpleInstallFunction(isolate->initial_object_prototype(), "hasOwnProperty",
1092 Builtins::kObjectHasOwnProperty, 1, true); 1104 Builtins::kObjectHasOwnProperty, 1, true);
1093 } 1105 }
1094 1106
1095 Handle<JSObject> global(native_context()->global_object()); 1107 Handle<JSObject> global(native_context()->global_object());
1096 1108
1097 { // --- F u n c t i o n --- 1109 { // --- F u n c t i o n ---
1098 Handle<JSFunction> prototype = empty_function; 1110 Handle<JSFunction> prototype = empty_function;
1099 Handle<JSFunction> function_fun = 1111 Handle<JSFunction> function_fun =
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 } 3655 }
3644 3656
3645 3657
3646 // Called when the top-level V8 mutex is destroyed. 3658 // Called when the top-level V8 mutex is destroyed.
3647 void Bootstrapper::FreeThreadResources() { 3659 void Bootstrapper::FreeThreadResources() {
3648 DCHECK(!IsActive()); 3660 DCHECK(!IsActive());
3649 } 3661 }
3650 3662
3651 } // namespace internal 3663 } // namespace internal
3652 } // namespace v8 3664 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698