OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 ASSERT(code != NULL && code->contains(pc)); | 1114 ASSERT(code != NULL && code->contains(pc)); |
1115 return code; | 1115 return code; |
1116 } | 1116 } |
1117 | 1117 |
1118 | 1118 |
1119 Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) { | 1119 Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) { |
1120 // Check if the pc points into a large object chunk. | 1120 // Check if the pc points into a large object chunk. |
1121 LargePage* large_page = Heap::lo_space()->FindPageContainingPc(pc); | 1121 LargePage* large_page = Heap::lo_space()->FindPageContainingPc(pc); |
1122 if (large_page != NULL) return GcSafeCastToCode(large_page->GetObject(), pc); | 1122 if (large_page != NULL) return GcSafeCastToCode(large_page->GetObject(), pc); |
1123 | 1123 |
1124 // Iterate through the 8K page until we reach the end or find an | 1124 // Iterate through the page until we reach the end or find an object starting |
1125 // object starting after the pc. | 1125 // after the pc. |
1126 Page* page = Page::FromAddress(pc); | 1126 Page* page = Page::FromAddress(pc); |
1127 HeapObjectIterator iterator(page, Heap::GcSafeSizeOfOldObjectFunction()); | 1127 HeapObjectIterator iterator(page, Heap::GcSafeSizeOfOldObjectFunction()); |
1128 HeapObject* previous = NULL; | 1128 HeapObject* previous = NULL; |
1129 while (true) { | 1129 while (true) { |
1130 HeapObject* next = iterator.next(); | 1130 HeapObject* next = iterator.Next(); |
1131 if (next == NULL || next->address() >= pc) { | 1131 if (next == NULL || next->address() >= pc) { |
1132 return GcSafeCastToCode(previous, pc); | 1132 return GcSafeCastToCode(previous, pc); |
1133 } | 1133 } |
1134 previous = next; | 1134 previous = next; |
1135 } | 1135 } |
1136 } | 1136 } |
1137 | 1137 |
1138 | 1138 |
1139 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) { | 1139 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) { |
1140 Counters::pc_to_code.Increment(); | 1140 Counters::pc_to_code.Increment(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 ZoneList<StackFrame*> list(10); | 1218 ZoneList<StackFrame*> list(10); |
1219 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1219 for (StackFrameIterator it; !it.done(); it.Advance()) { |
1220 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1220 StackFrame* frame = AllocateFrameCopy(it.frame()); |
1221 list.Add(frame); | 1221 list.Add(frame); |
1222 } | 1222 } |
1223 return list.ToVector(); | 1223 return list.ToVector(); |
1224 } | 1224 } |
1225 | 1225 |
1226 | 1226 |
1227 } } // namespace v8::internal | 1227 } } // namespace v8::internal |
OLD | NEW |