| 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 proxy_constructor_map->set_is_constructor(true); | 827 proxy_constructor_map->set_is_constructor(true); |
| 828 native_context()->set_proxy_constructor_map(*proxy_constructor_map); | 828 native_context()->set_proxy_constructor_map(*proxy_constructor_map); |
| 829 } | 829 } |
| 830 | 830 |
| 831 static void ReplaceAccessors(Handle<Map> map, | 831 static void ReplaceAccessors(Handle<Map> map, |
| 832 Handle<String> name, | 832 Handle<String> name, |
| 833 PropertyAttributes attributes, | 833 PropertyAttributes attributes, |
| 834 Handle<AccessorPair> accessor_pair) { | 834 Handle<AccessorPair> accessor_pair) { |
| 835 DescriptorArray* descriptors = map->instance_descriptors(); | 835 DescriptorArray* descriptors = map->instance_descriptors(); |
| 836 int idx = descriptors->SearchWithCache(map->GetIsolate(), *name, *map); | 836 int idx = descriptors->SearchWithCache(map->GetIsolate(), *name, *map); |
| 837 AccessorConstantDescriptor descriptor(name, accessor_pair, attributes); | 837 Descriptor d = Descriptor::AccessorConstant(name, accessor_pair, attributes); |
| 838 descriptors->Replace(idx, &descriptor); | 838 descriptors->Replace(idx, &d); |
| 839 } | 839 } |
| 840 | 840 |
| 841 void Genesis::AddRestrictedFunctionProperties(Handle<JSFunction> empty) { | 841 void Genesis::AddRestrictedFunctionProperties(Handle<JSFunction> empty) { |
| 842 PropertyAttributes rw_attribs = static_cast<PropertyAttributes>(DONT_ENUM); | 842 PropertyAttributes rw_attribs = static_cast<PropertyAttributes>(DONT_ENUM); |
| 843 Handle<JSFunction> thrower = GetRestrictedFunctionPropertiesThrower(); | 843 Handle<JSFunction> thrower = GetRestrictedFunctionPropertiesThrower(); |
| 844 Handle<AccessorPair> accessors = factory()->NewAccessorPair(); | 844 Handle<AccessorPair> accessors = factory()->NewAccessorPair(); |
| 845 accessors->set_getter(*thrower); | 845 accessors->set_getter(*thrower); |
| 846 accessors->set_setter(*thrower); | 846 accessors->set_setter(*thrower); |
| 847 | 847 |
| 848 Handle<Map> map(empty->map()); | 848 Handle<Map> map(empty->map()); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 Accessors::FunctionSetPrototype(error_fun, prototype).Assert(); | 1100 Accessors::FunctionSetPrototype(error_fun, prototype).Assert(); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 Handle<Map> initial_map(error_fun->initial_map()); | 1103 Handle<Map> initial_map(error_fun->initial_map()); |
| 1104 Map::EnsureDescriptorSlack(initial_map, 1); | 1104 Map::EnsureDescriptorSlack(initial_map, 1); |
| 1105 | 1105 |
| 1106 PropertyAttributes attribs = DONT_ENUM; | 1106 PropertyAttributes attribs = DONT_ENUM; |
| 1107 Handle<AccessorInfo> error_stack = | 1107 Handle<AccessorInfo> error_stack = |
| 1108 Accessors::ErrorStackInfo(isolate, attribs); | 1108 Accessors::ErrorStackInfo(isolate, attribs); |
| 1109 { | 1109 { |
| 1110 AccessorConstantDescriptor d(Handle<Name>(Name::cast(error_stack->name())), | 1110 Descriptor d = Descriptor::AccessorConstant( |
| 1111 error_stack, attribs); | 1111 Handle<Name>(Name::cast(error_stack->name())), error_stack, attribs); |
| 1112 initial_map->AppendDescriptor(&d); | 1112 initial_map->AppendDescriptor(&d); |
| 1113 } | 1113 } |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 static void InstallMakeError(Isolate* isolate, Handle<Code> code, | 1116 static void InstallMakeError(Isolate* isolate, Handle<Code> code, |
| 1117 int context_index) { | 1117 int context_index) { |
| 1118 Handle<JSFunction> function = | 1118 Handle<JSFunction> function = |
| 1119 isolate->factory()->NewFunction(isolate->factory()->empty_string(), code, | 1119 isolate->factory()->NewFunction(isolate->factory()->empty_string(), code, |
| 1120 JS_OBJECT_TYPE, JSObject::kHeaderSize); | 1120 JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 1121 function->shared()->DontAdaptArguments(); | 1121 function->shared()->DontAdaptArguments(); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 // HGraphBuilder::JSArrayBuilder::EmitMapCode() | 1311 // HGraphBuilder::JSArrayBuilder::EmitMapCode() |
| 1312 DCHECK(initial_map->elements_kind() == GetInitialFastElementsKind()); | 1312 DCHECK(initial_map->elements_kind() == GetInitialFastElementsKind()); |
| 1313 Map::EnsureDescriptorSlack(initial_map, 1); | 1313 Map::EnsureDescriptorSlack(initial_map, 1); |
| 1314 | 1314 |
| 1315 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 1315 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 1316 DONT_ENUM | DONT_DELETE); | 1316 DONT_ENUM | DONT_DELETE); |
| 1317 | 1317 |
| 1318 Handle<AccessorInfo> array_length = | 1318 Handle<AccessorInfo> array_length = |
| 1319 Accessors::ArrayLengthInfo(isolate, attribs); | 1319 Accessors::ArrayLengthInfo(isolate, attribs); |
| 1320 { // Add length. | 1320 { // Add length. |
| 1321 AccessorConstantDescriptor d( | 1321 Descriptor d = Descriptor::AccessorConstant( |
| 1322 Handle<Name>(Name::cast(array_length->name())), array_length, | 1322 Handle<Name>(Name::cast(array_length->name())), array_length, |
| 1323 attribs); | 1323 attribs); |
| 1324 initial_map->AppendDescriptor(&d); | 1324 initial_map->AppendDescriptor(&d); |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 InstallWithIntrinsicDefaultProto(isolate, array_function, | 1327 InstallWithIntrinsicDefaultProto(isolate, array_function, |
| 1328 Context::ARRAY_FUNCTION_INDEX); | 1328 Context::ARRAY_FUNCTION_INDEX); |
| 1329 | 1329 |
| 1330 // Cache the array maps, needed by ArrayConstructorStub | 1330 // Cache the array maps, needed by ArrayConstructorStub |
| 1331 CacheInitialJSArrayMaps(native_context(), initial_map); | 1331 CacheInitialJSArrayMaps(native_context(), initial_map); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 Handle<Map>(native_context()->string_function()->initial_map()); | 1535 Handle<Map>(native_context()->string_function()->initial_map()); |
| 1536 string_map->set_elements_kind(FAST_STRING_WRAPPER_ELEMENTS); | 1536 string_map->set_elements_kind(FAST_STRING_WRAPPER_ELEMENTS); |
| 1537 Map::EnsureDescriptorSlack(string_map, 1); | 1537 Map::EnsureDescriptorSlack(string_map, 1); |
| 1538 | 1538 |
| 1539 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 1539 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 1540 DONT_ENUM | DONT_DELETE | READ_ONLY); | 1540 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 1541 Handle<AccessorInfo> string_length( | 1541 Handle<AccessorInfo> string_length( |
| 1542 Accessors::StringLengthInfo(isolate, attribs)); | 1542 Accessors::StringLengthInfo(isolate, attribs)); |
| 1543 | 1543 |
| 1544 { // Add length. | 1544 { // Add length. |
| 1545 AccessorConstantDescriptor d(factory->length_string(), string_length, | 1545 Descriptor d = Descriptor::AccessorConstant(factory->length_string(), |
| 1546 attribs); | 1546 string_length, attribs); |
| 1547 string_map->AppendDescriptor(&d); | 1547 string_map->AppendDescriptor(&d); |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 // Install the String.fromCharCode function. | 1550 // Install the String.fromCharCode function. |
| 1551 SimpleInstallFunction(string_fun, "fromCharCode", | 1551 SimpleInstallFunction(string_fun, "fromCharCode", |
| 1552 Builtins::kStringFromCharCode, 1, false); | 1552 Builtins::kStringFromCharCode, 1, false); |
| 1553 | 1553 |
| 1554 // Install the String.fromCodePoint function. | 1554 // Install the String.fromCodePoint function. |
| 1555 SimpleInstallFunction(string_fun, "fromCodePoint", | 1555 SimpleInstallFunction(string_fun, "fromCodePoint", |
| 1556 Builtins::kStringFromCodePoint, 1, false); | 1556 Builtins::kStringFromCodePoint, 1, false); |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 DCHECK(regexp_fun->has_initial_map()); | 2136 DCHECK(regexp_fun->has_initial_map()); |
| 2137 Handle<Map> initial_map(regexp_fun->initial_map()); | 2137 Handle<Map> initial_map(regexp_fun->initial_map()); |
| 2138 | 2138 |
| 2139 DCHECK_EQ(0, initial_map->GetInObjectProperties()); | 2139 DCHECK_EQ(0, initial_map->GetInObjectProperties()); |
| 2140 | 2140 |
| 2141 Map::EnsureDescriptorSlack(initial_map, 1); | 2141 Map::EnsureDescriptorSlack(initial_map, 1); |
| 2142 | 2142 |
| 2143 // ECMA-262, section 15.10.7.5. | 2143 // ECMA-262, section 15.10.7.5. |
| 2144 PropertyAttributes writable = | 2144 PropertyAttributes writable = |
| 2145 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 2145 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
| 2146 DataDescriptor field(factory->lastIndex_string(), | 2146 Descriptor d = Descriptor::DataField(factory->lastIndex_string(), |
| 2147 JSRegExp::kLastIndexFieldIndex, writable, | 2147 JSRegExp::kLastIndexFieldIndex, |
| 2148 Representation::Tagged()); | 2148 writable, Representation::Tagged()); |
| 2149 initial_map->AppendDescriptor(&field); | 2149 initial_map->AppendDescriptor(&d); |
| 2150 | 2150 |
| 2151 static const int num_fields = JSRegExp::kInObjectFieldCount; | 2151 static const int num_fields = JSRegExp::kInObjectFieldCount; |
| 2152 initial_map->SetInObjectProperties(num_fields); | 2152 initial_map->SetInObjectProperties(num_fields); |
| 2153 initial_map->set_unused_property_fields(0); | 2153 initial_map->set_unused_property_fields(0); |
| 2154 initial_map->set_instance_size(initial_map->instance_size() + | 2154 initial_map->set_instance_size(initial_map->instance_size() + |
| 2155 num_fields * kPointerSize); | 2155 num_fields * kPointerSize); |
| 2156 | 2156 |
| 2157 { // Internal: RegExpInternalMatch | 2157 { // Internal: RegExpInternalMatch |
| 2158 Handle<JSFunction> function = | 2158 Handle<JSFunction> function = |
| 2159 factory->NewFunction(isolate->factory()->empty_string(), | 2159 factory->NewFunction(isolate->factory()->empty_string(), |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 { // -- J S M o d u l e N a m e s p a c e | 2481 { // -- J S M o d u l e N a m e s p a c e |
| 2482 Handle<Map> map = | 2482 Handle<Map> map = |
| 2483 factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize); | 2483 factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize); |
| 2484 Map::SetPrototype(map, isolate->factory()->null_value()); | 2484 Map::SetPrototype(map, isolate->factory()->null_value()); |
| 2485 Map::EnsureDescriptorSlack(map, 1); | 2485 Map::EnsureDescriptorSlack(map, 1); |
| 2486 native_context()->set_js_module_namespace_map(*map); | 2486 native_context()->set_js_module_namespace_map(*map); |
| 2487 | 2487 |
| 2488 { // Install @@toStringTag. | 2488 { // Install @@toStringTag. |
| 2489 PropertyAttributes attribs = | 2489 PropertyAttributes attribs = |
| 2490 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); | 2490 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
| 2491 DataConstantDescriptor d(factory->to_string_tag_symbol(), | 2491 Descriptor d = Descriptor::DataConstant( |
| 2492 factory->NewStringFromAsciiChecked("Module"), | 2492 factory->to_string_tag_symbol(), |
| 2493 attribs); | 2493 factory->NewStringFromAsciiChecked("Module"), attribs); |
| 2494 map->AppendDescriptor(&d); | 2494 map->AppendDescriptor(&d); |
| 2495 } | 2495 } |
| 2496 } | 2496 } |
| 2497 | 2497 |
| 2498 { // -- I t e r a t o r R e s u l t | 2498 { // -- I t e r a t o r R e s u l t |
| 2499 Handle<Map> map = | 2499 Handle<Map> map = |
| 2500 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize); | 2500 factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize); |
| 2501 Map::SetPrototype(map, isolate->initial_object_prototype()); | 2501 Map::SetPrototype(map, isolate->initial_object_prototype()); |
| 2502 Map::EnsureDescriptorSlack(map, 2); | 2502 Map::EnsureDescriptorSlack(map, 2); |
| 2503 | 2503 |
| 2504 { // value | 2504 { // value |
| 2505 DataDescriptor d(factory->value_string(), JSIteratorResult::kValueIndex, | 2505 Descriptor d = Descriptor::DataField(factory->value_string(), |
| 2506 NONE, Representation::Tagged()); | 2506 JSIteratorResult::kValueIndex, NONE, |
| 2507 Representation::Tagged()); |
| 2507 map->AppendDescriptor(&d); | 2508 map->AppendDescriptor(&d); |
| 2508 } | 2509 } |
| 2509 | 2510 |
| 2510 { // done | 2511 { // done |
| 2511 DataDescriptor d(factory->done_string(), JSIteratorResult::kDoneIndex, | 2512 Descriptor d = Descriptor::DataField(factory->done_string(), |
| 2512 NONE, Representation::Tagged()); | 2513 JSIteratorResult::kDoneIndex, NONE, |
| 2514 Representation::Tagged()); |
| 2513 map->AppendDescriptor(&d); | 2515 map->AppendDescriptor(&d); |
| 2514 } | 2516 } |
| 2515 | 2517 |
| 2516 map->SetConstructor(native_context()->object_function()); | 2518 map->SetConstructor(native_context()->object_function()); |
| 2517 map->SetInObjectProperties(2); | 2519 map->SetInObjectProperties(2); |
| 2518 native_context()->set_iterator_result_map(*map); | 2520 native_context()->set_iterator_result_map(*map); |
| 2519 } | 2521 } |
| 2520 | 2522 |
| 2521 { // -- W e a k M a p | 2523 { // -- W e a k M a p |
| 2522 Handle<JSFunction> js_weak_map_fun = InstallFunction( | 2524 Handle<JSFunction> js_weak_map_fun = InstallFunction( |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2608 map->set_is_callable(); | 2610 map->set_is_callable(); |
| 2609 Map::SetPrototype(map, empty_function); | 2611 Map::SetPrototype(map, empty_function); |
| 2610 | 2612 |
| 2611 PropertyAttributes roc_attribs = | 2613 PropertyAttributes roc_attribs = |
| 2612 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); | 2614 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
| 2613 Map::EnsureDescriptorSlack(map, 2); | 2615 Map::EnsureDescriptorSlack(map, 2); |
| 2614 | 2616 |
| 2615 Handle<AccessorInfo> bound_length = | 2617 Handle<AccessorInfo> bound_length = |
| 2616 Accessors::BoundFunctionLengthInfo(isolate, roc_attribs); | 2618 Accessors::BoundFunctionLengthInfo(isolate, roc_attribs); |
| 2617 { // length | 2619 { // length |
| 2618 AccessorConstantDescriptor d(factory->length_string(), bound_length, | 2620 Descriptor d = Descriptor::AccessorConstant(factory->length_string(), |
| 2619 roc_attribs); | 2621 bound_length, roc_attribs); |
| 2620 map->AppendDescriptor(&d); | 2622 map->AppendDescriptor(&d); |
| 2621 } | 2623 } |
| 2622 Handle<AccessorInfo> bound_name = | 2624 Handle<AccessorInfo> bound_name = |
| 2623 Accessors::BoundFunctionNameInfo(isolate, roc_attribs); | 2625 Accessors::BoundFunctionNameInfo(isolate, roc_attribs); |
| 2624 { // length | 2626 { // name |
| 2625 AccessorConstantDescriptor d(factory->name_string(), bound_name, | 2627 Descriptor d = Descriptor::AccessorConstant(factory->name_string(), |
| 2626 roc_attribs); | 2628 bound_name, roc_attribs); |
| 2627 map->AppendDescriptor(&d); | 2629 map->AppendDescriptor(&d); |
| 2628 } | 2630 } |
| 2629 map->SetInObjectProperties(0); | 2631 map->SetInObjectProperties(0); |
| 2630 native_context()->set_bound_function_without_constructor_map(*map); | 2632 native_context()->set_bound_function_without_constructor_map(*map); |
| 2631 | 2633 |
| 2632 map = Map::Copy(map, "IsConstructor"); | 2634 map = Map::Copy(map, "IsConstructor"); |
| 2633 map->set_is_constructor(true); | 2635 map->set_is_constructor(true); |
| 2634 native_context()->set_bound_function_with_constructor_map(*map); | 2636 native_context()->set_bound_function_with_constructor_map(*map); |
| 2635 } | 2637 } |
| 2636 | 2638 |
| 2637 { // --- sloppy arguments map | 2639 { // --- sloppy arguments map |
| 2638 // Make sure we can recognize argument objects at runtime. | 2640 // Make sure we can recognize argument objects at runtime. |
| 2639 // This is done by introducing an anonymous function with | 2641 // This is done by introducing an anonymous function with |
| 2640 // class_name equals 'Arguments'. | 2642 // class_name equals 'Arguments'. |
| 2641 Handle<String> arguments_string = factory->Arguments_string(); | 2643 Handle<String> arguments_string = factory->Arguments_string(); |
| 2642 Handle<Code> code = isolate->builtins()->Illegal(); | 2644 Handle<Code> code = isolate->builtins()->Illegal(); |
| 2643 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( | 2645 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( |
| 2644 arguments_string, code); | 2646 arguments_string, code); |
| 2645 function->shared()->set_instance_class_name(*arguments_string); | 2647 function->shared()->set_instance_class_name(*arguments_string); |
| 2646 | 2648 |
| 2647 Handle<Map> map = factory->NewMap( | 2649 Handle<Map> map = factory->NewMap( |
| 2648 JS_ARGUMENTS_TYPE, JSSloppyArgumentsObject::kSize, FAST_ELEMENTS); | 2650 JS_ARGUMENTS_TYPE, JSSloppyArgumentsObject::kSize, FAST_ELEMENTS); |
| 2649 // Create the descriptor array for the arguments object. | 2651 // Create the descriptor array for the arguments object. |
| 2650 Map::EnsureDescriptorSlack(map, 2); | 2652 Map::EnsureDescriptorSlack(map, 2); |
| 2651 | 2653 |
| 2652 { // length | 2654 { // length |
| 2653 DataDescriptor d(factory->length_string(), | 2655 Descriptor d = Descriptor::DataField( |
| 2654 JSSloppyArgumentsObject::kLengthIndex, DONT_ENUM, | 2656 factory->length_string(), JSSloppyArgumentsObject::kLengthIndex, |
| 2655 Representation::Tagged()); | 2657 DONT_ENUM, Representation::Tagged()); |
| 2656 map->AppendDescriptor(&d); | 2658 map->AppendDescriptor(&d); |
| 2657 } | 2659 } |
| 2658 { // callee | 2660 { // callee |
| 2659 DataDescriptor d(factory->callee_string(), | 2661 Descriptor d = Descriptor::DataField( |
| 2660 JSSloppyArgumentsObject::kCalleeIndex, DONT_ENUM, | 2662 factory->callee_string(), JSSloppyArgumentsObject::kCalleeIndex, |
| 2661 Representation::Tagged()); | 2663 DONT_ENUM, Representation::Tagged()); |
| 2662 map->AppendDescriptor(&d); | 2664 map->AppendDescriptor(&d); |
| 2663 } | 2665 } |
| 2664 // @@iterator method is added later. | 2666 // @@iterator method is added later. |
| 2665 | 2667 |
| 2666 map->SetInObjectProperties(2); | 2668 map->SetInObjectProperties(2); |
| 2667 native_context()->set_sloppy_arguments_map(*map); | 2669 native_context()->set_sloppy_arguments_map(*map); |
| 2668 | 2670 |
| 2669 DCHECK(!function->has_initial_map()); | 2671 DCHECK(!function->has_initial_map()); |
| 2670 JSFunction::SetInitialMap(function, map, | 2672 JSFunction::SetInitialMap(function, map, |
| 2671 isolate->initial_object_prototype()); | 2673 isolate->initial_object_prototype()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2700 callee->set_getter(*poison); | 2702 callee->set_getter(*poison); |
| 2701 callee->set_setter(*poison); | 2703 callee->set_setter(*poison); |
| 2702 | 2704 |
| 2703 // Create the map. Allocate one in-object field for length. | 2705 // Create the map. Allocate one in-object field for length. |
| 2704 Handle<Map> map = factory->NewMap( | 2706 Handle<Map> map = factory->NewMap( |
| 2705 JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, FAST_ELEMENTS); | 2707 JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, FAST_ELEMENTS); |
| 2706 // Create the descriptor array for the arguments object. | 2708 // Create the descriptor array for the arguments object. |
| 2707 Map::EnsureDescriptorSlack(map, 2); | 2709 Map::EnsureDescriptorSlack(map, 2); |
| 2708 | 2710 |
| 2709 { // length | 2711 { // length |
| 2710 DataDescriptor d(factory->length_string(), | 2712 Descriptor d = Descriptor::DataField( |
| 2711 JSStrictArgumentsObject::kLengthIndex, DONT_ENUM, | 2713 factory->length_string(), JSStrictArgumentsObject::kLengthIndex, |
| 2712 Representation::Tagged()); | 2714 DONT_ENUM, Representation::Tagged()); |
| 2713 map->AppendDescriptor(&d); | 2715 map->AppendDescriptor(&d); |
| 2714 } | 2716 } |
| 2715 { // callee | 2717 { // callee |
| 2716 AccessorConstantDescriptor d(factory->callee_string(), callee, | 2718 Descriptor d = Descriptor::AccessorConstant(factory->callee_string(), |
| 2717 attributes); | 2719 callee, attributes); |
| 2718 map->AppendDescriptor(&d); | 2720 map->AppendDescriptor(&d); |
| 2719 } | 2721 } |
| 2720 // @@iterator method is added later. | 2722 // @@iterator method is added later. |
| 2721 | 2723 |
| 2722 DCHECK_EQ(native_context()->object_function()->prototype(), | 2724 DCHECK_EQ(native_context()->object_function()->prototype(), |
| 2723 *isolate->initial_object_prototype()); | 2725 *isolate->initial_object_prototype()); |
| 2724 Map::SetPrototype(map, isolate->initial_object_prototype()); | 2726 Map::SetPrototype(map, isolate->initial_object_prototype()); |
| 2725 map->SetInObjectProperties(1); | 2727 map->SetInObjectProperties(1); |
| 2726 | 2728 |
| 2727 // Copy constructor from the sloppy arguments boilerplate. | 2729 // Copy constructor from the sloppy arguments boilerplate. |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3120 | 3122 |
| 3121 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); | 3123 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); |
| 3122 Map::EnsureDescriptorSlack(script_map, 15); | 3124 Map::EnsureDescriptorSlack(script_map, 15); |
| 3123 | 3125 |
| 3124 PropertyAttributes attribs = | 3126 PropertyAttributes attribs = |
| 3125 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 3127 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 3126 | 3128 |
| 3127 Handle<AccessorInfo> script_column = | 3129 Handle<AccessorInfo> script_column = |
| 3128 Accessors::ScriptColumnOffsetInfo(isolate, attribs); | 3130 Accessors::ScriptColumnOffsetInfo(isolate, attribs); |
| 3129 { | 3131 { |
| 3130 AccessorConstantDescriptor d( | 3132 Descriptor d = Descriptor::AccessorConstant( |
| 3131 Handle<Name>(Name::cast(script_column->name())), script_column, | 3133 Handle<Name>(Name::cast(script_column->name())), script_column, |
| 3132 attribs); | 3134 attribs); |
| 3133 script_map->AppendDescriptor(&d); | 3135 script_map->AppendDescriptor(&d); |
| 3134 } | 3136 } |
| 3135 | 3137 |
| 3136 Handle<AccessorInfo> script_id = Accessors::ScriptIdInfo(isolate, attribs); | 3138 Handle<AccessorInfo> script_id = Accessors::ScriptIdInfo(isolate, attribs); |
| 3137 { | 3139 { |
| 3138 AccessorConstantDescriptor d(Handle<Name>(Name::cast(script_id->name())), | 3140 Descriptor d = Descriptor::AccessorConstant( |
| 3139 script_id, attribs); | 3141 Handle<Name>(Name::cast(script_id->name())), script_id, attribs); |
| 3140 script_map->AppendDescriptor(&d); | 3142 script_map->AppendDescriptor(&d); |
| 3141 } | 3143 } |
| 3142 | 3144 |
| 3143 | 3145 |
| 3144 Handle<AccessorInfo> script_name = | 3146 Handle<AccessorInfo> script_name = |
| 3145 Accessors::ScriptNameInfo(isolate, attribs); | 3147 Accessors::ScriptNameInfo(isolate, attribs); |
| 3146 { | 3148 { |
| 3147 AccessorConstantDescriptor d( | 3149 Descriptor d = Descriptor::AccessorConstant( |
| 3148 Handle<Name>(Name::cast(script_name->name())), script_name, attribs); | 3150 Handle<Name>(Name::cast(script_name->name())), script_name, attribs); |
| 3149 script_map->AppendDescriptor(&d); | 3151 script_map->AppendDescriptor(&d); |
| 3150 } | 3152 } |
| 3151 | 3153 |
| 3152 Handle<AccessorInfo> script_line = | 3154 Handle<AccessorInfo> script_line = |
| 3153 Accessors::ScriptLineOffsetInfo(isolate, attribs); | 3155 Accessors::ScriptLineOffsetInfo(isolate, attribs); |
| 3154 { | 3156 { |
| 3155 AccessorConstantDescriptor d( | 3157 Descriptor d = Descriptor::AccessorConstant( |
| 3156 Handle<Name>(Name::cast(script_line->name())), script_line, attribs); | 3158 Handle<Name>(Name::cast(script_line->name())), script_line, attribs); |
| 3157 script_map->AppendDescriptor(&d); | 3159 script_map->AppendDescriptor(&d); |
| 3158 } | 3160 } |
| 3159 | 3161 |
| 3160 Handle<AccessorInfo> script_source = | 3162 Handle<AccessorInfo> script_source = |
| 3161 Accessors::ScriptSourceInfo(isolate, attribs); | 3163 Accessors::ScriptSourceInfo(isolate, attribs); |
| 3162 { | 3164 { |
| 3163 AccessorConstantDescriptor d( | 3165 Descriptor d = Descriptor::AccessorConstant( |
| 3164 Handle<Name>(Name::cast(script_source->name())), script_source, | 3166 Handle<Name>(Name::cast(script_source->name())), script_source, |
| 3165 attribs); | 3167 attribs); |
| 3166 script_map->AppendDescriptor(&d); | 3168 script_map->AppendDescriptor(&d); |
| 3167 } | 3169 } |
| 3168 | 3170 |
| 3169 Handle<AccessorInfo> script_type = | 3171 Handle<AccessorInfo> script_type = |
| 3170 Accessors::ScriptTypeInfo(isolate, attribs); | 3172 Accessors::ScriptTypeInfo(isolate, attribs); |
| 3171 { | 3173 { |
| 3172 AccessorConstantDescriptor d( | 3174 Descriptor d = Descriptor::AccessorConstant( |
| 3173 Handle<Name>(Name::cast(script_type->name())), script_type, attribs); | 3175 Handle<Name>(Name::cast(script_type->name())), script_type, attribs); |
| 3174 script_map->AppendDescriptor(&d); | 3176 script_map->AppendDescriptor(&d); |
| 3175 } | 3177 } |
| 3176 | 3178 |
| 3177 Handle<AccessorInfo> script_compilation_type = | 3179 Handle<AccessorInfo> script_compilation_type = |
| 3178 Accessors::ScriptCompilationTypeInfo(isolate, attribs); | 3180 Accessors::ScriptCompilationTypeInfo(isolate, attribs); |
| 3179 { | 3181 { |
| 3180 AccessorConstantDescriptor d( | 3182 Descriptor d = Descriptor::AccessorConstant( |
| 3181 Handle<Name>(Name::cast(script_compilation_type->name())), | 3183 Handle<Name>(Name::cast(script_compilation_type->name())), |
| 3182 script_compilation_type, attribs); | 3184 script_compilation_type, attribs); |
| 3183 script_map->AppendDescriptor(&d); | 3185 script_map->AppendDescriptor(&d); |
| 3184 } | 3186 } |
| 3185 | 3187 |
| 3186 Handle<AccessorInfo> script_context_data = | 3188 Handle<AccessorInfo> script_context_data = |
| 3187 Accessors::ScriptContextDataInfo(isolate, attribs); | 3189 Accessors::ScriptContextDataInfo(isolate, attribs); |
| 3188 { | 3190 { |
| 3189 AccessorConstantDescriptor d( | 3191 Descriptor d = Descriptor::AccessorConstant( |
| 3190 Handle<Name>(Name::cast(script_context_data->name())), | 3192 Handle<Name>(Name::cast(script_context_data->name())), |
| 3191 script_context_data, attribs); | 3193 script_context_data, attribs); |
| 3192 script_map->AppendDescriptor(&d); | 3194 script_map->AppendDescriptor(&d); |
| 3193 } | 3195 } |
| 3194 | 3196 |
| 3195 Handle<AccessorInfo> script_eval_from_script = | 3197 Handle<AccessorInfo> script_eval_from_script = |
| 3196 Accessors::ScriptEvalFromScriptInfo(isolate, attribs); | 3198 Accessors::ScriptEvalFromScriptInfo(isolate, attribs); |
| 3197 { | 3199 { |
| 3198 AccessorConstantDescriptor d( | 3200 Descriptor d = Descriptor::AccessorConstant( |
| 3199 Handle<Name>(Name::cast(script_eval_from_script->name())), | 3201 Handle<Name>(Name::cast(script_eval_from_script->name())), |
| 3200 script_eval_from_script, attribs); | 3202 script_eval_from_script, attribs); |
| 3201 script_map->AppendDescriptor(&d); | 3203 script_map->AppendDescriptor(&d); |
| 3202 } | 3204 } |
| 3203 | 3205 |
| 3204 Handle<AccessorInfo> script_eval_from_script_position = | 3206 Handle<AccessorInfo> script_eval_from_script_position = |
| 3205 Accessors::ScriptEvalFromScriptPositionInfo(isolate, attribs); | 3207 Accessors::ScriptEvalFromScriptPositionInfo(isolate, attribs); |
| 3206 { | 3208 { |
| 3207 AccessorConstantDescriptor d( | 3209 Descriptor d = Descriptor::AccessorConstant( |
| 3208 Handle<Name>(Name::cast(script_eval_from_script_position->name())), | 3210 Handle<Name>(Name::cast(script_eval_from_script_position->name())), |
| 3209 script_eval_from_script_position, attribs); | 3211 script_eval_from_script_position, attribs); |
| 3210 script_map->AppendDescriptor(&d); | 3212 script_map->AppendDescriptor(&d); |
| 3211 } | 3213 } |
| 3212 | 3214 |
| 3213 Handle<AccessorInfo> script_eval_from_function_name = | 3215 Handle<AccessorInfo> script_eval_from_function_name = |
| 3214 Accessors::ScriptEvalFromFunctionNameInfo(isolate, attribs); | 3216 Accessors::ScriptEvalFromFunctionNameInfo(isolate, attribs); |
| 3215 { | 3217 { |
| 3216 AccessorConstantDescriptor d( | 3218 Descriptor d = Descriptor::AccessorConstant( |
| 3217 Handle<Name>(Name::cast(script_eval_from_function_name->name())), | 3219 Handle<Name>(Name::cast(script_eval_from_function_name->name())), |
| 3218 script_eval_from_function_name, attribs); | 3220 script_eval_from_function_name, attribs); |
| 3219 script_map->AppendDescriptor(&d); | 3221 script_map->AppendDescriptor(&d); |
| 3220 } | 3222 } |
| 3221 | 3223 |
| 3222 Handle<AccessorInfo> script_source_url = | 3224 Handle<AccessorInfo> script_source_url = |
| 3223 Accessors::ScriptSourceUrlInfo(isolate, attribs); | 3225 Accessors::ScriptSourceUrlInfo(isolate, attribs); |
| 3224 { | 3226 { |
| 3225 AccessorConstantDescriptor d( | 3227 Descriptor d = Descriptor::AccessorConstant( |
| 3226 Handle<Name>(Name::cast(script_source_url->name())), | 3228 Handle<Name>(Name::cast(script_source_url->name())), |
| 3227 script_source_url, attribs); | 3229 script_source_url, attribs); |
| 3228 script_map->AppendDescriptor(&d); | 3230 script_map->AppendDescriptor(&d); |
| 3229 } | 3231 } |
| 3230 | 3232 |
| 3231 Handle<AccessorInfo> script_source_mapping_url = | 3233 Handle<AccessorInfo> script_source_mapping_url = |
| 3232 Accessors::ScriptSourceMappingUrlInfo(isolate, attribs); | 3234 Accessors::ScriptSourceMappingUrlInfo(isolate, attribs); |
| 3233 { | 3235 { |
| 3234 AccessorConstantDescriptor d( | 3236 Descriptor d = Descriptor::AccessorConstant( |
| 3235 Handle<Name>(Name::cast(script_source_mapping_url->name())), | 3237 Handle<Name>(Name::cast(script_source_mapping_url->name())), |
| 3236 script_source_mapping_url, attribs); | 3238 script_source_mapping_url, attribs); |
| 3237 script_map->AppendDescriptor(&d); | 3239 script_map->AppendDescriptor(&d); |
| 3238 } | 3240 } |
| 3239 | 3241 |
| 3240 { | 3242 { |
| 3241 PrototypeIterator iter(native_context->sloppy_async_function_map()); | 3243 PrototypeIterator iter(native_context->sloppy_async_function_map()); |
| 3242 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>()); | 3244 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>()); |
| 3243 | 3245 |
| 3244 static const bool kUseStrictFunctionMap = true; | 3246 static const bool kUseStrictFunctionMap = true; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3527 | 3529 |
| 3528 // Make "length" magic on instances. | 3530 // Make "length" magic on instances. |
| 3529 Map::EnsureDescriptorSlack(initial_map, 1); | 3531 Map::EnsureDescriptorSlack(initial_map, 1); |
| 3530 | 3532 |
| 3531 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 3533 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 3532 DONT_ENUM | DONT_DELETE); | 3534 DONT_ENUM | DONT_DELETE); |
| 3533 | 3535 |
| 3534 Handle<AccessorInfo> array_length = | 3536 Handle<AccessorInfo> array_length = |
| 3535 Accessors::ArrayLengthInfo(isolate(), attribs); | 3537 Accessors::ArrayLengthInfo(isolate(), attribs); |
| 3536 { // Add length. | 3538 { // Add length. |
| 3537 AccessorConstantDescriptor d(Handle<Name>(Name::cast(array_length->name())), | 3539 Descriptor d = Descriptor::AccessorConstant( |
| 3538 array_length, attribs); | 3540 Handle<Name>(Name::cast(array_length->name())), array_length, attribs); |
| 3539 initial_map->AppendDescriptor(&d); | 3541 initial_map->AppendDescriptor(&d); |
| 3540 } | 3542 } |
| 3541 | 3543 |
| 3542 return array_function; | 3544 return array_function; |
| 3543 } | 3545 } |
| 3544 | 3546 |
| 3545 bool Genesis::InstallNatives(GlobalContextType context_type) { | 3547 bool Genesis::InstallNatives(GlobalContextType context_type) { |
| 3546 HandleScope scope(isolate()); | 3548 HandleScope scope(isolate()); |
| 3547 | 3549 |
| 3548 // Set up the utils object as shared container between native scripts. | 3550 // Set up the utils object as shared container between native scripts. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3723 // Create a map for accessor property descriptors (a variant of JSObject | 3725 // Create a map for accessor property descriptors (a variant of JSObject |
| 3724 // that predefines four properties get, set, configurable and enumerable). | 3726 // that predefines four properties get, set, configurable and enumerable). |
| 3725 { | 3727 { |
| 3726 // AccessorPropertyDescriptor initial map. | 3728 // AccessorPropertyDescriptor initial map. |
| 3727 Handle<Map> map = | 3729 Handle<Map> map = |
| 3728 factory()->NewMap(JS_OBJECT_TYPE, JSAccessorPropertyDescriptor::kSize); | 3730 factory()->NewMap(JS_OBJECT_TYPE, JSAccessorPropertyDescriptor::kSize); |
| 3729 // Create the descriptor array for the property descriptor object. | 3731 // Create the descriptor array for the property descriptor object. |
| 3730 Map::EnsureDescriptorSlack(map, 4); | 3732 Map::EnsureDescriptorSlack(map, 4); |
| 3731 | 3733 |
| 3732 { // get | 3734 { // get |
| 3733 DataDescriptor d(factory()->get_string(), | 3735 Descriptor d = Descriptor::DataField( |
| 3734 JSAccessorPropertyDescriptor::kGetIndex, NONE, | 3736 factory()->get_string(), JSAccessorPropertyDescriptor::kGetIndex, |
| 3735 Representation::Tagged()); | 3737 NONE, Representation::Tagged()); |
| 3736 map->AppendDescriptor(&d); | 3738 map->AppendDescriptor(&d); |
| 3737 } | 3739 } |
| 3738 { // set | 3740 { // set |
| 3739 DataDescriptor d(factory()->set_string(), | 3741 Descriptor d = Descriptor::DataField( |
| 3740 JSAccessorPropertyDescriptor::kSetIndex, NONE, | 3742 factory()->set_string(), JSAccessorPropertyDescriptor::kSetIndex, |
| 3741 Representation::Tagged()); | 3743 NONE, Representation::Tagged()); |
| 3742 map->AppendDescriptor(&d); | 3744 map->AppendDescriptor(&d); |
| 3743 } | 3745 } |
| 3744 { // enumerable | 3746 { // enumerable |
| 3745 DataDescriptor d(factory()->enumerable_string(), | 3747 Descriptor d = |
| 3746 JSAccessorPropertyDescriptor::kEnumerableIndex, NONE, | 3748 Descriptor::DataField(factory()->enumerable_string(), |
| 3747 Representation::Tagged()); | 3749 JSAccessorPropertyDescriptor::kEnumerableIndex, |
| 3750 NONE, Representation::Tagged()); |
| 3748 map->AppendDescriptor(&d); | 3751 map->AppendDescriptor(&d); |
| 3749 } | 3752 } |
| 3750 { // configurable | 3753 { // configurable |
| 3751 DataDescriptor d(factory()->configurable_string(), | 3754 Descriptor d = Descriptor::DataField( |
| 3752 JSAccessorPropertyDescriptor::kConfigurableIndex, NONE, | 3755 factory()->configurable_string(), |
| 3753 Representation::Tagged()); | 3756 JSAccessorPropertyDescriptor::kConfigurableIndex, NONE, |
| 3757 Representation::Tagged()); |
| 3754 map->AppendDescriptor(&d); | 3758 map->AppendDescriptor(&d); |
| 3755 } | 3759 } |
| 3756 | 3760 |
| 3757 Map::SetPrototype(map, isolate()->initial_object_prototype()); | 3761 Map::SetPrototype(map, isolate()->initial_object_prototype()); |
| 3758 map->SetConstructor(native_context()->object_function()); | 3762 map->SetConstructor(native_context()->object_function()); |
| 3759 map->SetInObjectProperties(4); | 3763 map->SetInObjectProperties(4); |
| 3760 map->set_unused_property_fields(0); | 3764 map->set_unused_property_fields(0); |
| 3761 | 3765 |
| 3762 native_context()->set_accessor_property_descriptor_map(*map); | 3766 native_context()->set_accessor_property_descriptor_map(*map); |
| 3763 } | 3767 } |
| 3764 | 3768 |
| 3765 // Create a map for data property descriptors (a variant of JSObject | 3769 // Create a map for data property descriptors (a variant of JSObject |
| 3766 // that predefines four properties value, writable, configurable and | 3770 // that predefines four properties value, writable, configurable and |
| 3767 // enumerable). | 3771 // enumerable). |
| 3768 { | 3772 { |
| 3769 // DataPropertyDescriptor initial map. | 3773 // DataPropertyDescriptor initial map. |
| 3770 Handle<Map> map = | 3774 Handle<Map> map = |
| 3771 factory()->NewMap(JS_OBJECT_TYPE, JSDataPropertyDescriptor::kSize); | 3775 factory()->NewMap(JS_OBJECT_TYPE, JSDataPropertyDescriptor::kSize); |
| 3772 // Create the descriptor array for the property descriptor object. | 3776 // Create the descriptor array for the property descriptor object. |
| 3773 Map::EnsureDescriptorSlack(map, 4); | 3777 Map::EnsureDescriptorSlack(map, 4); |
| 3774 | 3778 |
| 3775 { // value | 3779 { // value |
| 3776 DataDescriptor d(factory()->value_string(), | 3780 Descriptor d = Descriptor::DataField( |
| 3777 JSDataPropertyDescriptor::kValueIndex, NONE, | 3781 factory()->value_string(), JSDataPropertyDescriptor::kValueIndex, |
| 3778 Representation::Tagged()); | 3782 NONE, Representation::Tagged()); |
| 3779 map->AppendDescriptor(&d); | 3783 map->AppendDescriptor(&d); |
| 3780 } | 3784 } |
| 3781 { // writable | 3785 { // writable |
| 3782 DataDescriptor d(factory()->writable_string(), | 3786 Descriptor d = |
| 3783 JSDataPropertyDescriptor::kWritableIndex, NONE, | 3787 Descriptor::DataField(factory()->writable_string(), |
| 3784 Representation::Tagged()); | 3788 JSDataPropertyDescriptor::kWritableIndex, NONE, |
| 3789 Representation::Tagged()); |
| 3785 map->AppendDescriptor(&d); | 3790 map->AppendDescriptor(&d); |
| 3786 } | 3791 } |
| 3787 { // enumerable | 3792 { // enumerable |
| 3788 DataDescriptor d(factory()->enumerable_string(), | 3793 Descriptor d = |
| 3789 JSDataPropertyDescriptor::kEnumerableIndex, NONE, | 3794 Descriptor::DataField(factory()->enumerable_string(), |
| 3790 Representation::Tagged()); | 3795 JSDataPropertyDescriptor::kEnumerableIndex, |
| 3796 NONE, Representation::Tagged()); |
| 3791 map->AppendDescriptor(&d); | 3797 map->AppendDescriptor(&d); |
| 3792 } | 3798 } |
| 3793 { // configurable | 3799 { // configurable |
| 3794 DataDescriptor d(factory()->configurable_string(), | 3800 Descriptor d = |
| 3795 JSDataPropertyDescriptor::kConfigurableIndex, NONE, | 3801 Descriptor::DataField(factory()->configurable_string(), |
| 3796 Representation::Tagged()); | 3802 JSDataPropertyDescriptor::kConfigurableIndex, |
| 3803 NONE, Representation::Tagged()); |
| 3797 map->AppendDescriptor(&d); | 3804 map->AppendDescriptor(&d); |
| 3798 } | 3805 } |
| 3799 | 3806 |
| 3800 Map::SetPrototype(map, isolate()->initial_object_prototype()); | 3807 Map::SetPrototype(map, isolate()->initial_object_prototype()); |
| 3801 map->SetConstructor(native_context()->object_function()); | 3808 map->SetConstructor(native_context()->object_function()); |
| 3802 map->SetInObjectProperties(4); | 3809 map->SetInObjectProperties(4); |
| 3803 map->set_unused_property_fields(0); | 3810 map->set_unused_property_fields(0); |
| 3804 | 3811 |
| 3805 native_context()->set_data_property_descriptor_map(*map); | 3812 native_context()->set_data_property_descriptor_map(*map); |
| 3806 } | 3813 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3828 Map::EnsureDescriptorSlack(initial_map, 3); | 3835 Map::EnsureDescriptorSlack(initial_map, 3); |
| 3829 | 3836 |
| 3830 { | 3837 { |
| 3831 JSFunction* array_function = native_context()->array_function(); | 3838 JSFunction* array_function = native_context()->array_function(); |
| 3832 Handle<DescriptorArray> array_descriptors( | 3839 Handle<DescriptorArray> array_descriptors( |
| 3833 array_function->initial_map()->instance_descriptors()); | 3840 array_function->initial_map()->instance_descriptors()); |
| 3834 Handle<String> length = factory()->length_string(); | 3841 Handle<String> length = factory()->length_string(); |
| 3835 int old = array_descriptors->SearchWithCache( | 3842 int old = array_descriptors->SearchWithCache( |
| 3836 isolate(), *length, array_function->initial_map()); | 3843 isolate(), *length, array_function->initial_map()); |
| 3837 DCHECK(old != DescriptorArray::kNotFound); | 3844 DCHECK(old != DescriptorArray::kNotFound); |
| 3838 AccessorConstantDescriptor desc( | 3845 Descriptor d = Descriptor::AccessorConstant( |
| 3839 length, handle(array_descriptors->GetValue(old), isolate()), | 3846 length, handle(array_descriptors->GetValue(old), isolate()), |
| 3840 array_descriptors->GetDetails(old).attributes()); | 3847 array_descriptors->GetDetails(old).attributes()); |
| 3841 initial_map->AppendDescriptor(&desc); | 3848 initial_map->AppendDescriptor(&d); |
| 3842 } | 3849 } |
| 3843 { | 3850 { |
| 3844 DataDescriptor index_field(factory()->index_string(), | 3851 Descriptor d = Descriptor::DataField(factory()->index_string(), |
| 3845 JSRegExpResult::kIndexIndex, NONE, | 3852 JSRegExpResult::kIndexIndex, NONE, |
| 3846 Representation::Tagged()); | 3853 Representation::Tagged()); |
| 3847 initial_map->AppendDescriptor(&index_field); | 3854 initial_map->AppendDescriptor(&d); |
| 3848 } | 3855 } |
| 3849 | 3856 |
| 3850 { | 3857 { |
| 3851 DataDescriptor input_field(factory()->input_string(), | 3858 Descriptor d = Descriptor::DataField(factory()->input_string(), |
| 3852 JSRegExpResult::kInputIndex, NONE, | 3859 JSRegExpResult::kInputIndex, NONE, |
| 3853 Representation::Tagged()); | 3860 Representation::Tagged()); |
| 3854 initial_map->AppendDescriptor(&input_field); | 3861 initial_map->AppendDescriptor(&d); |
| 3855 } | 3862 } |
| 3856 | 3863 |
| 3857 initial_map->SetInObjectProperties(2); | 3864 initial_map->SetInObjectProperties(2); |
| 3858 initial_map->set_unused_property_fields(0); | 3865 initial_map->set_unused_property_fields(0); |
| 3859 | 3866 |
| 3860 native_context()->set_regexp_result_map(*initial_map); | 3867 native_context()->set_regexp_result_map(*initial_map); |
| 3861 } | 3868 } |
| 3862 | 3869 |
| 3863 // Add @@iterator method to the arguments object maps. | 3870 // Add @@iterator method to the arguments object maps. |
| 3864 { | 3871 { |
| 3865 PropertyAttributes attribs = DONT_ENUM; | 3872 PropertyAttributes attribs = DONT_ENUM; |
| 3866 Handle<AccessorInfo> arguments_iterator = | 3873 Handle<AccessorInfo> arguments_iterator = |
| 3867 Accessors::ArgumentsIteratorInfo(isolate(), attribs); | 3874 Accessors::ArgumentsIteratorInfo(isolate(), attribs); |
| 3868 { | 3875 { |
| 3869 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 3876 Descriptor d = Descriptor::AccessorConstant(factory()->iterator_symbol(), |
| 3870 arguments_iterator, attribs); | 3877 arguments_iterator, attribs); |
| 3871 Handle<Map> map(native_context()->sloppy_arguments_map()); | 3878 Handle<Map> map(native_context()->sloppy_arguments_map()); |
| 3872 Map::EnsureDescriptorSlack(map, 1); | 3879 Map::EnsureDescriptorSlack(map, 1); |
| 3873 map->AppendDescriptor(&d); | 3880 map->AppendDescriptor(&d); |
| 3874 } | 3881 } |
| 3875 { | 3882 { |
| 3876 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 3883 Descriptor d = Descriptor::AccessorConstant(factory()->iterator_symbol(), |
| 3877 arguments_iterator, attribs); | 3884 arguments_iterator, attribs); |
| 3878 Handle<Map> map(native_context()->fast_aliased_arguments_map()); | 3885 Handle<Map> map(native_context()->fast_aliased_arguments_map()); |
| 3879 Map::EnsureDescriptorSlack(map, 1); | 3886 Map::EnsureDescriptorSlack(map, 1); |
| 3880 map->AppendDescriptor(&d); | 3887 map->AppendDescriptor(&d); |
| 3881 } | 3888 } |
| 3882 { | 3889 { |
| 3883 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 3890 Descriptor d = Descriptor::AccessorConstant(factory()->iterator_symbol(), |
| 3884 arguments_iterator, attribs); | 3891 arguments_iterator, attribs); |
| 3885 Handle<Map> map(native_context()->slow_aliased_arguments_map()); | 3892 Handle<Map> map(native_context()->slow_aliased_arguments_map()); |
| 3886 Map::EnsureDescriptorSlack(map, 1); | 3893 Map::EnsureDescriptorSlack(map, 1); |
| 3887 map->AppendDescriptor(&d); | 3894 map->AppendDescriptor(&d); |
| 3888 } | 3895 } |
| 3889 { | 3896 { |
| 3890 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 3897 Descriptor d = Descriptor::AccessorConstant(factory()->iterator_symbol(), |
| 3891 arguments_iterator, attribs); | 3898 arguments_iterator, attribs); |
| 3892 Handle<Map> map(native_context()->strict_arguments_map()); | 3899 Handle<Map> map(native_context()->strict_arguments_map()); |
| 3893 Map::EnsureDescriptorSlack(map, 1); | 3900 Map::EnsureDescriptorSlack(map, 1); |
| 3894 map->AppendDescriptor(&d); | 3901 map->AppendDescriptor(&d); |
| 3895 } | 3902 } |
| 3896 } | 3903 } |
| 3897 | 3904 |
| 3898 return true; | 3905 return true; |
| 3899 } | 3906 } |
| 3900 | 3907 |
| 3901 | 3908 |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4656 } | 4663 } |
| 4657 | 4664 |
| 4658 | 4665 |
| 4659 // Called when the top-level V8 mutex is destroyed. | 4666 // Called when the top-level V8 mutex is destroyed. |
| 4660 void Bootstrapper::FreeThreadResources() { | 4667 void Bootstrapper::FreeThreadResources() { |
| 4661 DCHECK(!IsActive()); | 4668 DCHECK(!IsActive()); |
| 4662 } | 4669 } |
| 4663 | 4670 |
| 4664 } // namespace internal | 4671 } // namespace internal |
| 4665 } // namespace v8 | 4672 } // namespace v8 |
| OLD | NEW |