Clear optimized code map during incremental marking.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/11458011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent da3e153e
......@@ -4279,11 +4279,10 @@ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache)
void SharedFunctionInfo::BeforeVisitingPointers() {
if (IsInobjectSlackTrackingInProgress()) DetachInitialMap();
}
// Flush optimized code map on major GC.
// Note: we may experiment with rebuilding it or retaining entries
// which should survive as we iterate through optimized functions
// anyway.
void SharedFunctionInfo::ClearOptimizedCodeMap() {
set_optimized_code_map(Smi::FromInt(0));
}
......
......@@ -299,6 +299,13 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
if (shared->ic_age() != heap->global_ic_age()) {
shared->ResetForNewContext(heap->global_ic_age());
}
if (FLAG_cache_optimized_code) {
// Flush optimized code map on major GC.
// TODO(mstarzinger): We may experiment with rebuilding it or with
// retaining entries which should survive as we iterate through
// optimized functions anyway.
shared->ClearOptimizedCodeMap();
}
MarkCompactCollector* collector = heap->mark_compact_collector();
if (collector->is_code_flushing_enabled()) {
if (IsFlushable(heap, shared)) {
......
......@@ -8066,11 +8066,6 @@ bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared,
}
void SharedFunctionInfo::ClearOptimizedCodeMap() {
set_optimized_code_map(Smi::FromInt(0));
}
void SharedFunctionInfo::AddToOptimizedCodeMap(
Handle<SharedFunctionInfo> shared,
Handle<Context> native_context,
......
......@@ -5444,7 +5444,7 @@ class SharedFunctionInfo: public HeapObject {
void InstallFromOptimizedCodeMap(JSFunction* function, int index);
// Clear optimized code map.
void ClearOptimizedCodeMap();
inline void ClearOptimizedCodeMap();
// Add a new entry to the optimized code map.
static void AddToOptimizedCodeMap(Handle<SharedFunctionInfo> shared,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment