| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 | 1491 |
| 1492 MaybeObject* Heap::AllocatePartialMap(InstanceType instance_type, | 1492 MaybeObject* Heap::AllocatePartialMap(InstanceType instance_type, |
| 1493 int instance_size) { | 1493 int instance_size) { |
| 1494 Object* result; | 1494 Object* result; |
| 1495 { MaybeObject* maybe_result = AllocateRawMap(); | 1495 { MaybeObject* maybe_result = AllocateRawMap(); |
| 1496 if (!maybe_result->ToObject(&result)) return maybe_result; | 1496 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 // Map::cast cannot be used due to uninitialized map field. | 1499 // Map::cast cannot be used due to uninitialized map field. |
| 1500 reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map()); | 1500 reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map()); |
| 1501 reinterpret_cast<Map*>(result)->set_heap(this); | |
| 1502 reinterpret_cast<Map*>(result)->set_instance_type(instance_type); | 1501 reinterpret_cast<Map*>(result)->set_instance_type(instance_type); |
| 1503 reinterpret_cast<Map*>(result)->set_instance_size(instance_size); | 1502 reinterpret_cast<Map*>(result)->set_instance_size(instance_size); |
| 1504 reinterpret_cast<Map*>(result)->set_visitor_id( | 1503 reinterpret_cast<Map*>(result)->set_visitor_id( |
| 1505 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); | 1504 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); |
| 1506 reinterpret_cast<Map*>(result)->set_inobject_properties(0); | 1505 reinterpret_cast<Map*>(result)->set_inobject_properties(0); |
| 1507 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); | 1506 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); |
| 1508 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); | 1507 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); |
| 1509 reinterpret_cast<Map*>(result)->set_bit_field(0); | 1508 reinterpret_cast<Map*>(result)->set_bit_field(0); |
| 1510 reinterpret_cast<Map*>(result)->set_bit_field2(0); | 1509 reinterpret_cast<Map*>(result)->set_bit_field2(0); |
| 1511 return result; | 1510 return result; |
| 1512 } | 1511 } |
| 1513 | 1512 |
| 1514 | 1513 |
| 1515 MaybeObject* Heap::AllocateMap(InstanceType instance_type, int instance_size) { | 1514 MaybeObject* Heap::AllocateMap(InstanceType instance_type, int instance_size) { |
| 1516 Object* result; | 1515 Object* result; |
| 1517 { MaybeObject* maybe_result = AllocateRawMap(); | 1516 { MaybeObject* maybe_result = AllocateRawMap(); |
| 1518 if (!maybe_result->ToObject(&result)) return maybe_result; | 1517 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 1519 } | 1518 } |
| 1520 | 1519 |
| 1521 Map* map = reinterpret_cast<Map*>(result); | 1520 Map* map = reinterpret_cast<Map*>(result); |
| 1522 map->set_map(meta_map()); | 1521 map->set_map(meta_map()); |
| 1523 map->set_heap(this); | |
| 1524 map->set_instance_type(instance_type); | 1522 map->set_instance_type(instance_type); |
| 1525 map->set_visitor_id( | 1523 map->set_visitor_id( |
| 1526 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); | 1524 StaticVisitorBase::GetVisitorId(instance_type, instance_size)); |
| 1527 map->set_prototype(null_value()); | 1525 map->set_prototype(null_value()); |
| 1528 map->set_constructor(null_value()); | 1526 map->set_constructor(null_value()); |
| 1529 map->set_instance_size(instance_size); | 1527 map->set_instance_size(instance_size); |
| 1530 map->set_inobject_properties(0); | 1528 map->set_inobject_properties(0); |
| 1531 map->set_pre_allocated_property_fields(0); | 1529 map->set_pre_allocated_property_fields(0); |
| 1532 map->set_instance_descriptors(empty_descriptor_array()); | 1530 map->set_instance_descriptors(empty_descriptor_array()); |
| 1533 map->set_code_cache(empty_fixed_array()); | 1531 map->set_code_cache(empty_fixed_array()); |
| (...skipping 3967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5501 } | 5499 } |
| 5502 | 5500 |
| 5503 | 5501 |
| 5504 void ExternalStringTable::TearDown() { | 5502 void ExternalStringTable::TearDown() { |
| 5505 new_space_strings_.Free(); | 5503 new_space_strings_.Free(); |
| 5506 old_space_strings_.Free(); | 5504 old_space_strings_.Free(); |
| 5507 } | 5505 } |
| 5508 | 5506 |
| 5509 | 5507 |
| 5510 } } // namespace v8::internal | 5508 } } // namespace v8::internal |
| OLD | NEW |