Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Side by Side Diff: src/heap/heap.cc

Issue 2617363003: Use map to distinguish type feedback vectors. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 field_name##_map()->SetConstructorFunctionIndex( \ 2240 field_name##_map()->SetConstructorFunctionIndex( \
2241 (constructor_function_index)); \ 2241 (constructor_function_index)); \
2242 } 2242 }
2243 2243
2244 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, fixed_cow_array) 2244 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, fixed_cow_array)
2245 fixed_cow_array_map()->set_elements_kind(FAST_HOLEY_ELEMENTS); 2245 fixed_cow_array_map()->set_elements_kind(FAST_HOLEY_ELEMENTS);
2246 DCHECK_NE(fixed_array_map(), fixed_cow_array_map()); 2246 DCHECK_NE(fixed_array_map(), fixed_cow_array_map());
2247 2247
2248 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, scope_info) 2248 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, scope_info)
2249 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, module_info) 2249 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, module_info)
2250 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, type_feedback_vector)
2250 ALLOCATE_PRIMITIVE_MAP(HEAP_NUMBER_TYPE, HeapNumber::kSize, heap_number, 2251 ALLOCATE_PRIMITIVE_MAP(HEAP_NUMBER_TYPE, HeapNumber::kSize, heap_number,
2251 Context::NUMBER_FUNCTION_INDEX) 2252 Context::NUMBER_FUNCTION_INDEX)
2252 ALLOCATE_MAP(MUTABLE_HEAP_NUMBER_TYPE, HeapNumber::kSize, 2253 ALLOCATE_MAP(MUTABLE_HEAP_NUMBER_TYPE, HeapNumber::kSize,
2253 mutable_heap_number) 2254 mutable_heap_number)
2254 ALLOCATE_PRIMITIVE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol, 2255 ALLOCATE_PRIMITIVE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol,
2255 Context::SYMBOL_FUNCTION_INDEX) 2256 Context::SYMBOL_FUNCTION_INDEX)
2256 #define ALLOCATE_SIMD128_MAP(TYPE, Type, type, lane_count, lane_type) \ 2257 #define ALLOCATE_SIMD128_MAP(TYPE, Type, type, lane_count, lane_type) \
2257 ALLOCATE_PRIMITIVE_MAP(SIMD128_VALUE_TYPE, Type::kSize, type, \ 2258 ALLOCATE_PRIMITIVE_MAP(SIMD128_VALUE_TYPE, Type::kSize, type, \
2258 Context::TYPE##_FUNCTION_INDEX) 2259 Context::TYPE##_FUNCTION_INDEX)
2259 SIMD128_TYPES(ALLOCATE_SIMD128_MAP) 2260 SIMD128_TYPES(ALLOCATE_SIMD128_MAP)
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 // that all these functions will share the same invocation count, but 2769 // that all these functions will share the same invocation count, but
2769 // that shouldn't matter since we only use the invocation count to 2770 // that shouldn't matter since we only use the invocation count to
2770 // relativize the absolute call counts, but we can only have call counts 2771 // relativize the absolute call counts, but we can only have call counts
2771 // if we have actual feedback slots. 2772 // if we have actual feedback slots.
2772 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray( 2773 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray(
2773 TypeFeedbackVector::kReservedIndexCount, TENURED); 2774 TypeFeedbackVector::kReservedIndexCount, TENURED);
2774 empty_type_feedback_vector->set(TypeFeedbackVector::kMetadataIndex, 2775 empty_type_feedback_vector->set(TypeFeedbackVector::kMetadataIndex,
2775 empty_fixed_array()); 2776 empty_fixed_array());
2776 empty_type_feedback_vector->set(TypeFeedbackVector::kInvocationCountIndex, 2777 empty_type_feedback_vector->set(TypeFeedbackVector::kInvocationCountIndex,
2777 Smi::kZero); 2778 Smi::kZero);
2779 empty_type_feedback_vector->set_map(type_feedback_vector_map());
2778 set_empty_type_feedback_vector(*empty_type_feedback_vector); 2780 set_empty_type_feedback_vector(*empty_type_feedback_vector);
2779 2781
2780 // We use a canonical empty LiteralsArray for all functions that neither 2782 // We use a canonical empty LiteralsArray for all functions that neither
2781 // have literals nor need a TypeFeedbackVector (besides the invocation 2783 // have literals nor need a TypeFeedbackVector (besides the invocation
2782 // count special slot). 2784 // count special slot).
2783 Handle<FixedArray> empty_literals_array = 2785 Handle<FixedArray> empty_literals_array =
2784 factory->NewFixedArray(1, TENURED); 2786 factory->NewFixedArray(1, TENURED);
2785 empty_literals_array->set(0, *empty_type_feedback_vector); 2787 empty_literals_array->set(0, *empty_type_feedback_vector);
2786 set_empty_literals_array(*empty_literals_array); 2788 set_empty_literals_array(*empty_literals_array);
2787 } 2789 }
(...skipping 3755 matching lines...) Expand 10 before | Expand all | Expand 10 after
6543 } 6545 }
6544 6546
6545 6547
6546 // static 6548 // static
6547 int Heap::GetStaticVisitorIdForMap(Map* map) { 6549 int Heap::GetStaticVisitorIdForMap(Map* map) {
6548 return StaticVisitorBase::GetVisitorId(map); 6550 return StaticVisitorBase::GetVisitorId(map);
6549 } 6551 }
6550 6552
6551 } // namespace internal 6553 } // namespace internal
6552 } // namespace v8 6554 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/objects-inl.h » ('j') | src/type-feedback-vector-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698