OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 // FlushNumberStringCache | 837 // FlushNumberStringCache |
838 if (FLAG_cleanup_code_caches_at_gc) { | 838 if (FLAG_cleanup_code_caches_at_gc) { |
839 polymorphic_code_cache()->set_cache(undefined_value()); | 839 polymorphic_code_cache()->set_cache(undefined_value()); |
840 } | 840 } |
841 | 841 |
842 ClearNormalizedMapCaches(); | 842 ClearNormalizedMapCaches(); |
843 } | 843 } |
844 | 844 |
845 | 845 |
846 Object* Heap::FindCodeObject(Address a) { | 846 Object* Heap::FindCodeObject(Address a) { |
847 Object* obj = NULL; // Initialization to please compiler. | 847 return isolate()->pc_to_code_cache()->GcSafeFindCodeForPc(a); |
848 { MaybeObject* maybe_obj = code_space_->FindObject(a); | |
849 if (!maybe_obj->ToObject(&obj)) { | |
850 obj = lo_space_->FindObject(a)->ToObjectUnchecked(); | |
851 } | |
852 } | |
853 return obj; | |
854 } | 848 } |
855 | 849 |
856 | 850 |
857 // Helper class for copying HeapObjects | 851 // Helper class for copying HeapObjects |
858 class ScavengeVisitor: public ObjectVisitor { | 852 class ScavengeVisitor: public ObjectVisitor { |
859 public: | 853 public: |
860 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {} | 854 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {} |
861 | 855 |
862 void VisitPointer(Object** p) { ScavengePointer(p); } | 856 void VisitPointer(Object** p) { ScavengePointer(p); } |
863 | 857 |
(...skipping 5485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6349 } | 6343 } |
6350 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6344 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6351 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6345 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6352 next = chunk->next_chunk(); | 6346 next = chunk->next_chunk(); |
6353 isolate_->memory_allocator()->Free(chunk); | 6347 isolate_->memory_allocator()->Free(chunk); |
6354 } | 6348 } |
6355 chunks_queued_for_free_ = NULL; | 6349 chunks_queued_for_free_ = NULL; |
6356 } | 6350 } |
6357 | 6351 |
6358 } } // namespace v8::internal | 6352 } } // namespace v8::internal |
OLD | NEW |