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...) 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 generator result objects. | |
1390 ASSERT(object_map->inobject_properties() == 0); | |
1391 STATIC_ASSERT(JSGeneratorObject::kResultPropertyCount == 2); | |
1392 Handle<Map> generator_result_map = factory()->CopyMap(object_map, | |
Michael Starzinger
2013/05/06 19:26:05
Can we add one dedicated test-case to generators-i
| |
1393 JSGeneratorObject::kResultPropertyCount); | |
1394 ASSERT(generator_result_map->inobject_properties() == | |
1395 JSGeneratorObject::kResultPropertyCount); | |
1396 | |
1397 Handle<DescriptorArray> descriptors = factory()->NewDescriptorArray(0, | |
1398 JSGeneratorObject::kResultPropertyCount); | |
1399 DescriptorArray::WhitenessWitness witness(*descriptors); | |
1400 generator_result_map->set_instance_descriptors(*descriptors); | |
1401 | |
1402 Handle<String> value_string = factory()->InternalizeOneByteString( | |
1403 STATIC_ASCII_VECTOR("value")); | |
1404 FieldDescriptor value_descr(*value_string, | |
1405 JSGeneratorObject::kResultValuePropertyIndex, | |
1406 NONE, | |
1407 Representation::Tagged()); | |
1408 generator_result_map->AppendDescriptor(&value_descr, witness); | |
1409 | |
1410 Handle<String> done_string = factory()->InternalizeOneByteString( | |
1411 STATIC_ASCII_VECTOR("done")); | |
1412 FieldDescriptor done_descr(*done_string, | |
1413 JSGeneratorObject::kResultDonePropertyIndex, | |
1414 NONE, | |
1415 Representation::Tagged()); | |
1416 generator_result_map->AppendDescriptor(&done_descr, witness); | |
1417 | |
1418 generator_result_map->set_unused_property_fields(0); | |
1419 ASSERT_EQ(JSGeneratorObject::kResultSize, | |
1420 generator_result_map->instance_size()); | |
1421 native_context()->set_generator_result_map(*generator_result_map); | |
1388 } | 1422 } |
1389 } | 1423 } |
1390 | 1424 |
1391 | 1425 |
1392 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { | 1426 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { |
1393 Vector<const char> name = Natives::GetScriptName(index); | 1427 Vector<const char> name = Natives::GetScriptName(index); |
1394 Handle<String> source_code = | 1428 Handle<String> source_code = |
1395 isolate->bootstrapper()->NativesSourceLookup(index); | 1429 isolate->bootstrapper()->NativesSourceLookup(index); |
1396 return CompileNative(isolate, name, source_code); | 1430 return CompileNative(isolate, name, source_code); |
1397 } | 1431 } |
(...skipping 1180 matching lines...) Loading... | |
2578 return from + sizeof(NestingCounterType); | 2612 return from + sizeof(NestingCounterType); |
2579 } | 2613 } |
2580 | 2614 |
2581 | 2615 |
2582 // Called when the top-level V8 mutex is destroyed. | 2616 // Called when the top-level V8 mutex is destroyed. |
2583 void Bootstrapper::FreeThreadResources() { | 2617 void Bootstrapper::FreeThreadResources() { |
2584 ASSERT(!IsActive()); | 2618 ASSERT(!IsActive()); |
2585 } | 2619 } |
2586 | 2620 |
2587 } } // namespace v8::internal | 2621 } } // namespace v8::internal |
OLD | NEW |