| 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/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 JSDataView::kSizeWithInternalFields, | 1218 JSDataView::kSizeWithInternalFields, |
| 1219 isolate->initial_object_prototype(), | 1219 isolate->initial_object_prototype(), |
| 1220 Builtins::kIllegal); | 1220 Builtins::kIllegal); |
| 1221 native_context()->set_data_view_fun(*data_view_fun); | 1221 native_context()->set_data_view_fun(*data_view_fun); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 { // -- M a p | 1224 { // -- M a p |
| 1225 Handle<JSFunction> js_map_fun = InstallFunction( | 1225 Handle<JSFunction> js_map_fun = InstallFunction( |
| 1226 global, "Map", JS_MAP_TYPE, JSMap::kSize, | 1226 global, "Map", JS_MAP_TYPE, JSMap::kSize, |
| 1227 isolate->initial_object_prototype(), Builtins::kIllegal); | 1227 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1228 native_context()->set_js_map_map(js_map_fun->initial_map()); | 1228 native_context()->set_js_map_fun(*js_map_fun); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 { // -- S e t | 1231 { // -- S e t |
| 1232 Handle<JSFunction> js_set_fun = InstallFunction( | 1232 Handle<JSFunction> js_set_fun = InstallFunction( |
| 1233 global, "Set", JS_SET_TYPE, JSSet::kSize, | 1233 global, "Set", JS_SET_TYPE, JSSet::kSize, |
| 1234 isolate->initial_object_prototype(), Builtins::kIllegal); | 1234 isolate->initial_object_prototype(), Builtins::kIllegal); |
| 1235 native_context()->set_js_set_map(js_set_fun->initial_map()); | 1235 native_context()->set_js_set_fun(*js_set_fun); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 { // Set up the iterator result object | 1238 { // Set up the iterator result object |
| 1239 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); | 1239 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); |
| 1240 Handle<JSFunction> object_function(native_context()->object_function()); | 1240 Handle<JSFunction> object_function(native_context()->object_function()); |
| 1241 Handle<Map> iterator_result_map = | 1241 Handle<Map> iterator_result_map = |
| 1242 Map::Create(isolate, JSGeneratorObject::kResultPropertyCount); | 1242 Map::Create(isolate, JSGeneratorObject::kResultPropertyCount); |
| 1243 DCHECK_EQ(JSGeneratorObject::kResultSize, | 1243 DCHECK_EQ(JSGeneratorObject::kResultSize, |
| 1244 iterator_result_map->instance_size()); | 1244 iterator_result_map->instance_size()); |
| 1245 DCHECK_EQ(JSGeneratorObject::kResultPropertyCount, | 1245 DCHECK_EQ(JSGeneratorObject::kResultPropertyCount, |
| (...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2794 if (!ConfigureApiObject(global_object, global_object_data)) return false; | 2794 if (!ConfigureApiObject(global_object, global_object_data)) return false; |
| 2795 } | 2795 } |
| 2796 } | 2796 } |
| 2797 | 2797 |
| 2798 SetObjectPrototype(global_proxy, global_object); | 2798 SetObjectPrototype(global_proxy, global_object); |
| 2799 | 2799 |
| 2800 native_context()->set_initial_array_prototype( | 2800 native_context()->set_initial_array_prototype( |
| 2801 JSArray::cast(native_context()->array_function()->prototype())); | 2801 JSArray::cast(native_context()->array_function()->prototype())); |
| 2802 native_context()->set_array_buffer_map( | 2802 native_context()->set_array_buffer_map( |
| 2803 native_context()->array_buffer_fun()->initial_map()); | 2803 native_context()->array_buffer_fun()->initial_map()); |
| 2804 native_context()->set_js_map_map( |
| 2805 native_context()->js_map_fun()->initial_map()); |
| 2806 native_context()->set_js_set_map( |
| 2807 native_context()->js_set_fun()->initial_map()); |
| 2804 | 2808 |
| 2805 return true; | 2809 return true; |
| 2806 } | 2810 } |
| 2807 | 2811 |
| 2808 | 2812 |
| 2809 bool Genesis::ConfigureApiObject(Handle<JSObject> object, | 2813 bool Genesis::ConfigureApiObject(Handle<JSObject> object, |
| 2810 Handle<ObjectTemplateInfo> object_template) { | 2814 Handle<ObjectTemplateInfo> object_template) { |
| 2811 DCHECK(!object_template.is_null()); | 2815 DCHECK(!object_template.is_null()); |
| 2812 DCHECK(FunctionTemplateInfo::cast(object_template->constructor()) | 2816 DCHECK(FunctionTemplateInfo::cast(object_template->constructor()) |
| 2813 ->IsTemplateFor(object->map()));; | 2817 ->IsTemplateFor(object->map()));; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3110 return from + sizeof(NestingCounterType); | 3114 return from + sizeof(NestingCounterType); |
| 3111 } | 3115 } |
| 3112 | 3116 |
| 3113 | 3117 |
| 3114 // Called when the top-level V8 mutex is destroyed. | 3118 // Called when the top-level V8 mutex is destroyed. |
| 3115 void Bootstrapper::FreeThreadResources() { | 3119 void Bootstrapper::FreeThreadResources() { |
| 3116 DCHECK(!IsActive()); | 3120 DCHECK(!IsActive()); |
| 3117 } | 3121 } |
| 3118 | 3122 |
| 3119 } } // namespace v8::internal | 3123 } } // namespace v8::internal |
| OLD | NEW |