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

Unified Diff: src/ic/ic.cc

Issue 1925583002: Check the state of the current binary op IC before patching smi code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | test/mjsunit/regress/regress-recurse-patch-binary-op.js » ('j') | 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 05be6c6ef33ca20566d81993507fcd21013d7424..73f72c3e4e658c529c35617f2d067854c2af77b8 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -2357,11 +2357,11 @@ MaybeHandle<Object> BinaryOpIC::Transition(
}
// Compute the new state.
- BinaryOpICState old_state(isolate(), extra_ic_state());
+ BinaryOpICState old_state(isolate(), target()->extra_ic_state());
state.Update(left, right, result);
// Check if we have a string operation here.
- Handle<Code> target;
+ Handle<Code> new_target;
if (!allocation_site.is_null() || state.ShouldCreateAllocationMementos()) {
// Setup the allocation site on-demand.
if (allocation_site.is_null()) {
@@ -2370,24 +2370,24 @@ MaybeHandle<Object> BinaryOpIC::Transition(
// Install the stub with an allocation site.
BinaryOpICWithAllocationSiteStub stub(isolate(), state);
- target = stub.GetCodeCopyFromTemplate(allocation_site);
+ new_target = stub.GetCodeCopyFromTemplate(allocation_site);
// Sanity check the trampoline stub.
- DCHECK_EQ(*allocation_site, target->FindFirstAllocationSite());
+ DCHECK_EQ(*allocation_site, new_target->FindFirstAllocationSite());
} else {
// Install the generic stub.
BinaryOpICStub stub(isolate(), state);
- target = stub.GetCode();
+ new_target = stub.GetCode();
// Sanity check the generic stub.
- DCHECK_NULL(target->FindFirstAllocationSite());
+ DCHECK_NULL(new_target->FindFirstAllocationSite());
}
- set_target(*target);
+ set_target(*new_target);
if (FLAG_trace_ic) {
OFStream os(stdout);
os << "[BinaryOpIC" << old_state << " => " << state << " @ "
- << static_cast<void*>(*target) << " <- ";
+ << static_cast<void*>(*new_target) << " <- ";
JavaScriptFrame::PrintTop(isolate(), stdout, false, true);
if (!allocation_site.is_null()) {
os << " using allocation site " << static_cast<void*>(*allocation_site);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-recurse-patch-binary-op.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698