| 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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 JSObject::kHeaderSize, MaybeHandle<JSObject>(), | 1155 JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
| 1156 Builtins::kFunctionHasInstance, | 1156 Builtins::kFunctionHasInstance, |
| 1157 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)); | 1157 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)); |
| 1158 | 1158 |
| 1159 // Set the expected parameters for @@hasInstance to 1; required by builtin. | 1159 // Set the expected parameters for @@hasInstance to 1; required by builtin. |
| 1160 has_instance->shared()->set_internal_formal_parameter_count(1); | 1160 has_instance->shared()->set_internal_formal_parameter_count(1); |
| 1161 | 1161 |
| 1162 // Set the length for the function to satisfy ECMA-262. | 1162 // Set the length for the function to satisfy ECMA-262. |
| 1163 has_instance->shared()->set_length(1); | 1163 has_instance->shared()->set_length(1); |
| 1164 | 1164 |
| 1165 // Install in the native context |
| 1166 native_context()->set_ordinary_has_instance(*has_instance); |
| 1167 |
| 1165 // Install the "constructor" property on the %FunctionPrototype%. | 1168 // Install the "constructor" property on the %FunctionPrototype%. |
| 1166 JSObject::AddProperty(prototype, factory->constructor_string(), | 1169 JSObject::AddProperty(prototype, factory->constructor_string(), |
| 1167 function_fun, DONT_ENUM); | 1170 function_fun, DONT_ENUM); |
| 1168 | 1171 |
| 1169 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun); | 1172 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun); |
| 1170 strict_function_map_writable_prototype_->SetConstructor(*function_fun); | 1173 strict_function_map_writable_prototype_->SetConstructor(*function_fun); |
| 1171 native_context()->strong_function_map()->SetConstructor(*function_fun); | 1174 native_context()->strong_function_map()->SetConstructor(*function_fun); |
| 1172 } | 1175 } |
| 1173 | 1176 |
| 1174 { // --- A r r a y --- | 1177 { // --- A r r a y --- |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2351 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) | 2354 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) |
| 2352 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) | 2355 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) |
| 2353 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) | 2356 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) |
| 2354 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_iterator_close) | 2357 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_iterator_close) |
| 2355 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) | 2358 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) |
| 2356 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) | 2359 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) |
| 2357 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name) | 2360 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name) |
| 2358 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) | 2361 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) |
| 2359 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra) | 2362 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra) |
| 2360 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) | 2363 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) |
| 2364 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_instanceof) |
| 2361 | 2365 |
| 2362 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, | 2366 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, |
| 2363 const char* name, Handle<Symbol> value) { | 2367 const char* name, Handle<Symbol> value) { |
| 2364 Handle<JSGlobalObject> global( | 2368 Handle<JSGlobalObject> global( |
| 2365 JSGlobalObject::cast(native_context->global_object())); | 2369 JSGlobalObject::cast(native_context->global_object())); |
| 2366 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); | 2370 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); |
| 2367 Handle<JSObject> symbol = Handle<JSObject>::cast( | 2371 Handle<JSObject> symbol = Handle<JSObject>::cast( |
| 2368 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); | 2372 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); |
| 2369 Handle<String> name_string = factory->InternalizeUtf8String(name); | 2373 Handle<String> name_string = factory->InternalizeUtf8String(name); |
| 2370 PropertyAttributes attributes = | 2374 PropertyAttributes attributes = |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2993 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; | 2997 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; |
| 2994 static const char* harmony_object_observe_natives[] = { | 2998 static const char* harmony_object_observe_natives[] = { |
| 2995 "native harmony-object-observe.js", nullptr}; | 2999 "native harmony-object-observe.js", nullptr}; |
| 2996 static const char* harmony_sharedarraybuffer_natives[] = { | 3000 static const char* harmony_sharedarraybuffer_natives[] = { |
| 2997 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL}; | 3001 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL}; |
| 2998 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | 3002 static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
| 2999 nullptr}; | 3003 nullptr}; |
| 3000 static const char* harmony_do_expressions_natives[] = {nullptr}; | 3004 static const char* harmony_do_expressions_natives[] = {nullptr}; |
| 3001 static const char* harmony_regexp_subclass_natives[] = {nullptr}; | 3005 static const char* harmony_regexp_subclass_natives[] = {nullptr}; |
| 3002 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 3006 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
| 3007 static const char* harmony_instanceof_natives[] = {nullptr}; |
| 3003 static const char* harmony_regexp_property_natives[] = {nullptr}; | 3008 static const char* harmony_regexp_property_natives[] = {nullptr}; |
| 3004 static const char* harmony_function_name_natives[] = {nullptr}; | 3009 static const char* harmony_function_name_natives[] = {nullptr}; |
| 3005 static const char* harmony_function_sent_natives[] = {nullptr}; | 3010 static const char* harmony_function_sent_natives[] = {nullptr}; |
| 3006 static const char* promise_extra_natives[] = {"native promise-extra.js", | 3011 static const char* promise_extra_natives[] = {"native promise-extra.js", |
| 3007 nullptr}; | 3012 nullptr}; |
| 3008 static const char* harmony_object_values_entries_natives[] = {nullptr}; | 3013 static const char* harmony_object_values_entries_natives[] = {nullptr}; |
| 3009 static const char* harmony_object_own_property_descriptors_natives[] = { | 3014 static const char* harmony_object_own_property_descriptors_natives[] = { |
| 3010 nullptr}; | 3015 nullptr}; |
| 3011 | 3016 |
| 3012 for (int i = ExperimentalNatives::GetDebuggerCount(); | 3017 for (int i = ExperimentalNatives::GetDebuggerCount(); |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3675 } | 3680 } |
| 3676 | 3681 |
| 3677 | 3682 |
| 3678 // Called when the top-level V8 mutex is destroyed. | 3683 // Called when the top-level V8 mutex is destroyed. |
| 3679 void Bootstrapper::FreeThreadResources() { | 3684 void Bootstrapper::FreeThreadResources() { |
| 3680 DCHECK(!IsActive()); | 3685 DCHECK(!IsActive()); |
| 3681 } | 3686 } |
| 3682 | 3687 |
| 3683 } // namespace internal | 3688 } // namespace internal |
| 3684 } // namespace v8 | 3689 } // namespace v8 |
| OLD | NEW |