Chromium Code Reviews| 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/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 void CreateRoots(); | 162 void CreateRoots(); |
| 163 // Creates the empty function. Used for creating a context from scratch. | 163 // Creates the empty function. Used for creating a context from scratch. |
| 164 Handle<JSFunction> CreateEmptyFunction(Isolate* isolate); | 164 Handle<JSFunction> CreateEmptyFunction(Isolate* isolate); |
| 165 // Creates the ThrowTypeError function. ECMA 5th Ed. 13.2.3 | 165 // Creates the ThrowTypeError function. ECMA 5th Ed. 13.2.3 |
| 166 Handle<JSFunction> GetRestrictedFunctionPropertiesThrower(); | 166 Handle<JSFunction> GetRestrictedFunctionPropertiesThrower(); |
| 167 Handle<JSFunction> GetStrictArgumentsPoisonFunction(); | 167 Handle<JSFunction> GetStrictArgumentsPoisonFunction(); |
| 168 Handle<JSFunction> GetThrowTypeErrorIntrinsic(Builtins::Name builtin_name); | 168 Handle<JSFunction> GetThrowTypeErrorIntrinsic(Builtins::Name builtin_name); |
| 169 | 169 |
| 170 void CreateStrictModeFunctionMaps(Handle<JSFunction> empty); | 170 void CreateStrictModeFunctionMaps(Handle<JSFunction> empty); |
| 171 void CreateIteratorMaps(Handle<JSFunction> empty); | 171 void CreateIteratorMaps(Handle<JSFunction> empty); |
| 172 void CreateAsyncIteratorMaps(Handle<JSFunction> empty); | |
| 172 void CreateAsyncFunctionMaps(Handle<JSFunction> empty); | 173 void CreateAsyncFunctionMaps(Handle<JSFunction> empty); |
| 173 void CreateJSProxyMaps(); | 174 void CreateJSProxyMaps(); |
| 174 | 175 |
| 175 // Make the "arguments" and "caller" properties throw a TypeError on access. | 176 // Make the "arguments" and "caller" properties throw a TypeError on access. |
| 176 void AddRestrictedFunctionProperties(Handle<JSFunction> empty); | 177 void AddRestrictedFunctionProperties(Handle<JSFunction> empty); |
| 177 | 178 |
| 178 // Creates the global objects using the global proxy and the template passed | 179 // Creates the global objects using the global proxy and the template passed |
| 179 // in through the API. We call this regardless of whether we are building a | 180 // in through the API. We call this regardless of whether we are building a |
| 180 // context from scratch or using a deserialized one from the partial snapshot | 181 // context from scratch or using a deserialized one from the partial snapshot |
| 181 // but in the latter case we don't use the objects it produces directly, as | 182 // but in the latter case we don't use the objects it produces directly, as |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 774 Map::SetPrototype(generator_function_map, generator_function_prototype); | 775 Map::SetPrototype(generator_function_map, generator_function_prototype); |
| 775 native_context()->set_generator_function_map(*generator_function_map); | 776 native_context()->set_generator_function_map(*generator_function_map); |
| 776 | 777 |
| 777 Handle<JSFunction> object_function(native_context()->object_function()); | 778 Handle<JSFunction> object_function(native_context()->object_function()); |
| 778 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); | 779 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); |
| 779 Map::SetPrototype(generator_object_prototype_map, generator_object_prototype); | 780 Map::SetPrototype(generator_object_prototype_map, generator_object_prototype); |
| 780 native_context()->set_generator_object_prototype_map( | 781 native_context()->set_generator_object_prototype_map( |
| 781 *generator_object_prototype_map); | 782 *generator_object_prototype_map); |
| 782 } | 783 } |
| 783 | 784 |
| 785 static void InstallWithIntrinsicDefaultProto(Isolate* isolate, | |
| 786 Handle<JSFunction> function, | |
| 787 int context_index) { | |
| 788 Handle<Smi> index(Smi::FromInt(context_index), isolate); | |
| 789 JSObject::AddProperty( | |
| 790 function, isolate->factory()->native_context_index_symbol(), index, NONE); | |
| 791 isolate->native_context()->set(context_index, *function); | |
| 792 } | |
| 793 | |
| 794 void Genesis::CreateAsyncIteratorMaps(Handle<JSFunction> empty) { | |
| 795 // Create iterator-related meta-objects. | |
| 796 Handle<JSObject> async_iterator_prototype = | |
| 797 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
| 798 | |
| 799 Handle<JSFunction> async_iterator_prototype_iterator = SimpleCreateFunction( | |
| 800 isolate(), factory()->NewStringFromAsciiChecked("[Symbol.asyncIterator]"), | |
| 801 Builtins::kReturnReceiver, 0, true); | |
| 802 async_iterator_prototype_iterator->shared()->set_native(true); | |
| 803 | |
| 804 JSObject::AddProperty(async_iterator_prototype, | |
| 805 factory()->async_iterator_symbol(), | |
| 806 async_iterator_prototype_iterator, DONT_ENUM); | |
| 807 | |
| 808 Handle<JSObject> async_from_sync_iterator_prototype = | |
| 809 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
| 810 SimpleInstallFunction(async_from_sync_iterator_prototype, | |
| 811 factory()->next_string(), | |
| 812 Builtins::kAsyncFromSyncIteratorPrototypeNext, 1, true); | |
| 813 SimpleInstallFunction( | |
| 814 async_from_sync_iterator_prototype, factory()->return_string(), | |
| 815 Builtins::kAsyncFromSyncIteratorPrototypeReturn, 1, true); | |
| 816 SimpleInstallFunction( | |
| 817 async_from_sync_iterator_prototype, factory()->throw_string(), | |
| 818 Builtins::kAsyncFromSyncIteratorPrototypeThrow, 1, true); | |
| 819 | |
| 820 JSObject::AddProperty( | |
| 821 async_from_sync_iterator_prototype, factory()->to_string_tag_symbol(), | |
| 822 factory()->NewStringFromAsciiChecked("Async-from-Sync Iterator"), | |
| 823 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 824 | |
| 825 JSObject::ForceSetPrototype(async_from_sync_iterator_prototype, | |
| 826 async_iterator_prototype); | |
| 827 | |
| 828 Handle<Map> async_from_sync_iterator_map = factory()->NewMap( | |
| 829 JS_ASYNC_FROM_SYNC_ITERATOR_TYPE, JSAsyncFromSyncIterator::kSize); | |
| 830 Map::SetPrototype(async_from_sync_iterator_map, | |
| 831 async_from_sync_iterator_prototype); | |
| 832 native_context()->set_initial_async_from_sync_iterator_map( | |
| 833 *async_from_sync_iterator_map); | |
| 834 | |
| 835 Handle<String> AsyncGeneratorFunction_string = | |
| 836 factory()->NewStringFromAsciiChecked("AsyncGeneratorFunction", TENURED); | |
| 837 | |
| 838 static const bool kUseStrictFunctionMap = true; | |
| 839 Handle<JSObject> async_generator_object_prototype = | |
| 840 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
| 841 Handle<JSObject> async_generator_function_prototype = | |
| 842 factory()->NewJSObject(isolate()->object_function(), TENURED); | |
| 843 | |
| 844 Handle<JSFunction> async_generator_function = SimpleCreateFunction( | |
| 845 isolate(), AsyncGeneratorFunction_string, | |
| 846 Builtins::kAsyncGeneratorFunctionConstructor, 1, false); | |
| 847 InstallWithIntrinsicDefaultProto( | |
| 848 isolate(), async_generator_function, | |
| 849 Context::ASYNC_GENERATOR_FUNCTION_FUNCTION_INDEX); | |
| 850 | |
| 851 // %AsyncGenerator% / %AsyncGeneratorFunction%.prototype | |
| 852 JSObject::ForceSetPrototype(async_generator_function_prototype, empty); | |
| 853 JSObject::AddProperty(async_generator_function_prototype, | |
| 854 factory()->constructor_string(), | |
| 855 async_generator_function, | |
| 856 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 857 JSObject::AddProperty(async_generator_function_prototype, | |
| 858 factory()->prototype_string(), | |
| 859 async_generator_object_prototype, | |
| 860 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 861 JSObject::AddProperty(async_generator_function_prototype, | |
| 862 factory()->to_string_tag_symbol(), | |
| 863 AsyncGeneratorFunction_string, | |
| 864 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 865 | |
| 866 // %AsyncGeneratorPrototype% | |
| 867 JSObject::ForceSetPrototype(async_generator_object_prototype, | |
| 868 async_iterator_prototype); | |
| 869 | |
| 870 JSObject::AddProperty(async_generator_object_prototype, | |
| 871 factory()->constructor_string(), | |
| 872 async_generator_function, | |
| 873 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 874 JSObject::AddProperty(async_generator_object_prototype, | |
| 875 factory()->to_string_tag_symbol(), | |
| 876 factory()->NewStringFromAsciiChecked("AsyncGenerator"), | |
| 877 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
| 878 SimpleInstallFunction(async_generator_object_prototype, "next", | |
| 879 Builtins::kAsyncGeneratorPrototypeNext, 1, true); | |
| 880 SimpleInstallFunction(async_generator_object_prototype, "return", | |
| 881 Builtins::kAsyncGeneratorPrototypeReturn, 1, true); | |
| 882 SimpleInstallFunction(async_generator_object_prototype, "throw", | |
| 883 Builtins::kAsyncGeneratorPrototypeThrow, 1, true); | |
| 884 | |
| 885 // Create maps for async generator functions and their prototypes. Store those | |
| 886 // maps in the native context. The "prototype" property descriptor is | |
| 887 // writable, non-enumerable, and non-configurable. | |
| 888 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); | |
| 889 | |
| 890 // Async Generator functions do not have "caller" or "arguments" accessors in | |
| 891 // either sloppy mode or strict mode. | |
| 892 Handle<Map> async_generator_function_map = | |
| 893 Map::Copy(strict_function_map, "AsyncGeneratorFunction"); | |
| 894 async_generator_function_map->set_is_constructor(false); | |
| 895 Map::SetPrototype(async_generator_function_map, | |
| 896 async_generator_function_prototype); | |
| 897 native_context()->set_async_generator_function_map( | |
| 898 *async_generator_function_map); | |
| 899 | |
| 900 Handle<JSFunction> object_function(native_context()->object_function()); | |
| 901 Handle<Map> async_generator_object_prototype_map = Map::Create(isolate(), 0); | |
| 902 Map::SetPrototype(async_generator_object_prototype_map, | |
| 903 async_generator_object_prototype); | |
| 904 native_context()->set_async_generator_object_prototype_map( | |
| 905 *async_generator_object_prototype_map); | |
| 906 } | |
| 907 | |
| 784 void Genesis::CreateAsyncFunctionMaps(Handle<JSFunction> empty) { | 908 void Genesis::CreateAsyncFunctionMaps(Handle<JSFunction> empty) { |
| 785 // %AsyncFunctionPrototype% intrinsic | 909 // %AsyncFunctionPrototype% intrinsic |
| 786 Handle<JSObject> async_function_prototype = | 910 Handle<JSObject> async_function_prototype = |
| 787 factory()->NewJSObject(isolate()->object_function(), TENURED); | 911 factory()->NewJSObject(isolate()->object_function(), TENURED); |
| 788 JSObject::ForceSetPrototype(async_function_prototype, empty); | 912 JSObject::ForceSetPrototype(async_function_prototype, empty); |
| 789 | 913 |
| 790 JSObject::AddProperty(async_function_prototype, | 914 JSObject::AddProperty(async_function_prototype, |
| 791 factory()->to_string_tag_symbol(), | 915 factory()->to_string_tag_symbol(), |
| 792 factory()->NewStringFromAsciiChecked("AsyncFunction"), | 916 factory()->NewStringFromAsciiChecked("AsyncFunction"), |
| 793 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 917 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1027 void Genesis::HookUpGlobalObject(Handle<JSGlobalObject> global_object) { | 1151 void Genesis::HookUpGlobalObject(Handle<JSGlobalObject> global_object) { |
| 1028 Handle<JSGlobalObject> global_object_from_snapshot( | 1152 Handle<JSGlobalObject> global_object_from_snapshot( |
| 1029 JSGlobalObject::cast(native_context()->extension())); | 1153 JSGlobalObject::cast(native_context()->extension())); |
| 1030 native_context()->set_extension(*global_object); | 1154 native_context()->set_extension(*global_object); |
| 1031 native_context()->set_security_token(*global_object); | 1155 native_context()->set_security_token(*global_object); |
| 1032 | 1156 |
| 1033 TransferNamedProperties(global_object_from_snapshot, global_object); | 1157 TransferNamedProperties(global_object_from_snapshot, global_object); |
| 1034 TransferIndexedProperties(global_object_from_snapshot, global_object); | 1158 TransferIndexedProperties(global_object_from_snapshot, global_object); |
| 1035 } | 1159 } |
| 1036 | 1160 |
| 1037 static void InstallWithIntrinsicDefaultProto(Isolate* isolate, | |
| 1038 Handle<JSFunction> function, | |
| 1039 int context_index) { | |
| 1040 Handle<Smi> index(Smi::FromInt(context_index), isolate); | |
| 1041 JSObject::AddProperty( | |
| 1042 function, isolate->factory()->native_context_index_symbol(), index, NONE); | |
| 1043 isolate->native_context()->set(context_index, *function); | |
| 1044 } | |
| 1045 | |
| 1046 static void InstallError(Isolate* isolate, Handle<JSObject> global, | 1161 static void InstallError(Isolate* isolate, Handle<JSObject> global, |
| 1047 Handle<String> name, int context_index) { | 1162 Handle<String> name, int context_index) { |
| 1048 Factory* factory = isolate->factory(); | 1163 Factory* factory = isolate->factory(); |
| 1049 | 1164 |
| 1050 Handle<JSFunction> error_fun = | 1165 Handle<JSFunction> error_fun = |
| 1051 InstallFunction(global, name, JS_ERROR_TYPE, JSObject::kHeaderSize, | 1166 InstallFunction(global, name, JS_ERROR_TYPE, JSObject::kHeaderSize, |
| 1052 isolate->initial_object_prototype(), | 1167 isolate->initial_object_prototype(), |
| 1053 Builtins::kErrorConstructor, DONT_ENUM); | 1168 Builtins::kErrorConstructor, DONT_ENUM); |
| 1054 error_fun->shared()->set_instance_class_name(*factory->Error_string()); | 1169 error_fun->shared()->set_instance_class_name(*factory->Error_string()); |
| 1055 error_fun->shared()->DontAdaptArguments(); | 1170 error_fun->shared()->DontAdaptArguments(); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1284 | 1399 |
| 1285 // Install the "constructor" property on the %FunctionPrototype%. | 1400 // Install the "constructor" property on the %FunctionPrototype%. |
| 1286 JSObject::AddProperty(prototype, factory->constructor_string(), | 1401 JSObject::AddProperty(prototype, factory->constructor_string(), |
| 1287 function_fun, DONT_ENUM); | 1402 function_fun, DONT_ENUM); |
| 1288 | 1403 |
| 1289 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun); | 1404 sloppy_function_map_writable_prototype_->SetConstructor(*function_fun); |
| 1290 strict_function_map_writable_prototype_->SetConstructor(*function_fun); | 1405 strict_function_map_writable_prototype_->SetConstructor(*function_fun); |
| 1291 class_function_map_->SetConstructor(*function_fun); | 1406 class_function_map_->SetConstructor(*function_fun); |
| 1292 } | 1407 } |
| 1293 | 1408 |
| 1409 { | |
| 1410 // --- A s y n c F r o m S y n c I t e r a t o r | |
| 1411 Handle<Code> code = handle( | |
| 1412 isolate->builtins()->builtin(Builtins::kAsyncIteratorValueUnwrap), | |
|
jgruber
2017/01/13 13:34:34
Nit: isolate->builtins()->AsyncIteratorValueUnwrap
caitp
2017/01/13 14:36:03
Acknowledged.
caitp
2017/01/17 19:23:11
Done.
| |
| 1413 isolate); | |
| 1414 Handle<SharedFunctionInfo> info = | |
| 1415 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); | |
| 1416 info->set_internal_formal_parameter_count(1); | |
| 1417 info->set_length(1); | |
| 1418 native_context()->set_async_iterator_value_unwrap_shared_fun(*info); | |
| 1419 } | |
| 1420 | |
| 1421 { // --- A s y n c G e n e r a t o r --- | |
| 1422 Handle<JSFunction> async_generator_function( | |
| 1423 native_context()->async_generator_function_function(), isolate); | |
| 1424 Handle<JSFunction> function_fun(native_context()->function_function(), | |
| 1425 isolate); | |
| 1426 JSObject::ForceSetPrototype(async_generator_function, function_fun); | |
| 1427 | |
| 1428 async_generator_function->set_prototype_or_initial_map( | |
| 1429 native_context()->async_generator_function_map()); | |
| 1430 async_generator_function->shared()->SetConstructStub( | |
| 1431 *isolate->builtins()->AsyncGeneratorFunctionConstructor()); | |
| 1432 native_context()->async_generator_function_map()->SetConstructor( | |
| 1433 *async_generator_function); | |
| 1434 | |
| 1435 Handle<JSFunction> await_caught = | |
| 1436 SimpleCreateFunction(isolate, factory->empty_string(), | |
| 1437 Builtins::kAsyncGeneratorAwaitCaught, 2, false); | |
| 1438 InstallWithIntrinsicDefaultProto(isolate, await_caught, | |
| 1439 Context::ASYNC_GENERATOR_AWAIT_CAUGHT); | |
| 1440 | |
| 1441 Handle<JSFunction> await_uncaught = | |
| 1442 SimpleCreateFunction(isolate, factory->empty_string(), | |
| 1443 Builtins::kAsyncGeneratorAwaitUncaught, 2, false); | |
| 1444 InstallWithIntrinsicDefaultProto(isolate, await_uncaught, | |
| 1445 Context::ASYNC_GENERATOR_AWAIT_UNCAUGHT); | |
| 1446 | |
| 1447 Handle<JSFunction> yield = | |
| 1448 SimpleCreateFunction(isolate, factory->empty_string(), | |
| 1449 Builtins::kAsyncGeneratorYield, 2, false); | |
| 1450 InstallWithIntrinsicDefaultProto(isolate, yield, | |
| 1451 Context::ASYNC_GENERATOR_YIELD); | |
| 1452 | |
| 1453 Handle<Code> code = | |
| 1454 handle(isolate->builtins()->builtin( | |
| 1455 Builtins::kAsyncGeneratorAwaitResolveClosure), | |
|
jgruber
2017/01/13 13:34:33
Same here and below.
caitp
2017/01/17 19:23:11
Done.
| |
| 1456 isolate); | |
| 1457 Handle<SharedFunctionInfo> info = | |
| 1458 factory->NewSharedFunctionInfo(factory->empty_string(), code, false); | |
| 1459 info->set_internal_formal_parameter_count(1); | |
| 1460 info->set_length(1); | |
| 1461 native_context()->set_async_generator_await_resolve_shared_fun(*info); | |
| 1462 | |
| 1463 code = handle(isolate->builtins()->builtin( | |
| 1464 Builtins::kAsyncGeneratorAwaitRejectClosure), | |
| 1465 isolate); | |
| 1466 info = factory->NewSharedFunctionInfo(factory->empty_string(), code, false); | |
| 1467 info->set_internal_formal_parameter_count(1); | |
| 1468 info->set_length(1); | |
| 1469 native_context()->set_async_generator_await_reject_shared_fun(*info); | |
| 1470 } | |
| 1471 | |
| 1294 { // --- A r r a y --- | 1472 { // --- A r r a y --- |
| 1295 Handle<JSFunction> array_function = | 1473 Handle<JSFunction> array_function = |
| 1296 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, | 1474 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, |
| 1297 isolate->initial_object_prototype(), | 1475 isolate->initial_object_prototype(), |
| 1298 Builtins::kArrayCode); | 1476 Builtins::kArrayCode); |
| 1299 array_function->shared()->DontAdaptArguments(); | 1477 array_function->shared()->DontAdaptArguments(); |
| 1300 array_function->shared()->set_builtin_function_id(kArrayCode); | 1478 array_function->shared()->set_builtin_function_id(kArrayCode); |
| 1301 | 1479 |
| 1302 // This seems a bit hackish, but we need to make sure Array.length | 1480 // This seems a bit hackish, but we need to make sure Array.length |
| 1303 // is 1. | 1481 // is 1. |
| (...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3439 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) | 3617 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls) |
| 3440 #ifdef V8_I18N_SUPPORT | 3618 #ifdef V8_I18N_SUPPORT |
| 3441 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(datetime_format_to_parts) | 3619 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(datetime_format_to_parts) |
| 3442 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(icu_case_mapping) | 3620 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(icu_case_mapping) |
| 3443 #endif | 3621 #endif |
| 3444 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_async_await) | 3622 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_async_await) |
| 3445 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_generators) | 3623 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_generators) |
| 3446 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_trailing_commas) | 3624 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_trailing_commas) |
| 3447 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields) | 3625 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields) |
| 3448 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_spread) | 3626 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_spread) |
| 3627 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_async_iteration) | |
| 3449 | 3628 |
| 3450 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, | 3629 void InstallPublicSymbol(Factory* factory, Handle<Context> native_context, |
| 3451 const char* name, Handle<Symbol> value) { | 3630 const char* name, Handle<Symbol> value) { |
| 3452 Handle<JSGlobalObject> global( | 3631 Handle<JSGlobalObject> global( |
| 3453 JSGlobalObject::cast(native_context->global_object())); | 3632 JSGlobalObject::cast(native_context->global_object())); |
| 3454 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); | 3633 Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol"); |
| 3455 Handle<JSObject> symbol = Handle<JSObject>::cast( | 3634 Handle<JSObject> symbol = Handle<JSObject>::cast( |
| 3456 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); | 3635 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); |
| 3457 Handle<String> name_string = factory->InternalizeUtf8String(name); | 3636 Handle<String> name_string = factory->InternalizeUtf8String(name); |
| 3458 PropertyAttributes attributes = | 3637 PropertyAttributes attributes = |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3999 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", | 4178 static const char* icu_case_mapping_natives[] = {"native icu-case-mapping.js", |
| 4000 nullptr}; | 4179 nullptr}; |
| 4001 static const char* datetime_format_to_parts_natives[] = { | 4180 static const char* datetime_format_to_parts_natives[] = { |
| 4002 "native datetime-format-to-parts.js", nullptr}; | 4181 "native datetime-format-to-parts.js", nullptr}; |
| 4003 #endif | 4182 #endif |
| 4004 static const char* harmony_async_await_natives[] = {nullptr}; | 4183 static const char* harmony_async_await_natives[] = {nullptr}; |
| 4005 static const char* harmony_restrictive_generators_natives[] = {nullptr}; | 4184 static const char* harmony_restrictive_generators_natives[] = {nullptr}; |
| 4006 static const char* harmony_trailing_commas_natives[] = {nullptr}; | 4185 static const char* harmony_trailing_commas_natives[] = {nullptr}; |
| 4007 static const char* harmony_class_fields_natives[] = {nullptr}; | 4186 static const char* harmony_class_fields_natives[] = {nullptr}; |
| 4008 static const char* harmony_object_spread_natives[] = {nullptr}; | 4187 static const char* harmony_object_spread_natives[] = {nullptr}; |
| 4188 static const char* harmony_async_iteration_natives[] = {nullptr}; | |
| 4009 | 4189 |
| 4010 for (int i = ExperimentalNatives::GetDebuggerCount(); | 4190 for (int i = ExperimentalNatives::GetDebuggerCount(); |
| 4011 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 4191 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
| 4012 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 4192 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
| 4013 if (FLAG_##id) { \ | 4193 if (FLAG_##id) { \ |
| 4014 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 4194 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
| 4015 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ | 4195 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
| 4016 if (strncmp(script_name.start(), id##_natives[j], \ | 4196 if (strncmp(script_name.start(), id##_natives[j], \ |
| 4017 script_name.length()) == 0) { \ | 4197 script_name.length()) == 0) { \ |
| 4018 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ | 4198 if (!Bootstrapper::CompileExperimentalBuiltin(isolate(), i)) { \ |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4600 HookUpGlobalProxy(global_proxy); | 4780 HookUpGlobalProxy(global_proxy); |
| 4601 } | 4781 } |
| 4602 DCHECK(!global_proxy->IsDetachedFrom(native_context()->global_object())); | 4782 DCHECK(!global_proxy->IsDetachedFrom(native_context()->global_object())); |
| 4603 } else { | 4783 } else { |
| 4604 DCHECK_EQ(0u, context_snapshot_index); | 4784 DCHECK_EQ(0u, context_snapshot_index); |
| 4605 // We get here if there was no context snapshot. | 4785 // We get here if there was no context snapshot. |
| 4606 CreateRoots(); | 4786 CreateRoots(); |
| 4607 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate); | 4787 Handle<JSFunction> empty_function = CreateEmptyFunction(isolate); |
| 4608 CreateStrictModeFunctionMaps(empty_function); | 4788 CreateStrictModeFunctionMaps(empty_function); |
| 4609 CreateIteratorMaps(empty_function); | 4789 CreateIteratorMaps(empty_function); |
| 4790 CreateAsyncIteratorMaps(empty_function); | |
| 4610 CreateAsyncFunctionMaps(empty_function); | 4791 CreateAsyncFunctionMaps(empty_function); |
| 4611 Handle<JSGlobalObject> global_object = | 4792 Handle<JSGlobalObject> global_object = |
| 4612 CreateNewGlobals(global_proxy_template, global_proxy); | 4793 CreateNewGlobals(global_proxy_template, global_proxy); |
| 4613 InitializeGlobal(global_object, empty_function, context_type); | 4794 InitializeGlobal(global_object, empty_function, context_type); |
| 4614 InitializeNormalizedMapCaches(); | 4795 InitializeNormalizedMapCaches(); |
| 4615 | 4796 |
| 4616 if (!InstallNatives(context_type)) return; | 4797 if (!InstallNatives(context_type)) return; |
| 4617 | 4798 |
| 4618 MakeFunctionInstancePrototypeWritable(); | 4799 MakeFunctionInstancePrototypeWritable(); |
| 4619 | 4800 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4742 } | 4923 } |
| 4743 | 4924 |
| 4744 | 4925 |
| 4745 // Called when the top-level V8 mutex is destroyed. | 4926 // Called when the top-level V8 mutex is destroyed. |
| 4746 void Bootstrapper::FreeThreadResources() { | 4927 void Bootstrapper::FreeThreadResources() { |
| 4747 DCHECK(!IsActive()); | 4928 DCHECK(!IsActive()); |
| 4748 } | 4929 } |
| 4749 | 4930 |
| 4750 } // namespace internal | 4931 } // namespace internal |
| 4751 } // namespace v8 | 4932 } // namespace v8 |
| OLD | NEW |