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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 isolate->initial_object_prototype(), Builtins::kIllegal); | 1149 isolate->initial_object_prototype(), Builtins::kIllegal); |
1150 | 1150 |
1151 // -- S e t | 1151 // -- S e t |
1152 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, | 1152 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize, |
1153 isolate->initial_object_prototype(), Builtins::kIllegal); | 1153 isolate->initial_object_prototype(), Builtins::kIllegal); |
1154 | 1154 |
1155 { // Set up the iterator result object | 1155 { // Set up the iterator result object |
1156 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); | 1156 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); |
1157 Handle<JSFunction> object_function(native_context()->object_function()); | 1157 Handle<JSFunction> object_function(native_context()->object_function()); |
1158 Handle<Map> iterator_result_map = | 1158 Handle<Map> iterator_result_map = |
1159 Map::Create(object_function, JSGeneratorObject::kResultPropertyCount); | 1159 Map::Create(isolate, JSGeneratorObject::kResultPropertyCount); |
| 1160 DCHECK_EQ(JSGeneratorObject::kResultSize, |
| 1161 iterator_result_map->instance_size()); |
| 1162 DCHECK_EQ(JSGeneratorObject::kResultPropertyCount, |
| 1163 iterator_result_map->inobject_properties()); |
1160 Map::EnsureDescriptorSlack(iterator_result_map, | 1164 Map::EnsureDescriptorSlack(iterator_result_map, |
1161 JSGeneratorObject::kResultPropertyCount); | 1165 JSGeneratorObject::kResultPropertyCount); |
1162 | 1166 |
1163 FieldDescriptor value_descr(factory->value_string(), | 1167 FieldDescriptor value_descr(factory->value_string(), |
1164 JSGeneratorObject::kResultValuePropertyIndex, | 1168 JSGeneratorObject::kResultValuePropertyIndex, |
1165 NONE, Representation::Tagged()); | 1169 NONE, Representation::Tagged()); |
1166 iterator_result_map->AppendDescriptor(&value_descr); | 1170 iterator_result_map->AppendDescriptor(&value_descr); |
1167 | 1171 |
1168 FieldDescriptor done_descr(factory->done_string(), | 1172 FieldDescriptor done_descr(factory->done_string(), |
1169 JSGeneratorObject::kResultDonePropertyIndex, | 1173 JSGeneratorObject::kResultDonePropertyIndex, |
1170 NONE, Representation::Tagged()); | 1174 NONE, Representation::Tagged()); |
1171 iterator_result_map->AppendDescriptor(&done_descr); | 1175 iterator_result_map->AppendDescriptor(&done_descr); |
1172 | 1176 |
1173 iterator_result_map->set_instance_size(JSGeneratorObject::kResultSize); | |
1174 iterator_result_map->set_unused_property_fields(0); | 1177 iterator_result_map->set_unused_property_fields(0); |
1175 iterator_result_map->set_inobject_properties( | |
1176 JSGeneratorObject::kResultPropertyCount); | |
1177 iterator_result_map->set_pre_allocated_property_fields( | 1178 iterator_result_map->set_pre_allocated_property_fields( |
1178 JSGeneratorObject::kResultPropertyCount); | 1179 JSGeneratorObject::kResultPropertyCount); |
1179 iterator_result_map->set_visitor_id( | |
1180 StaticVisitorBase::GetVisitorId(*iterator_result_map)); | |
1181 DCHECK_EQ(JSGeneratorObject::kResultSize, | 1180 DCHECK_EQ(JSGeneratorObject::kResultSize, |
1182 iterator_result_map->instance_size()); | 1181 iterator_result_map->instance_size()); |
1183 native_context()->set_iterator_result_map(*iterator_result_map); | 1182 native_context()->set_iterator_result_map(*iterator_result_map); |
1184 } | 1183 } |
1185 | 1184 |
1186 // -- W e a k M a p | 1185 // -- W e a k M a p |
1187 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, | 1186 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
1188 isolate->initial_object_prototype(), Builtins::kIllegal); | 1187 isolate->initial_object_prototype(), Builtins::kIllegal); |
1189 // -- W e a k S e t | 1188 // -- W e a k S e t |
1190 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, | 1189 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 rw_attribs, poison_pair); | 1921 rw_attribs, poison_pair); |
1923 | 1922 |
1924 Handle<Map> strict_function_map(native_context()->strict_function_map()); | 1923 Handle<Map> strict_function_map(native_context()->strict_function_map()); |
1925 Handle<Map> strict_generator_function_map = Map::Copy(strict_function_map); | 1924 Handle<Map> strict_generator_function_map = Map::Copy(strict_function_map); |
1926 // "arguments" and "caller" already poisoned. | 1925 // "arguments" and "caller" already poisoned. |
1927 strict_generator_function_map->set_prototype(*generator_function_prototype); | 1926 strict_generator_function_map->set_prototype(*generator_function_prototype); |
1928 native_context()->set_strict_generator_function_map( | 1927 native_context()->set_strict_generator_function_map( |
1929 *strict_generator_function_map); | 1928 *strict_generator_function_map); |
1930 | 1929 |
1931 Handle<JSFunction> object_function(native_context()->object_function()); | 1930 Handle<JSFunction> object_function(native_context()->object_function()); |
1932 Handle<Map> generator_object_prototype_map = | 1931 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); |
1933 Map::Create(object_function, 0); | |
1934 generator_object_prototype_map->set_prototype(*generator_object_prototype); | 1932 generator_object_prototype_map->set_prototype(*generator_object_prototype); |
1935 native_context()->set_generator_object_prototype_map( | 1933 native_context()->set_generator_object_prototype_map( |
1936 *generator_object_prototype_map); | 1934 *generator_object_prototype_map); |
1937 } | 1935 } |
1938 | 1936 |
1939 if (FLAG_disable_native_files) { | 1937 if (FLAG_disable_native_files) { |
1940 PrintF("Warning: Running without installed natives!\n"); | 1938 PrintF("Warning: Running without installed natives!\n"); |
1941 return true; | 1939 return true; |
1942 } | 1940 } |
1943 | 1941 |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 return from + sizeof(NestingCounterType); | 2733 return from + sizeof(NestingCounterType); |
2736 } | 2734 } |
2737 | 2735 |
2738 | 2736 |
2739 // Called when the top-level V8 mutex is destroyed. | 2737 // Called when the top-level V8 mutex is destroyed. |
2740 void Bootstrapper::FreeThreadResources() { | 2738 void Bootstrapper::FreeThreadResources() { |
2741 DCHECK(!IsActive()); | 2739 DCHECK(!IsActive()); |
2742 } | 2740 } |
2743 | 2741 |
2744 } } // namespace v8::internal | 2742 } } // namespace v8::internal |
OLD | NEW |