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

Side by Side Diff: src/ic-inl.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_IC_INL_H_ 5 #ifndef V8_IC_INL_H_
6 #define V8_IC_INL_H_ 6 #define V8_IC_INL_H_
7 7
8 #include "ic.h" 8 #include "ic.h"
9 9
10 #include "compiler.h" 10 #include "compiler.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Convert target address to the code object. Code::GetCodeFromTargetAddress 87 // Convert target address to the code object. Code::GetCodeFromTargetAddress
88 // is safe for use during GC where the map might be marked. 88 // is safe for use during GC where the map might be marked.
89 Code* result = Code::GetCodeFromTargetAddress(target); 89 Code* result = Code::GetCodeFromTargetAddress(target);
90 ASSERT(result->is_inline_cache_stub()); 90 ASSERT(result->is_inline_cache_stub());
91 return result; 91 return result;
92 } 92 }
93 93
94 94
95 void IC::SetTargetAtAddress(Address address, 95 void IC::SetTargetAtAddress(Address address,
96 Code* target, 96 Code* target,
97 ConstantPoolArray* constant_pool) { 97 ConstantPoolArray* constant_pool,
98 ICacheFlushMode icache_flush_mode) {
98 ASSERT(target->is_inline_cache_stub() || target->is_compare_ic_stub()); 99 ASSERT(target->is_inline_cache_stub() || target->is_compare_ic_stub());
99 Heap* heap = target->GetHeap(); 100 Heap* heap = target->GetHeap();
100 Code* old_target = GetTargetAtAddress(address, constant_pool); 101 Code* old_target = GetTargetAtAddress(address, constant_pool);
101 #ifdef DEBUG 102 #ifdef DEBUG
102 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark 103 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark
103 // ICs as strict mode. The strict-ness of the IC must be preserved. 104 // ICs as strict mode. The strict-ness of the IC must be preserved.
104 if (old_target->kind() == Code::STORE_IC || 105 if (old_target->kind() == Code::STORE_IC ||
105 old_target->kind() == Code::KEYED_STORE_IC) { 106 old_target->kind() == Code::KEYED_STORE_IC) {
106 ASSERT(StoreIC::GetStrictMode(old_target->extra_ic_state()) == 107 ASSERT(StoreIC::GetStrictMode(old_target->extra_ic_state()) ==
107 StoreIC::GetStrictMode(target->extra_ic_state())); 108 StoreIC::GetStrictMode(target->extra_ic_state()));
108 } 109 }
109 #endif 110 #endif
110 Assembler::set_target_address_at( 111 Assembler::set_target_address_at(
111 address, constant_pool, target->instruction_start()); 112 address, constant_pool, target->instruction_start(), icache_flush_mode);
112 if (heap->gc_state() == Heap::MARK_COMPACT) { 113 if (heap->gc_state() == Heap::MARK_COMPACT) {
113 heap->mark_compact_collector()->RecordCodeTargetPatch(address, target); 114 heap->mark_compact_collector()->RecordCodeTargetPatch(address, target);
114 } else { 115 } else {
115 heap->incremental_marking()->RecordCodeTargetPatch(address, target); 116 heap->incremental_marking()->RecordCodeTargetPatch(address, target);
116 } 117 }
117 PostPatching(address, target, old_target); 118 PostPatching(address, target, old_target);
118 } 119 }
119 120
120 121
121 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object) { 122 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 168 }
168 return handle(JSObject::cast(constructor->instance_prototype())->map()); 169 return handle(JSObject::cast(constructor->instance_prototype())->map());
169 } 170 }
170 return TypeToMap(type, isolate); 171 return TypeToMap(type, isolate);
171 } 172 }
172 173
173 174
174 } } // namespace v8::internal 175 } } // namespace v8::internal
175 176
176 #endif // V8_IC_INL_H_ 177 #endif // V8_IC_INL_H_
OLDNEW
« src/arm/assembler-arm-inl.h ('K') | « src/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698