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/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2791 // relativize the absolute call counts, but we can only have call counts | 2791 // relativize the absolute call counts, but we can only have call counts |
2792 // if we have actual feedback slots. | 2792 // if we have actual feedback slots. |
2793 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray( | 2793 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray( |
2794 TypeFeedbackVector::kReservedIndexCount, TENURED); | 2794 TypeFeedbackVector::kReservedIndexCount, TENURED); |
2795 empty_type_feedback_vector->set(TypeFeedbackVector::kMetadataIndex, | 2795 empty_type_feedback_vector->set(TypeFeedbackVector::kMetadataIndex, |
2796 empty_fixed_array()); | 2796 empty_fixed_array()); |
2797 empty_type_feedback_vector->set(TypeFeedbackVector::kInvocationCountIndex, | 2797 empty_type_feedback_vector->set(TypeFeedbackVector::kInvocationCountIndex, |
2798 Smi::kZero); | 2798 Smi::kZero); |
2799 empty_type_feedback_vector->set_map(type_feedback_vector_map()); | 2799 empty_type_feedback_vector->set_map(type_feedback_vector_map()); |
2800 set_empty_type_feedback_vector(*empty_type_feedback_vector); | 2800 set_empty_type_feedback_vector(*empty_type_feedback_vector); |
2801 | |
2802 // We use a canonical empty LiteralsArray for all functions that neither | |
2803 // have literals nor need a TypeFeedbackVector (besides the invocation | |
2804 // count special slot). | |
2805 Handle<FixedArray> empty_literals_array = | |
2806 factory->NewFixedArray(1, TENURED); | |
2807 empty_literals_array->set(0, *empty_type_feedback_vector); | |
2808 set_empty_literals_array(*empty_literals_array); | |
2809 } | 2801 } |
2810 | 2802 |
2811 { | 2803 { |
2812 Handle<FixedArray> empty_sloppy_arguments_elements = | 2804 Handle<FixedArray> empty_sloppy_arguments_elements = |
2813 factory->NewFixedArray(2, TENURED); | 2805 factory->NewFixedArray(2, TENURED); |
2814 empty_sloppy_arguments_elements->set_map(sloppy_arguments_elements_map()); | 2806 empty_sloppy_arguments_elements->set_map(sloppy_arguments_elements_map()); |
2815 set_empty_sloppy_arguments_elements(*empty_sloppy_arguments_elements); | 2807 set_empty_sloppy_arguments_elements(*empty_sloppy_arguments_elements); |
2816 } | 2808 } |
2817 | 2809 |
2818 { | 2810 { |
(...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6606 } | 6598 } |
6607 | 6599 |
6608 | 6600 |
6609 // static | 6601 // static |
6610 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6602 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6611 return StaticVisitorBase::GetVisitorId(map); | 6603 return StaticVisitorBase::GetVisitorId(map); |
6612 } | 6604 } |
6613 | 6605 |
6614 } // namespace internal | 6606 } // namespace internal |
6615 } // namespace v8 | 6607 } // namespace v8 |
OLD | NEW |