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

Side by Side Diff: src/type-feedback-vector.cc

Issue 767743002: Hydrogen code stubs for vector-based ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch One. Created 6 years 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ic/ic.h" 7 #include "src/ic/ic.h"
8 #include "src/ic/ic-state.h" 8 #include "src/ic/ic-state.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/type-feedback-vector-inl.h" 10 #include "src/type-feedback-vector-inl.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length, TENURED); 92 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length, TENURED);
93 if (ic_slot_count > 0) { 93 if (ic_slot_count > 0) {
94 array->set(kFirstICSlotIndex, 94 array->set(kFirstICSlotIndex,
95 Smi::FromInt(slot_count + index_count + kReservedIndexCount)); 95 Smi::FromInt(slot_count + index_count + kReservedIndexCount));
96 } else { 96 } else {
97 array->set(kFirstICSlotIndex, Smi::FromInt(length)); 97 array->set(kFirstICSlotIndex, Smi::FromInt(length));
98 } 98 }
99 array->set(kWithTypesIndex, Smi::FromInt(0)); 99 array->set(kWithTypesIndex, Smi::FromInt(0));
100 array->set(kGenericCountIndex, Smi::FromInt(0)); 100 array->set(kGenericCountIndex, Smi::FromInt(0));
101 // Fill the indexes with zeros.
102 for (int i = 0; i < index_count; i++) {
103 array->set(kReservedIndexCount + i, Smi::FromInt(0));
104 }
101 105
102 // Ensure we can skip the write barrier 106 // Ensure we can skip the write barrier
103 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate); 107 Handle<Object> uninitialized_sentinel = UninitializedSentinel(isolate);
104 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel); 108 DCHECK_EQ(isolate->heap()->uninitialized_symbol(), *uninitialized_sentinel);
105 for (int i = kReservedIndexCount + index_count; i < length; i++) { 109 for (int i = kReservedIndexCount + index_count; i < length; i++) {
106 array->set(i, *uninitialized_sentinel, SKIP_WRITE_BARRIER); 110 array->set(i, *uninitialized_sentinel, SKIP_WRITE_BARRIER);
107 } 111 }
108 112
109 Handle<TypeFeedbackVector> vector = Handle<TypeFeedbackVector>::cast(array); 113 Handle<TypeFeedbackVector> vector = Handle<TypeFeedbackVector>::cast(array);
110 if (FLAG_vector_ics) { 114 if (FLAG_vector_ics) {
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (feedback->IsFixedArray()) { 496 if (feedback->IsFixedArray()) {
493 FixedArray* array = FixedArray::cast(feedback); 497 FixedArray* array = FixedArray::cast(feedback);
494 DCHECK(array->length() >= 3); 498 DCHECK(array->length() >= 3);
495 Object* name = array->get(0); 499 Object* name = array->get(0);
496 if (name->IsName()) return Name::cast(name); 500 if (name->IsName()) return Name::cast(name);
497 } 501 }
498 return NULL; 502 return NULL;
499 } 503 }
500 } 504 }
501 } // namespace v8::internal 505 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698