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

Unified Diff: src/ic/ic.cc

Issue 958473004: Do not touch a binary op IC target in code object marked for lazy deopt. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index ef8e069fda99301efa30c9223af4253e221a7442..9721e459021ed4bb4e41160d631121876b593093 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -230,6 +230,14 @@ bool IC::AddressIsOptimizedCode() const {
}
+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()) {
@@ -2485,9 +2493,17 @@ MaybeHandle<Object> BinaryOpIC::Transition(
isolate(), result, Execution::Call(isolate(), function, left, 1, &right),
Object);
+ // Do not try to update the target if the code was marked for lazy
+ // deoptimization. (Since we do not relocate addresses in these
+ // code objects, an attempt to access the target could fail.)
+ if (AddressIsDeoptimizedCode()) {
+ return result;
+ }
+
// Execution::Call can execute arbitrary JavaScript, hence potentially
// update the state of this very IC, so we must update the stored state.
UpdateTarget();
+
// Compute the new state.
BinaryOpICState old_state(isolate(), target()->extra_ic_state());
state.Update(left, right, result);
« no previous file with comments | « src/ic/ic.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698