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

Unified Diff: src/ic/ic-inl.h

Issue 1152243002: Do not patch IC in deoptimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove unused declaration Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-inl.h
diff --git a/src/ic/ic-inl.h b/src/ic/ic-inl.h
index b0decf4c6a393b88ac332c82367c2974ccbebfa0..4db1b39510629e0753c4b0980ed1f0a49c10deb9 100644
--- a/src/ic/ic-inl.h
+++ b/src/ic/ic-inl.h
@@ -95,6 +95,8 @@ Code* IC::GetTargetAtAddress(Address address,
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.
@@ -212,12 +214,25 @@ Handle<Map> IC::GetICCacheHolder(Handle<Map> map, Isolate* isolate,
}
-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
« no previous file with comments | « src/ic/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698