OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 Address inner_pointer) { | 1509 Address inner_pointer) { |
1510 Code* code = reinterpret_cast<Code*>(object); | 1510 Code* code = reinterpret_cast<Code*>(object); |
1511 DCHECK(code != NULL && GcSafeCodeContains(code, inner_pointer)); | 1511 DCHECK(code != NULL && GcSafeCodeContains(code, inner_pointer)); |
1512 return code; | 1512 return code; |
1513 } | 1513 } |
1514 | 1514 |
1515 | 1515 |
1516 Code* InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer( | 1516 Code* InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer( |
1517 Address inner_pointer) { | 1517 Address inner_pointer) { |
1518 Heap* heap = isolate_->heap(); | 1518 Heap* heap = isolate_->heap(); |
1519 if (!heap->code_space()->Contains(inner_pointer) && | |
1520 !heap->lo_space()->Contains(inner_pointer)) { | |
1521 return nullptr; | |
1522 } | |
1523 | 1519 |
1524 // Check if the inner pointer points into a large object chunk. | 1520 // Check if the inner pointer points into a large object chunk. |
1525 LargePage* large_page = heap->lo_space()->FindPage(inner_pointer); | 1521 LargePage* large_page = heap->lo_space()->FindPage(inner_pointer); |
1526 if (large_page != NULL) { | 1522 if (large_page != NULL) { |
1527 return GcSafeCastToCode(large_page->GetObject(), inner_pointer); | 1523 return GcSafeCastToCode(large_page->GetObject(), inner_pointer); |
1528 } | 1524 } |
1529 | 1525 |
| 1526 if (!heap->code_space()->Contains(inner_pointer)) { |
| 1527 return nullptr; |
| 1528 } |
| 1529 |
1530 // Iterate through the page until we reach the end or find an object starting | 1530 // Iterate through the page until we reach the end or find an object starting |
1531 // after the inner pointer. | 1531 // after the inner pointer. |
1532 Page* page = Page::FromAddress(inner_pointer); | 1532 Page* page = Page::FromAddress(inner_pointer); |
1533 | 1533 |
1534 DCHECK_EQ(page->owner(), heap->code_space()); | 1534 DCHECK_EQ(page->owner(), heap->code_space()); |
1535 heap->mark_compact_collector()->SweepOrWaitUntilSweepingCompleted(page); | 1535 heap->mark_compact_collector()->SweepOrWaitUntilSweepingCompleted(page); |
1536 | 1536 |
1537 Address addr = page->skip_list()->StartFor(inner_pointer); | 1537 Address addr = page->skip_list()->StartFor(inner_pointer); |
1538 | 1538 |
1539 Address top = heap->code_space()->top(); | 1539 Address top = heap->code_space()->top(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1638 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1639 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1639 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1640 list.Add(frame, zone); | 1640 list.Add(frame, zone); |
1641 } | 1641 } |
1642 return list.ToVector(); | 1642 return list.ToVector(); |
1643 } | 1643 } |
1644 | 1644 |
1645 | 1645 |
1646 } // namespace internal | 1646 } // namespace internal |
1647 } // namespace v8 | 1647 } // namespace v8 |
OLD | NEW |