#include "src/ic/ic-inl.h"
#include "src/ic/ic-compiler.h"
#include "src/ic/stub-cache.h"
+#include "src/macro-assembler.h"
#include "src/prototype.h"
#include "src/runtime/runtime.h"
case Code::KEYED_LOAD_IC:
return;
case Code::STORE_IC:
+ if (FLAG_vector_stores) return;
return StoreIC::Clear(isolate, address, target, constant_pool);
case Code::KEYED_STORE_IC:
+ if (FLAG_vector_stores) return;
return KeyedStoreIC::Clear(isolate, address, target, constant_pool);
case Code::COMPARE_IC:
return CompareIC::Clear(isolate, address, target, constant_pool);
}
+void StoreIC::Clear(Isolate* isolate, Code* host, StoreICNexus* nexus) {
+ if (IsCleared(nexus)) return;
+ State state = nexus->StateFromFeedback();
+ nexus->ConfigurePremonomorphic();
+ OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, PREMONOMORPHIC);
+}
+
+
void KeyedStoreIC::Clear(Isolate* isolate, Address address, Code* target,
Address constant_pool) {
if (IsCleared(target)) return;
}
+void KeyedStoreIC::Clear(Isolate* isolate, Code* host,
+ KeyedStoreICNexus* nexus) {
+ if (IsCleared(nexus)) return;
+ State state = nexus->StateFromFeedback();
+ nexus->ConfigurePremonomorphic();
+ OnTypeFeedbackChanged(isolate, host, nexus->vector(), state, PREMONOMORPHIC);
+}
+
+
void CompareIC::Clear(Isolate* isolate, Address address, Code* target,
Address constant_pool) {
DCHECK(CodeStub::GetMajorKey(target) == CodeStub::CompareIC);
void IC::ConfigureVectorState(IC::State new_state) {
DCHECK(UseVector());
- if (kind() == Code::LOAD_IC) {
- LoadICNexus* nexus = casted_nexus<LoadICNexus>();
- if (new_state == PREMONOMORPHIC) {
- nexus->ConfigurePremonomorphic();
- } else if (new_state == MEGAMORPHIC) {
- nexus->ConfigureMegamorphic();
- } else {
- UNREACHABLE();
- }
- } else if (kind() == Code::KEYED_LOAD_IC) {
- KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
- if (new_state == PREMONOMORPHIC) {
- nexus->ConfigurePremonomorphic();
- } else if (new_state == MEGAMORPHIC) {
- nexus->ConfigureMegamorphic();
- } else {
- UNREACHABLE();
- }
+ if (new_state == PREMONOMORPHIC) {
+ nexus()->ConfigurePremonomorphic();
+ } else if (new_state == MEGAMORPHIC) {
+ nexus()->ConfigureMegamorphic();
} else {
UNREACHABLE();
}
if (kind() == Code::LOAD_IC) {
LoadICNexus* nexus = casted_nexus<LoadICNexus>();
nexus->ConfigureMonomorphic(map, handler);
- } else {
- DCHECK(kind() == Code::KEYED_LOAD_IC);
+ } else if (kind() == Code::KEYED_LOAD_IC) {
KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
nexus->ConfigureMonomorphic(name, map, handler);
+ } else if (kind() == Code::STORE_IC) {
+ StoreICNexus* nexus = casted_nexus<StoreICNexus>();
+ nexus->ConfigureMonomorphic(map, handler);
+ } else {
+ DCHECK(kind() == Code::KEYED_STORE_IC);
+ KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>();
+ nexus->ConfigureMonomorphic(name, map, handler);
}
vector_set_ = true;
if (kind() == Code::LOAD_IC) {
LoadICNexus* nexus = casted_nexus<LoadICNexus>();
nexus->ConfigurePolymorphic(maps, handlers);
- } else {
- DCHECK(kind() == Code::KEYED_LOAD_IC);
+ } else if (kind() == Code::KEYED_LOAD_IC) {
KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
nexus->ConfigurePolymorphic(name, maps, handlers);
+ } else if (kind() == Code::STORE_IC) {
+ StoreICNexus* nexus = casted_nexus<StoreICNexus>();
+ nexus->ConfigurePolymorphic(maps, handlers);
+ } else {
+ DCHECK(kind() == Code::KEYED_STORE_IC);
+ KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>();
+ nexus->ConfigurePolymorphic(name, maps, handlers);
}
vector_set_ = true;
if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) {
// Rewrite to the generic keyed load stub.
if (FLAG_use_ic) {
- if (UseVector()) {
- ConfigureVectorState(MEGAMORPHIC);
- } else {
- set_target(*megamorphic_stub());
- }
+ DCHECK(UseVector());
+ ConfigureVectorState(MEGAMORPHIC);
TRACE_IC("LoadIC", name);
TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
}
if (state() == UNINITIALIZED) {
// This is the first time we execute this inline cache. Set the target to
// the pre monomorphic stub to delay setting the monomorphic state.
- set_target(*pre_monomorphic_stub());
+ if (FLAG_vector_stores) {
+ ConfigureVectorState(PREMONOMORPHIC);
+ } else {
+ set_target(*pre_monomorphic_stub());
+ }
TRACE_IC("StoreIC", lookup->name());
return;
}
StoreIC::Store(object, Handle<Name>::cast(key), value,
JSReceiver::MAY_BE_STORE_FROM_KEYED),
Object);
- if (!is_target_set()) {
- TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
- "unhandled internalized string key");
- TRACE_IC("StoreIC", key);
- set_target(*stub);
+ if (FLAG_vector_stores) {
+ if (!is_vector_set()) {
+ ConfigureVectorState(MEGAMORPHIC);
+ TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
+ "unhandled internalized string key");
+ TRACE_IC("StoreIC", key);
+ }
+ } else {
+ if (!is_target_set()) {
+ TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
+ "unhandled internalized string key");
+ TRACE_IC("StoreIC", key);
+ set_target(*stub);
+ }
}
return store_handle;
}
Object);
}
- DCHECK(!is_target_set());
- Code* megamorphic = *megamorphic_stub();
- if (*stub == megamorphic) {
- TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic");
- }
- if (*stub == *slow_stub()) {
- TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "slow stub");
- }
- DCHECK(!stub.is_null());
- if (!AddressIsDeoptimizedCode()) {
- set_target(*stub);
+ if (FLAG_vector_stores) {
+ if (!is_vector_set() || stub.is_null()) {
+ Code* megamorphic = *megamorphic_stub();
+ if (!stub.is_null() && (*stub == megamorphic || *stub == *slow_stub())) {
+ ConfigureVectorState(MEGAMORPHIC);
+ TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
+ *stub == megamorphic ? "set generic" : "slow stub");
+ }
+ }
+ } else {
+ DCHECK(!is_target_set());
+ Code* megamorphic = *megamorphic_stub();
+ if (*stub == megamorphic) {
+ TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic");
+ } else if (*stub == *slow_stub()) {
+ TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "slow stub");
+ }
+
+ DCHECK(!stub.is_null());
+ if (!AddressIsDeoptimizedCode()) {
+ set_target(*stub);
+ }
}
TRACE_IC("StoreIC", key);
// We are going generic.
CallICNexus* nexus = casted_nexus<CallICNexus>();
- nexus->ConfigureGeneric();
+ nexus->ConfigureMegamorphic();
// Vector-based ICs have a different calling convention in optimized code
// than full code so the correct stub has to be chosen.
if (feedback->IsWeakCell() || !function->IsJSFunction()) {
// We are going generic.
- nexus->ConfigureGeneric();
+ nexus->ConfigureMegamorphic();
} else {
// The feedback is either uninitialized or an allocation site.
// It might be an allocation site because if we re-compile the full code
RUNTIME_FUNCTION(StoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
- DCHECK(args.length() == 3);
- StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Name> key = args.at<Name>(1);
- ic.UpdateState(receiver, key);
+ Handle<Object> value = args.at<Object>(2);
Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
+
+ if (FLAG_vector_stores) {
+ DCHECK(args.length() == 5);
+ Handle<Smi> slot = args.at<Smi>(3);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4);
+ FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
+ if (vector->GetKind(vector_slot) == Code::STORE_IC) {
+ StoreICNexus nexus(vector, vector_slot);
+ StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ } else {
+ DCHECK(vector->GetKind(vector_slot) == Code::KEYED_STORE_IC);
+ KeyedStoreICNexus nexus(vector, vector_slot);
+ KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ }
+ } else {
+ DCHECK(args.length() == 3);
+ StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ }
return *result;
}
RUNTIME_FUNCTION(StoreIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
- DCHECK(args.length() == 3 || args.length() == 4);
- StoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Name> key = args.at<Name>(1);
- ic.UpdateState(receiver, key);
+ Handle<Object> value = args.at<Object>(2);
Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
+
+ if (FLAG_vector_stores) {
+ DCHECK(args.length() == 5);
+ Handle<Smi> slot = args.at<Smi>(3);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4);
+ FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
+ if (vector->GetKind(vector_slot) == Code::STORE_IC) {
+ StoreICNexus nexus(vector, vector_slot);
+ StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ } else {
+ DCHECK(vector->GetKind(vector_slot) == Code::KEYED_STORE_IC);
+ KeyedStoreICNexus nexus(vector, vector_slot);
+ KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ }
+ } else {
+ DCHECK(args.length() == 3 || args.length() == 4);
+ StoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ }
return *result;
}
RUNTIME_FUNCTION(KeyedStoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
- DCHECK(args.length() == 3);
- KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Object> key = args.at<Object>(1);
- ic.UpdateState(receiver, key);
+ Handle<Object> value = args.at<Object>(2);
Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
+
+ if (FLAG_vector_stores) {
+ DCHECK(args.length() == 5);
+ Handle<Smi> slot = args.at<Smi>(3);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4);
+ FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
+ KeyedStoreICNexus nexus(vector, vector_slot);
+ KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ } else {
+ DCHECK(args.length() == 3);
+ KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ }
return *result;
}
RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
- DCHECK(args.length() == 3);
- KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Object> key = args.at<Object>(1);
- ic.UpdateState(receiver, key);
+ Handle<Object> value = args.at<Object>(2);
Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
+
+ if (FLAG_vector_stores) {
+ DCHECK(args.length() == 5);
+ Handle<Smi> slot = args.at<Smi>(3);
+ Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4);
+ FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
+ KeyedStoreICNexus nexus(vector, vector_slot);
+ KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ ic.Store(receiver, key, value));
+ } else {
+ DCHECK(args.length() == 3);
+ KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate);
+ ic.UpdateState(receiver, key);
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
+ }
return *result;
}
} else if (kind == Code::KEYED_LOAD_IC) {
KeyedLoadICNexus nexus(this, slot);
nexus.Clear(host);
+ } else if (kind == Code::STORE_IC) {
+ DCHECK(FLAG_vector_stores);
+ StoreICNexus nexus(this, slot);
+ nexus.Clear(host);
+ } else if (kind == Code::KEYED_STORE_IC) {
+ DCHECK(FLAG_vector_stores);
+ KeyedStoreICNexus nexus(this, slot);
+ nexus.Clear(host);
}
- // TODO(mvstanton): Handle clearing of store ics when FLAG_vector_stores
- // is true.
}
}
}
}
+void FeedbackNexus::ConfigureUninitialized() {
+ SetFeedback(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+}
+
+
+void FeedbackNexus::ConfigurePremonomorphic() {
+ SetFeedback(*TypeFeedbackVector::PremonomorphicSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+}
+
+
+void FeedbackNexus::ConfigureMegamorphic() {
+ Isolate* isolate = GetIsolate();
+ SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+}
+
+
InlineCacheState LoadICNexus::StateFromFeedback() const {
Isolate* isolate = GetIsolate();
Object* feedback = GetFeedback();
}
+InlineCacheState StoreICNexus::StateFromFeedback() const {
+ Isolate* isolate = GetIsolate();
+ Object* feedback = GetFeedback();
+
+ if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
+ return UNINITIALIZED;
+ } else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
+ return MEGAMORPHIC;
+ } else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
+ return PREMONOMORPHIC;
+ } else if (feedback->IsFixedArray()) {
+ // Determine state purely by our structure, don't check if the maps are
+ // cleared.
+ return POLYMORPHIC;
+ } else if (feedback->IsWeakCell()) {
+ // Don't check if the map is cleared.
+ return MONOMORPHIC;
+ }
+
+ return UNINITIALIZED;
+}
+
+
+InlineCacheState KeyedStoreICNexus::StateFromFeedback() const {
+ Isolate* isolate = GetIsolate();
+ Object* feedback = GetFeedback();
+
+ if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) {
+ return UNINITIALIZED;
+ } else if (feedback == *TypeFeedbackVector::PremonomorphicSentinel(isolate)) {
+ return PREMONOMORPHIC;
+ } else if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) {
+ return MEGAMORPHIC;
+ } else if (feedback->IsFixedArray()) {
+ // Determine state purely by our structure, don't check if the maps are
+ // cleared.
+ return POLYMORPHIC;
+ } else if (feedback->IsWeakCell()) {
+ // Don't check if the map is cleared.
+ return MONOMORPHIC;
+ } else if (feedback->IsName()) {
+ Object* extra = GetFeedbackExtra();
+ FixedArray* extra_array = FixedArray::cast(extra);
+ return extra_array->length() > 2 ? POLYMORPHIC : MONOMORPHIC;
+ }
+
+ return UNINITIALIZED;
+}
+
+
InlineCacheState CallICNexus::StateFromFeedback() const {
Isolate* isolate = GetIsolate();
Object* feedback = GetFeedback();
void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); }
-void CallICNexus::ConfigureGeneric() {
- SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
-}
-
-
void CallICNexus::ConfigureMonomorphicArray() {
Object* feedback = GetFeedback();
if (!feedback->IsAllocationSite()) {
}
-void CallICNexus::ConfigureUninitialized() {
- SetFeedback(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
-}
-
-
void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) {
Handle<WeakCell> new_cell = GetIsolate()->factory()->NewWeakCell(function);
SetFeedback(*new_cell);
}
-void KeyedLoadICNexus::ConfigureMegamorphic() {
- Isolate* isolate = GetIsolate();
- SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
- SKIP_WRITE_BARRIER);
-}
-
-
-void LoadICNexus::ConfigureMegamorphic() {
- SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
-}
-
-
-void LoadICNexus::ConfigurePremonomorphic() {
- SetFeedback(*TypeFeedbackVector::PremonomorphicSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
- SKIP_WRITE_BARRIER);
+void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
+ Handle<Code> handler) {
+ Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
+ SetFeedback(*cell);
+ SetFeedbackExtra(*handler);
}
-void KeyedLoadICNexus::ConfigurePremonomorphic() {
- Isolate* isolate = GetIsolate();
- SetFeedback(*TypeFeedbackVector::PremonomorphicSentinel(isolate),
- SKIP_WRITE_BARRIER);
- SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
- SKIP_WRITE_BARRIER);
+void KeyedLoadICNexus::ConfigureMonomorphic(Handle<Name> name,
+ Handle<Map> receiver_map,
+ Handle<Code> handler) {
+ Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
+ if (name.is_null()) {
+ SetFeedback(*cell);
+ SetFeedbackExtra(*handler);
+ } else {
+ SetFeedback(*name);
+ Handle<FixedArray> array = EnsureExtraArrayOfSize(2);
+ array->set(0, *cell);
+ array->set(1, *handler);
+ }
}
-void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
- Handle<Code> handler) {
+void StoreICNexus::ConfigureMonomorphic(Handle<Map> receiver_map,
+ Handle<Code> handler) {
Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
SetFeedback(*cell);
SetFeedbackExtra(*handler);
}
-void KeyedLoadICNexus::ConfigureMonomorphic(Handle<Name> name,
- Handle<Map> receiver_map,
- Handle<Code> handler) {
+void KeyedStoreICNexus::ConfigureMonomorphic(Handle<Name> name,
+ Handle<Map> receiver_map,
+ Handle<Code> handler) {
Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
if (name.is_null()) {
SetFeedback(*cell);
}
+void StoreICNexus::ConfigurePolymorphic(MapHandleList* maps,
+ CodeHandleList* handlers) {
+ Isolate* isolate = GetIsolate();
+ int receiver_count = maps->length();
+ Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2);
+ InstallHandlers(array, maps, handlers);
+ SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+}
+
+
+void KeyedStoreICNexus::ConfigurePolymorphic(Handle<Name> name,
+ MapHandleList* maps,
+ CodeHandleList* handlers) {
+ int receiver_count = maps->length();
+ DCHECK(receiver_count > 1);
+ Handle<FixedArray> array;
+ if (name.is_null()) {
+ array = EnsureArrayOfSize(receiver_count * 2);
+ SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+ } else {
+ SetFeedback(*name);
+ array = EnsureExtraArrayOfSize(receiver_count * 2);
+ }
+
+ InstallHandlers(array, maps, handlers);
+}
+
+
int FeedbackNexus::ExtractMaps(MapHandleList* maps) const {
Isolate* isolate = GetIsolate();
Object* feedback = GetFeedback();
}
return NULL;
}
+
+
+Name* KeyedStoreICNexus::FindFirstName() const {
+ Object* feedback = GetFeedback();
+ if (feedback->IsString()) {
+ return Name::cast(feedback);
+ }
+ return NULL;
+}
+
+
+void StoreICNexus::Clear(Code* host) {
+ StoreIC::Clear(GetIsolate(), host, this);
+}
+
+
+void KeyedStoreICNexus::Clear(Code* host) {
+ KeyedStoreIC::Clear(GetIsolate(), host, this);
+}
} // namespace internal
} // namespace v8