| 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 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 UpdatePointer(p); | 2308 UpdatePointer(p); |
| 2309 } | 2309 } |
| 2310 | 2310 |
| 2311 void VisitPointers(Object** start, Object** end) { | 2311 void VisitPointers(Object** start, Object** end) { |
| 2312 for (Object** p = start; p < end; p++) UpdatePointer(p); | 2312 for (Object** p = start; p < end; p++) UpdatePointer(p); |
| 2313 } | 2313 } |
| 2314 | 2314 |
| 2315 void VisitEmbeddedPointer(RelocInfo* rinfo) { | 2315 void VisitEmbeddedPointer(RelocInfo* rinfo) { |
| 2316 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); | 2316 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
| 2317 Object* target = rinfo->target_object(); | 2317 Object* target = rinfo->target_object(); |
| 2318 Object* old_target = target; |
| 2318 VisitPointer(&target); | 2319 VisitPointer(&target); |
| 2319 rinfo->set_target_object(target); | 2320 // Avoid unnecessary changes that might unnecessary flush the instruction |
| 2321 // cache. |
| 2322 if (target != old_target) { |
| 2323 rinfo->set_target_object(target); |
| 2324 } |
| 2320 } | 2325 } |
| 2321 | 2326 |
| 2322 void VisitCodeTarget(RelocInfo* rinfo) { | 2327 void VisitCodeTarget(RelocInfo* rinfo) { |
| 2323 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 2328 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
| 2324 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 2329 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
| 2325 VisitPointer(&target); | 2330 VisitPointer(&target); |
| 2326 rinfo->set_target_address(Code::cast(target)->instruction_start()); | 2331 rinfo->set_target_address(Code::cast(target)->instruction_start()); |
| 2327 } | 2332 } |
| 2328 | 2333 |
| 2329 void VisitDebugTarget(RelocInfo* rinfo) { | 2334 void VisitDebugTarget(RelocInfo* rinfo) { |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3755 while (buffer != NULL) { | 3760 while (buffer != NULL) { |
| 3756 SlotsBuffer* next_buffer = buffer->next(); | 3761 SlotsBuffer* next_buffer = buffer->next(); |
| 3757 DeallocateBuffer(buffer); | 3762 DeallocateBuffer(buffer); |
| 3758 buffer = next_buffer; | 3763 buffer = next_buffer; |
| 3759 } | 3764 } |
| 3760 *buffer_address = NULL; | 3765 *buffer_address = NULL; |
| 3761 } | 3766 } |
| 3762 | 3767 |
| 3763 | 3768 |
| 3764 } } // namespace v8::internal | 3769 } } // namespace v8::internal |
| OLD | NEW |