| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2350 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) | 2353 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps) |
| 2351 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) | 2354 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps) |
| 2352 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) | 2355 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions) |
| 2353 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_iterator_close) | 2356 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_iterator_close) |
| 2354 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) | 2357 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind) |
| 2355 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) | 2358 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property) |
| 2356 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name) | 2359 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name) |
| 2357 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) | 2360 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent) |
| 2358 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra) | 2361 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra) |
| 2359 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) | 2362 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) |
| 2363 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_instanceof) |
| 2360 | 2364 |
| 2361 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, | 2365 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, |
| 2362 const char* name, Handle<Symbol> value) { | 2366 const char* name, Handle<Symbol> value) { |
| 2363 Handle<JSGlobalObject> global( | 2367 Handle<JSGlobalObject> global( |
| 2364 JSGlobalObject::cast(native_context->global_object())); | 2368 JSGlobalObject::cast(native_context->global_object())); |
| 2365 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); | 2369 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); |
| 2366 Handle<JSObject> symbol = Handle<JSObject>::cast( | 2370 Handle<JSObject> symbol = Handle<JSObject>::cast( |
| 2367 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); | 2371 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); |
| 2368 Handle<String> name_string = factory->InternalizeUtf8String(name); | 2372 Handle<String> name_string = factory->InternalizeUtf8String(name); |
| 2369 PropertyAttributes attributes = | 2373 PropertyAttributes attributes = |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2992 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; | 2996 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; |
| 2993 static const char* harmony_object_observe_natives[] = { | 2997 static const char* harmony_object_observe_natives[] = { |
| 2994 "native harmony-object-observe.js", nullptr}; | 2998 "native harmony-object-observe.js", nullptr}; |
| 2995 static const char* harmony_sharedarraybuffer_natives[] = { | 2999 static const char* harmony_sharedarraybuffer_natives[] = { |
| 2996 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL}; | 3000 "native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL}; |
| 2997 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | 3001 static const char* harmony_simd_natives[] = {"native harmony-simd.js", |
| 2998 nullptr}; | 3002 nullptr}; |
| 2999 static const char* harmony_do_expressions_natives[] = {nullptr}; | 3003 static const char* harmony_do_expressions_natives[] = {nullptr}; |
| 3000 static const char* harmony_regexp_subclass_natives[] = {nullptr}; | 3004 static const char* harmony_regexp_subclass_natives[] = {nullptr}; |
| 3001 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; | 3005 static const char* harmony_regexp_lookbehind_natives[] = {nullptr}; |
| 3006 static const char* harmony_instanceof_natives[] = {nullptr}; |
| 3002 static const char* harmony_regexp_property_natives[] = {nullptr}; | 3007 static const char* harmony_regexp_property_natives[] = {nullptr}; |
| 3003 static const char* harmony_function_name_natives[] = {nullptr}; | 3008 static const char* harmony_function_name_natives[] = {nullptr}; |
| 3004 static const char* harmony_function_sent_natives[] = {nullptr}; | 3009 static const char* harmony_function_sent_natives[] = {nullptr}; |
| 3005 static const char* promise_extra_natives[] = {"native promise-extra.js", | 3010 static const char* promise_extra_natives[] = {"native promise-extra.js", |
| 3006 nullptr}; | 3011 nullptr}; |
| 3007 static const char* harmony_object_values_entries_natives[] = {nullptr}; | 3012 static const char* harmony_object_values_entries_natives[] = {nullptr}; |
| 3008 static const char* harmony_object_own_property_descriptors_natives[] = { | 3013 static const char* harmony_object_own_property_descriptors_natives[] = { |
| 3009 nullptr}; | 3014 nullptr}; |
| 3010 | 3015 |
| 3011 for (int i = ExperimentalNatives::GetDebuggerCount(); | 3016 for (int i = ExperimentalNatives::GetDebuggerCount(); |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3674 } | 3679 } |
| 3675 | 3680 |
| 3676 | 3681 |
| 3677 // Called when the top-level V8 mutex is destroyed. | 3682 // Called when the top-level V8 mutex is destroyed. |
| 3678 void Bootstrapper::FreeThreadResources() { | 3683 void Bootstrapper::FreeThreadResources() { |
| 3679 DCHECK(!IsActive()); | 3684 DCHECK(!IsActive()); |
| 3680 } | 3685 } |
| 3681 | 3686 |
| 3682 } // namespace internal | 3687 } // namespace internal |
| 3683 } // namespace v8 | 3688 } // namespace v8 |
| OLD | NEW |