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

Unified Diff: src/ic.h

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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/arm/assembler-arm-inl.h ('K') | « src/assembler.h ('k') | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index 197c32e6a55515c787628bab1ac5c91bc5df1cd1..5c497913395cf86ff67432f8496b0285eef179a9 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -160,11 +160,12 @@ class IC {
Code* GetOriginalCode() const;
// Set the call-site target.
- void set_target(Code* code) {
+ void set_target(Code* code,
+ ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) {
#ifdef VERIFY_HEAP
code->VerifyEmbeddedObjectsDependency();
#endif
- SetTargetAtAddress(address(), code, constant_pool());
+ SetTargetAtAddress(address(), code, constant_pool(), icache_flush_mode);
target_set_ = true;
}
@@ -186,7 +187,9 @@ class IC {
ConstantPoolArray* constant_pool);
static inline void SetTargetAtAddress(Address address,
Code* target,
- ConstantPoolArray* constant_pool);
+ ConstantPoolArray* constant_pool,
+ ICacheFlushMode icache_flush_mode =
+ FLUSH_ICACHE_IF_NEEDED);
static void PostPatching(Address address, Code* target, Code* old_target);
// Compute the handler either by compiling or by retrieving a cached version.
@@ -455,12 +458,13 @@ class LoadIC: public IC {
protected:
virtual Code::Kind kind() const { return Code::LOAD_IC; }
- void set_target(Code* code) {
+ void set_target(Code* code,
+ ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) {
// The contextual mode must be preserved across IC patching.
ASSERT(GetContextualMode(code->extra_ic_state()) ==
GetContextualMode(target()->extra_ic_state()));
- IC::set_target(code);
+ IC::set_target(code, icache_flush_mode);
}
virtual Handle<Code> slow_stub() const {
@@ -654,11 +658,12 @@ class StoreIC: public IC {
InlineCacheHolderFlag cache_holder);
private:
- void set_target(Code* code) {
+ void set_target(Code* code,
+ ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) {
// Strict mode must be preserved across IC patching.
ASSERT(GetStrictMode(code->extra_ic_state()) ==
GetStrictMode(target()->extra_ic_state()));
- IC::set_target(code);
+ IC::set_target(code, icache_flush_mode);
}
static void Clear(Isolate* isolate,
« src/arm/assembler-arm-inl.h ('K') | « src/assembler.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698