| 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 4404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4415 } | 4415 } |
| 4416 | 4416 |
| 4417 | 4417 |
| 4418 void Map::set_transitions(TransitionArray* transition_array, | 4418 void Map::set_transitions(TransitionArray* transition_array, |
| 4419 WriteBarrierMode mode) { | 4419 WriteBarrierMode mode) { |
| 4420 // Transition arrays are not shared. When one is replaced, it should not | 4420 // Transition arrays are not shared. When one is replaced, it should not |
| 4421 // keep referenced objects alive, so we zap it. | 4421 // keep referenced objects alive, so we zap it. |
| 4422 // When there is another reference to the array somewhere (e.g. a handle), | 4422 // When there is another reference to the array somewhere (e.g. a handle), |
| 4423 // not zapping turns from a waste of memory into a source of crashes. | 4423 // not zapping turns from a waste of memory into a source of crashes. |
| 4424 if (HasTransitionArray()) { | 4424 if (HasTransitionArray()) { |
| 4425 #ifdef DEBUG |
| 4426 for (int i = 0; i < transitions()->number_of_transitions(); i++) { |
| 4427 Map* target = transitions()->GetTarget(i); |
| 4428 if (target->instance_descriptors() == instance_descriptors()) { |
| 4429 Name* key = transitions()->GetKey(i); |
| 4430 int new_target_index = transition_array->Search(key); |
| 4431 ASSERT(new_target_index != TransitionArray::kNotFound); |
| 4432 ASSERT(transition_array->GetTarget(new_target_index) == target); |
| 4433 } |
| 4434 } |
| 4435 #endif |
| 4425 ASSERT(transitions() != transition_array); | 4436 ASSERT(transitions() != transition_array); |
| 4426 ZapTransitions(); | 4437 ZapTransitions(); |
| 4427 } | 4438 } |
| 4428 | 4439 |
| 4429 WRITE_FIELD(this, kTransitionsOrBackPointerOffset, transition_array); | 4440 WRITE_FIELD(this, kTransitionsOrBackPointerOffset, transition_array); |
| 4430 CONDITIONAL_WRITE_BARRIER( | 4441 CONDITIONAL_WRITE_BARRIER( |
| 4431 GetHeap(), this, kTransitionsOrBackPointerOffset, transition_array, mode); | 4442 GetHeap(), this, kTransitionsOrBackPointerOffset, transition_array, mode); |
| 4432 } | 4443 } |
| 4433 | 4444 |
| 4434 | 4445 |
| (...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6400 #undef WRITE_UINT32_FIELD | 6411 #undef WRITE_UINT32_FIELD |
| 6401 #undef READ_SHORT_FIELD | 6412 #undef READ_SHORT_FIELD |
| 6402 #undef WRITE_SHORT_FIELD | 6413 #undef WRITE_SHORT_FIELD |
| 6403 #undef READ_BYTE_FIELD | 6414 #undef READ_BYTE_FIELD |
| 6404 #undef WRITE_BYTE_FIELD | 6415 #undef WRITE_BYTE_FIELD |
| 6405 | 6416 |
| 6406 | 6417 |
| 6407 } } // namespace v8::internal | 6418 } } // namespace v8::internal |
| 6408 | 6419 |
| 6409 #endif // V8_OBJECTS_INL_H_ | 6420 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |