Chromium Code Reviews

Unified Diff: src/ic.cc

Issue 284153004: Avoid flushing the icache unnecessarily when updating target addresses in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update SKIP_ICACHE_FLUSH_IF_ATOMIC to only skip when patching a single instruction. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« src/arm/assembler-arm-inl.h ('K') | « src/ic.h ('k') | src/ic-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index a6efdab56b49f041ca9c53cbf49dead9c2f7a65b..4b109cef0282a709d44e7c69abae4e9b0482bb81 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -859,7 +859,11 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
// 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());
+ // No need to flush the icache since the pre_monomorphic_stub will be the
+ // same code as the initialize_stub - it is just used as a marker to
+ // identify when we should move to monomorphic, and will be correctly read
+ // via raw_target() even if the wrong stub was called.
+ set_target(*pre_monomorphic_stub(), SKIP_ICACHE_FLUSH_IF_ATOMIC);
TRACE_IC("LoadIC", name);
return;
}
@@ -1309,7 +1313,11 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object,
if (FLAG_use_ic) {
if (state() == UNINITIALIZED) {
Handle<Code> stub = pre_monomorphic_stub();
- set_target(*stub);
+ // No need to flush the icache since the pre_monomorphic_stub will be the
+ // same code as the initialize_stub - it is just used as a marker to
+ // identify when we should move to monomorphic, and will be correctly read
+ // via raw_target() even if the wrong stub was called.
+ set_target(*stub, SKIP_ICACHE_FLUSH_IF_ATOMIC);
TRACE_IC("StoreIC", name);
} else if (can_store) {
UpdateCaches(&lookup, receiver, name, value);
« src/arm/assembler-arm-inl.h ('K') | « src/ic.h ('k') | src/ic-inl.h » ('j') | no next file with comments »

Powered by Google App Engine