| 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/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
| 10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 | 944 |
| 945 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 945 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 946 DONT_ENUM | DONT_DELETE); | 946 DONT_ENUM | DONT_DELETE); |
| 947 | 947 |
| 948 Handle<AccessorInfo> array_length = | 948 Handle<AccessorInfo> array_length = |
| 949 Accessors::ArrayLengthInfo(isolate, attribs); | 949 Accessors::ArrayLengthInfo(isolate, attribs); |
| 950 { // Add length. | 950 { // Add length. |
| 951 CallbacksDescriptor d( | 951 CallbacksDescriptor d( |
| 952 Handle<Name>(Name::cast(array_length->name())), | 952 Handle<Name>(Name::cast(array_length->name())), |
| 953 array_length, attribs); | 953 array_length, attribs); |
| 954 array_function->initial_map()->AppendDescriptor(&d); | 954 initial_map->AppendDescriptor(&d); |
| 955 } | 955 } |
| 956 | 956 |
| 957 // array_function is used internally. JS code creating array object should | 957 // array_function is used internally. JS code creating array object should |
| 958 // search for the 'Array' property on the global object and use that one | 958 // search for the 'Array' property on the global object and use that one |
| 959 // as the constructor. 'Array' property on a global object can be | 959 // as the constructor. 'Array' property on a global object can be |
| 960 // overwritten by JS code. | 960 // overwritten by JS code. |
| 961 native_context()->set_array_function(*array_function); | 961 native_context()->set_array_function(*array_function); |
| 962 | 962 |
| 963 // Cache the array maps, needed by ArrayConstructorStub | 963 // Cache the array maps, needed by ArrayConstructorStub |
| 964 CacheInitialJSArrayMaps(native_context(), initial_map); | 964 CacheInitialJSArrayMaps(native_context(), initial_map); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 writable, | 1084 writable, |
| 1085 Representation::Tagged()); | 1085 Representation::Tagged()); |
| 1086 initial_map->AppendDescriptor(&field); | 1086 initial_map->AppendDescriptor(&field); |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 initial_map->set_inobject_properties(5); | 1089 initial_map->set_inobject_properties(5); |
| 1090 initial_map->set_pre_allocated_property_fields(5); | 1090 initial_map->set_pre_allocated_property_fields(5); |
| 1091 initial_map->set_unused_property_fields(0); | 1091 initial_map->set_unused_property_fields(0); |
| 1092 initial_map->set_instance_size( | 1092 initial_map->set_instance_size( |
| 1093 initial_map->instance_size() + 5 * kPointerSize); | 1093 initial_map->instance_size() + 5 * kPointerSize); |
| 1094 initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map)); | |
| 1095 | 1094 |
| 1096 // RegExp prototype object is itself a RegExp. | 1095 // RegExp prototype object is itself a RegExp. |
| 1097 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype"); | 1096 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype"); |
| 1098 proto_map->set_prototype(native_context()->initial_object_prototype()); | 1097 proto_map->set_prototype(native_context()->initial_object_prototype()); |
| 1099 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map); | 1098 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map); |
| 1100 proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, | 1099 proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, |
| 1101 heap->query_colon_string()); | 1100 heap->query_colon_string()); |
| 1102 proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, | 1101 proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, |
| 1103 heap->false_value()); | 1102 heap->false_value()); |
| 1104 proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, | 1103 proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 Map::EnsureDescriptorSlack(initial_map, 1); | 1670 Map::EnsureDescriptorSlack(initial_map, 1); |
| 1672 | 1671 |
| 1673 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 1672 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 1674 DONT_ENUM | DONT_DELETE); | 1673 DONT_ENUM | DONT_DELETE); |
| 1675 | 1674 |
| 1676 Handle<AccessorInfo> array_length = | 1675 Handle<AccessorInfo> array_length = |
| 1677 Accessors::ArrayLengthInfo(isolate(), attribs); | 1676 Accessors::ArrayLengthInfo(isolate(), attribs); |
| 1678 { // Add length. | 1677 { // Add length. |
| 1679 CallbacksDescriptor d( | 1678 CallbacksDescriptor d( |
| 1680 Handle<Name>(Name::cast(array_length->name())), array_length, attribs); | 1679 Handle<Name>(Name::cast(array_length->name())), array_length, attribs); |
| 1681 array_function->initial_map()->AppendDescriptor(&d); | 1680 initial_map->AppendDescriptor(&d); |
| 1682 } | 1681 } |
| 1683 | 1682 |
| 1684 return array_function; | 1683 return array_function; |
| 1685 } | 1684 } |
| 1686 | 1685 |
| 1687 | 1686 |
| 1688 bool Genesis::InstallNatives() { | 1687 bool Genesis::InstallNatives() { |
| 1689 HandleScope scope(isolate()); | 1688 HandleScope scope(isolate()); |
| 1690 | 1689 |
| 1691 // Create a function for the builtins object. Allocate space for the | 1690 // Create a function for the builtins object. Allocate space for the |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2826 return from + sizeof(NestingCounterType); | 2825 return from + sizeof(NestingCounterType); |
| 2827 } | 2826 } |
| 2828 | 2827 |
| 2829 | 2828 |
| 2830 // Called when the top-level V8 mutex is destroyed. | 2829 // Called when the top-level V8 mutex is destroyed. |
| 2831 void Bootstrapper::FreeThreadResources() { | 2830 void Bootstrapper::FreeThreadResources() { |
| 2832 DCHECK(!IsActive()); | 2831 DCHECK(!IsActive()); |
| 2833 } | 2832 } |
| 2834 | 2833 |
| 2835 } } // namespace v8::internal | 2834 } } // namespace v8::internal |
| OLD | NEW |