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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 | 1365 |
1366 Handle<Map> strict_mode_function_map( | 1366 Handle<Map> strict_mode_function_map( |
1367 native_context()->strict_function_map()); | 1367 native_context()->strict_function_map()); |
1368 Handle<Map> strict_mode_generator_function_map = | 1368 Handle<Map> strict_mode_generator_function_map = |
1369 Map::Copy(strict_mode_function_map); | 1369 Map::Copy(strict_mode_function_map); |
1370 strict_mode_generator_function_map->set_prototype( | 1370 strict_mode_generator_function_map->set_prototype( |
1371 *generator_function_prototype); | 1371 *generator_function_prototype); |
1372 native_context()->set_strict_generator_function_map( | 1372 native_context()->set_strict_generator_function_map( |
1373 *strict_mode_generator_function_map); | 1373 *strict_mode_generator_function_map); |
1374 | 1374 |
1375 Handle<Map> object_map(native_context()->object_function()->initial_map()); | 1375 Handle<JSFunction> object_function(native_context()->object_function()); |
1376 Handle<Map> generator_object_prototype_map = factory()->CopyMap( | 1376 Handle<Map> generator_object_prototype_map = Map::Create( |
1377 object_map, 0); | 1377 object_function, 0); |
1378 generator_object_prototype_map->set_prototype( | 1378 generator_object_prototype_map->set_prototype( |
1379 *generator_object_prototype); | 1379 *generator_object_prototype); |
1380 native_context()->set_generator_object_prototype_map( | 1380 native_context()->set_generator_object_prototype_map( |
1381 *generator_object_prototype_map); | 1381 *generator_object_prototype_map); |
1382 | 1382 |
1383 // Create a map for generator result objects. | 1383 // Create a map for generator result objects. |
1384 ASSERT(object_map->inobject_properties() == 0); | 1384 ASSERT(object_function->initial_map()->inobject_properties() == 0); |
1385 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); | 1385 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); |
1386 Handle<Map> generator_result_map = factory()->CopyMap(object_map, | 1386 Handle<Map> generator_result_map = Map::Create( |
1387 JSGeneratorObject::kResultPropertyCount); | 1387 object_function, JSGeneratorObject::kResultPropertyCount); |
1388 ASSERT(generator_result_map->inobject_properties() == | 1388 ASSERT(generator_result_map->inobject_properties() == |
1389 JSGeneratorObject::kResultPropertyCount); | 1389 JSGeneratorObject::kResultPropertyCount); |
1390 | 1390 |
1391 Handle<DescriptorArray> descriptors = factory()->NewDescriptorArray(0, | 1391 Handle<DescriptorArray> descriptors = factory()->NewDescriptorArray(0, |
1392 JSGeneratorObject::kResultPropertyCount); | 1392 JSGeneratorObject::kResultPropertyCount); |
1393 DescriptorArray::WhitenessWitness witness(*descriptors); | 1393 DescriptorArray::WhitenessWitness witness(*descriptors); |
1394 generator_result_map->set_instance_descriptors(*descriptors); | 1394 generator_result_map->set_instance_descriptors(*descriptors); |
1395 | 1395 |
1396 Handle<String> value_string = factory()->InternalizeOneByteString( | 1396 Handle<String> value_string = factory()->InternalizeOneByteString( |
1397 STATIC_ASCII_VECTOR("value")); | 1397 STATIC_ASCII_VECTOR("value")); |
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 return from + sizeof(NestingCounterType); | 2721 return from + sizeof(NestingCounterType); |
2722 } | 2722 } |
2723 | 2723 |
2724 | 2724 |
2725 // Called when the top-level V8 mutex is destroyed. | 2725 // Called when the top-level V8 mutex is destroyed. |
2726 void Bootstrapper::FreeThreadResources() { | 2726 void Bootstrapper::FreeThreadResources() { |
2727 ASSERT(!IsActive()); | 2727 ASSERT(!IsActive()); |
2728 } | 2728 } |
2729 | 2729 |
2730 } } // namespace v8::internal | 2730 } } // namespace v8::internal |
OLD | NEW |