OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1378 native_context()->set_strict_mode_generator_function_map( | 1378 native_context()->set_strict_mode_generator_function_map( |
1379 *strict_mode_generator_function_map); | 1379 *strict_mode_generator_function_map); |
1380 | 1380 |
1381 Handle<Map> object_map(native_context()->object_function()->initial_map()); | 1381 Handle<Map> object_map(native_context()->object_function()->initial_map()); |
1382 Handle<Map> generator_object_prototype_map = factory()->CopyMap( | 1382 Handle<Map> generator_object_prototype_map = factory()->CopyMap( |
1383 object_map, 0); | 1383 object_map, 0); |
1384 generator_object_prototype_map->set_prototype( | 1384 generator_object_prototype_map->set_prototype( |
1385 *generator_object_prototype); | 1385 *generator_object_prototype); |
1386 native_context()->set_generator_object_prototype_map( | 1386 native_context()->set_generator_object_prototype_map( |
1387 *generator_object_prototype_map); | 1387 *generator_object_prototype_map); |
1388 | |
1389 // Create a map for iterator result objects. | |
1390 ASSERT(object_map->inobject_properties() == 0); | |
1391 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); | |
1392 Handle<Map> iterator_result_map = factory()->CopyMap(object_map, 2); | |
1393 ASSERT(iterator_result_map->inobject_properties() == 2); | |
1394 | |
1395 Handle<DescriptorArray> descriptors = factory()->NewDescriptorArray(0, 2); | |
1396 DescriptorArray::WhitenessWitness witness(*descriptors); | |
1397 iterator_result_map->set_instance_descriptors(*descriptors); | |
1398 | |
1399 STATIC_ASSERT(JSGeneratorObject::kResultValuePropertyIndex == 0); | |
Michael Starzinger
2013/05/06 11:22:32
Is there a particular reason why cannot use the in
| |
1400 Handle<String> value_string = factory()->InternalizeOneByteString( | |
1401 STATIC_ASCII_VECTOR("value")); | |
1402 FieldDescriptor value_descriptor(*value_string, 0, NONE, | |
1403 Representation::Tagged()); | |
1404 iterator_result_map->AppendDescriptor(&value_descriptor, witness); | |
1405 | |
1406 STATIC_ASSERT(JSGeneratorObject::kResultDonePropertyIndex == 1); | |
1407 Handle<String> done_string = factory()->InternalizeOneByteString( | |
1408 STATIC_ASCII_VECTOR("done")); | |
1409 FieldDescriptor done_descriptor(*done_string, 1, NONE, | |
1410 Representation::Tagged()); | |
1411 iterator_result_map->AppendDescriptor(&done_descriptor, witness); | |
1412 | |
1413 iterator_result_map->set_unused_property_fields(0); | |
1414 native_context()->set_iterator_result_map(*iterator_result_map); | |
1388 } | 1415 } |
1389 } | 1416 } |
1390 | 1417 |
1391 | 1418 |
1392 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { | 1419 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { |
1393 Vector<const char> name = Natives::GetScriptName(index); | 1420 Vector<const char> name = Natives::GetScriptName(index); |
1394 Handle<String> source_code = | 1421 Handle<String> source_code = |
1395 isolate->bootstrapper()->NativesSourceLookup(index); | 1422 isolate->bootstrapper()->NativesSourceLookup(index); |
1396 return CompileNative(isolate, name, source_code); | 1423 return CompileNative(isolate, name, source_code); |
1397 } | 1424 } |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2578 return from + sizeof(NestingCounterType); | 2605 return from + sizeof(NestingCounterType); |
2579 } | 2606 } |
2580 | 2607 |
2581 | 2608 |
2582 // Called when the top-level V8 mutex is destroyed. | 2609 // Called when the top-level V8 mutex is destroyed. |
2583 void Bootstrapper::FreeThreadResources() { | 2610 void Bootstrapper::FreeThreadResources() { |
2584 ASSERT(!IsActive()); | 2611 ASSERT(!IsActive()); |
2585 } | 2612 } |
2586 | 2613 |
2587 } } // namespace v8::internal | 2614 } } // namespace v8::internal |
OLD | NEW |