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

Side by Side Diff: src/type-feedback-vector.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/type-feedback-vector.h" 5 #include "src/type-feedback-vector.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/ic/ic-inl.h" 8 #include "src/ic/ic-inl.h"
9 #include "src/ic/ic-state.h" 9 #include "src/ic/ic-state.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Factory* factory = isolate->factory(); 184 Factory* factory = isolate->factory();
185 185
186 const int slot_count = metadata->slot_count(); 186 const int slot_count = metadata->slot_count();
187 const int length = slot_count + kReservedIndexCount; 187 const int length = slot_count + kReservedIndexCount;
188 if (length == kReservedIndexCount) { 188 if (length == kReservedIndexCount) {
189 return Handle<TypeFeedbackVector>::cast( 189 return Handle<TypeFeedbackVector>::cast(
190 factory->empty_type_feedback_vector()); 190 factory->empty_type_feedback_vector());
191 } 191 }
192 192
193 Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); 193 Handle<FixedArray> array = factory->NewFixedArray(length, TENURED);
194 array->set_map_no_write_barrier(isolate->heap()->type_feedback_vector_map());
194 array->set(kMetadataIndex, *metadata); 195 array->set(kMetadataIndex, *metadata);
195 array->set(kInvocationCountIndex, Smi::kZero); 196 array->set(kInvocationCountIndex, Smi::kZero);
196 197
197 DisallowHeapAllocation no_gc; 198 DisallowHeapAllocation no_gc;
198 199
199 // Ensure we can skip the write barrier 200 // Ensure we can skip the write barrier
200 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); 201 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate);
201 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel); 202 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel);
202 for (int i = 0; i < slot_count;) { 203 for (int i = 0; i < slot_count;) {
203 FeedbackVectorSlot slot(i); 204 FeedbackVectorSlot slot(i);
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic( 1012 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic(
1012 Handle<Name> name, Handle<Map> receiver_map) { 1013 Handle<Name> name, Handle<Map> receiver_map) {
1013 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); 1014 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
1014 1015
1015 SetFeedback(*cell); 1016 SetFeedback(*cell);
1016 SetFeedbackExtra(*name); 1017 SetFeedbackExtra(*name);
1017 } 1018 }
1018 1019
1019 } // namespace internal 1020 } // namespace internal
1020 } // namespace v8 1021 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698