| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 if (obj->IsFailure()) return obj; | 2183 if (obj->IsFailure()) return obj; |
| 2184 Map* new_map = Map::cast(obj); | 2184 Map* new_map = Map::cast(obj); |
| 2185 | 2185 |
| 2186 // Clear inobject properties if needed by adjusting the instance size and | 2186 // Clear inobject properties if needed by adjusting the instance size and |
| 2187 // putting in a filler object instead of the inobject properties. | 2187 // putting in a filler object instead of the inobject properties. |
| 2188 if (mode == CLEAR_INOBJECT_PROPERTIES && map()->inobject_properties() > 0) { | 2188 if (mode == CLEAR_INOBJECT_PROPERTIES && map()->inobject_properties() > 0) { |
| 2189 int instance_size_delta = map()->inobject_properties() * kPointerSize; | 2189 int instance_size_delta = map()->inobject_properties() * kPointerSize; |
| 2190 int new_instance_size = map()->instance_size() - instance_size_delta; | 2190 int new_instance_size = map()->instance_size() - instance_size_delta; |
| 2191 new_map->set_inobject_properties(0); | 2191 new_map->set_inobject_properties(0); |
| 2192 new_map->set_instance_size(new_instance_size); | 2192 new_map->set_instance_size(new_instance_size); |
| 2193 new_map->set_scavenger(Heap::GetScavenger(new_map->instance_type(), | |
| 2194 new_map->instance_size())); | |
| 2195 Heap::CreateFillerObjectAt(this->address() + new_instance_size, | 2193 Heap::CreateFillerObjectAt(this->address() + new_instance_size, |
| 2196 instance_size_delta); | 2194 instance_size_delta); |
| 2197 } | 2195 } |
| 2198 new_map->set_unused_property_fields(0); | 2196 new_map->set_unused_property_fields(0); |
| 2199 | 2197 |
| 2200 // We have now successfully allocated all the necessary objects. | 2198 // We have now successfully allocated all the necessary objects. |
| 2201 // Changes can now be made with the guarantee that all of them take effect. | 2199 // Changes can now be made with the guarantee that all of them take effect. |
| 2202 set_map(new_map); | 2200 set_map(new_map); |
| 2203 map()->set_instance_descriptors(Heap::empty_descriptor_array()); | 2201 map()->set_instance_descriptors(Heap::empty_descriptor_array()); |
| 2204 | 2202 |
| (...skipping 6566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8771 if (break_point_objects()->IsUndefined()) return 0; | 8769 if (break_point_objects()->IsUndefined()) return 0; |
| 8772 // Single beak point. | 8770 // Single beak point. |
| 8773 if (!break_point_objects()->IsFixedArray()) return 1; | 8771 if (!break_point_objects()->IsFixedArray()) return 1; |
| 8774 // Multiple break points. | 8772 // Multiple break points. |
| 8775 return FixedArray::cast(break_point_objects())->length(); | 8773 return FixedArray::cast(break_point_objects())->length(); |
| 8776 } | 8774 } |
| 8777 #endif | 8775 #endif |
| 8778 | 8776 |
| 8779 | 8777 |
| 8780 } } // namespace v8::internal | 8778 } } // namespace v8::internal |
| OLD | NEW |