| 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 756 |
| 757 void Heap::PreprocessStackTraces() { | 757 void Heap::PreprocessStackTraces() { |
| 758 WeakFixedArray::Iterator iterator(weak_stack_trace_list()); | 758 WeakFixedArray::Iterator iterator(weak_stack_trace_list()); |
| 759 FixedArray* elements; | 759 FixedArray* elements; |
| 760 while ((elements = iterator.Next<FixedArray>())) { | 760 while ((elements = iterator.Next<FixedArray>())) { |
| 761 for (int j = 1; j < elements->length(); j += 4) { | 761 for (int j = 1; j < elements->length(); j += 4) { |
| 762 Object* maybe_code = elements->get(j + 2); | 762 Object* maybe_code = elements->get(j + 2); |
| 763 // If GC happens while adding a stack trace to the weak fixed array, | 763 // If GC happens while adding a stack trace to the weak fixed array, |
| 764 // which has been copied into a larger backing store, we may run into | 764 // which has been copied into a larger backing store, we may run into |
| 765 // a stack trace that has already been preprocessed. Guard against this. | 765 // a stack trace that has already been preprocessed. Guard against this. |
| 766 if (!maybe_code->IsAbstractCode()) break; | 766 if (!maybe_code->IsCode()) break; |
| 767 AbstractCode* abstract_code = AbstractCode::cast(maybe_code); | 767 Code* code = Code::cast(maybe_code); |
| 768 int offset = Smi::cast(elements->get(j + 3))->value(); | 768 int offset = Smi::cast(elements->get(j + 3))->value(); |
| 769 int pos = abstract_code->SourcePosition(offset); | 769 int pos = code->SourcePosition(offset); |
| 770 elements->set(j + 2, Smi::FromInt(pos)); | 770 elements->set(j + 2, Smi::FromInt(pos)); |
| 771 } | 771 } |
| 772 } | 772 } |
| 773 // We must not compact the weak fixed list here, as we may be in the middle | 773 // We must not compact the weak fixed list here, as we may be in the middle |
| 774 // of writing to it, when the GC triggered. Instead, we reset the root value. | 774 // of writing to it, when the GC triggered. Instead, we reset the root value. |
| 775 set_weak_stack_trace_list(Smi::FromInt(0)); | 775 set_weak_stack_trace_list(Smi::FromInt(0)); |
| 776 } | 776 } |
| 777 | 777 |
| 778 | 778 |
| 779 class GCCallbacksScope { | 779 class GCCallbacksScope { |
| (...skipping 5696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6476 } | 6476 } |
| 6477 | 6477 |
| 6478 | 6478 |
| 6479 // static | 6479 // static |
| 6480 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6480 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6481 return StaticVisitorBase::GetVisitorId(map); | 6481 return StaticVisitorBase::GetVisitorId(map); |
| 6482 } | 6482 } |
| 6483 | 6483 |
| 6484 } // namespace internal | 6484 } // namespace internal |
| 6485 } // namespace v8 | 6485 } // namespace v8 |
| OLD | NEW |