| 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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1109 |
| 1110 Code* PcToCodeCache::GcSafeCastToCode(HeapObject* object, Address pc) { | 1110 Code* PcToCodeCache::GcSafeCastToCode(HeapObject* object, Address pc) { |
| 1111 Code* code = reinterpret_cast<Code*>(object); | 1111 Code* code = reinterpret_cast<Code*>(object); |
| 1112 ASSERT(code != NULL && code->contains(pc)); | 1112 ASSERT(code != NULL && code->contains(pc)); |
| 1113 return code; | 1113 return code; |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 | 1116 |
| 1117 Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) { | 1117 Code* PcToCodeCache::GcSafeFindCodeForPc(Address pc) { |
| 1118 // Check if the pc points into a large object chunk. | 1118 // Check if the pc points into a large object chunk. |
| 1119 LargeObjectChunk* chunk = Heap::lo_space()->FindChunkContainingPc(pc); | 1119 LargePage* large_page = Heap::lo_space()->FindPageContainingPc(pc); |
| 1120 if (chunk != NULL) return GcSafeCastToCode(chunk->GetObject(), pc); | 1120 if (large_page != NULL) return GcSafeCastToCode(large_page->GetObject(), pc); |
| 1121 | 1121 |
| 1122 // Iterate through the 8K page until we reach the end or find an | 1122 // Iterate through the 8K page until we reach the end or find an |
| 1123 // object starting after the pc. | 1123 // object starting after the pc. |
| 1124 Page* page = Page::FromAddress(pc); | 1124 Page* page = Page::FromAddress(pc); |
| 1125 HeapObjectIterator iterator(page, Heap::GcSafeSizeOfOldObjectFunction()); | 1125 HeapObjectIterator iterator(page, Heap::GcSafeSizeOfOldObjectFunction()); |
| 1126 HeapObject* previous = NULL; | 1126 HeapObject* previous = NULL; |
| 1127 while (true) { | 1127 while (true) { |
| 1128 HeapObject* next = iterator.next(); | 1128 HeapObject* next = iterator.next(); |
| 1129 if (next == NULL || next->address() >= pc) { | 1129 if (next == NULL || next->address() >= pc) { |
| 1130 return GcSafeCastToCode(previous, pc); | 1130 return GcSafeCastToCode(previous, pc); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 ZoneList<StackFrame*> list(10); | 1216 ZoneList<StackFrame*> list(10); |
| 1217 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1217 for (StackFrameIterator it; !it.done(); it.Advance()) { |
| 1218 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1218 StackFrame* frame = AllocateFrameCopy(it.frame()); |
| 1219 list.Add(frame); | 1219 list.Add(frame); |
| 1220 } | 1220 } |
| 1221 return list.ToVector(); | 1221 return list.ToVector(); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 | 1224 |
| 1225 } } // namespace v8::internal | 1225 } } // namespace v8::internal |
| OLD | NEW |