void IC::SetTargetAtAddress(Address address, Code* target,
ConstantPoolArray* constant_pool) {
+ if (AddressIsDeoptimizedCode(target->GetIsolate(), address)) return;
+
DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub());
// Don't use this for load_ics when --vector-ics is turned on.
}
-inline Code* IC::get_host() {
+Code* IC::get_host() {
return isolate()
->inner_pointer_to_code_cache()
->GetCacheEntry(address())
->code;
}
+
+
+bool IC::AddressIsDeoptimizedCode() const {
+ return AddressIsDeoptimizedCode(isolate(), address());
+}
+
+
+bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) {
+ Code* host =
+ isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
+ return (host->kind() == Code::OPTIMIZED_FUNCTION &&
+ host->marked_for_deoptimization());
+}
}
} // namespace v8::internal
void IC::TraceIC(const char* type, Handle<Object> name) {
if (FLAG_trace_ic) {
+ if (AddressIsDeoptimizedCode()) return;
State new_state =
UseVector() ? nexus()->StateFromFeedback() : raw_target()->ic_state();
TraceIC(type, name, state(), new_state);
}
-bool IC::AddressIsDeoptimizedCode() const {
- Code* host =
- isolate()->inner_pointer_to_code_cache()->GetCacheEntry(address())->code;
- return host->kind() == Code::OPTIMIZED_FUNCTION &&
- host->marked_for_deoptimization();
-}
-
-
static void LookupForRead(LookupIterator* it) {
for (; it->IsFound(); it->Next()) {
switch (it->state()) {
Code* GetOriginalCode() const;
bool AddressIsOptimizedCode() const;
- bool AddressIsDeoptimizedCode() const;
+ inline bool AddressIsDeoptimizedCode() const;
+ inline static bool AddressIsDeoptimizedCode(Isolate* isolate,
+ Address address);
// Set the call-site target.
inline void set_target(Code* code);