Commit b8a77348 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Age ICs on context dispose notification.

R=ulan@chromium.org
BUG=309723

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cec8548d
...@@ -1240,8 +1240,6 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() { ...@@ -1240,8 +1240,6 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
Add<HStoreNamedField>(js_function, Add<HStoreNamedField>(js_function,
HObjectAccess::ForSharedFunctionInfoPointer(), HObjectAccess::ForSharedFunctionInfoPointer(),
shared_info); shared_info);
Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
shared_info);
Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(), Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
context()); context());
......
...@@ -262,8 +262,11 @@ static bool AlwaysFullCompiler(Isolate* isolate) { ...@@ -262,8 +262,11 @@ static bool AlwaysFullCompiler(Isolate* isolate) {
void RecompileJob::RecordOptimizationStats() { void RecompileJob::RecordOptimizationStats() {
Handle<JSFunction> function = info()->closure(); Handle<JSFunction> function = info()->closure();
if (!function->IsOptimized()) {
// Concurrent recompilation and OSR may race. Increment only once.
int opt_count = function->shared()->opt_count(); int opt_count = function->shared()->opt_count();
function->shared()->set_opt_count(opt_count + 1); function->shared()->set_opt_count(opt_count + 1);
}
double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF(); double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF();
double ms_optimize = time_taken_to_optimize_.InMillisecondsF(); double ms_optimize = time_taken_to_optimize_.InMillisecondsF();
double ms_codegen = time_taken_to_codegen_.InMillisecondsF(); double ms_codegen = time_taken_to_codegen_.InMillisecondsF();
......
...@@ -767,6 +767,7 @@ int Heap::NotifyContextDisposed() { ...@@ -767,6 +767,7 @@ int Heap::NotifyContextDisposed() {
isolate()->optimizing_compiler_thread()->Flush(); isolate()->optimizing_compiler_thread()->Flush();
} }
flush_monomorphic_ics_ = true; flush_monomorphic_ics_ = true;
AgeInlineCaches();
return ++contexts_disposed_; return ++contexts_disposed_;
} }
...@@ -1164,8 +1165,6 @@ void Heap::MarkCompact(GCTracer* tracer) { ...@@ -1164,8 +1165,6 @@ void Heap::MarkCompact(GCTracer* tracer) {
isolate_->counters()->objs_since_last_full()->Set(0); isolate_->counters()->objs_since_last_full()->Set(0);
contexts_disposed_ = 0;
flush_monomorphic_ics_ = false; flush_monomorphic_ics_ = false;
} }
...@@ -5742,12 +5741,7 @@ bool Heap::IdleNotification(int hint) { ...@@ -5742,12 +5741,7 @@ bool Heap::IdleNotification(int hint) {
size_factor * IncrementalMarking::kAllocatedThreshold; size_factor * IncrementalMarking::kAllocatedThreshold;
if (contexts_disposed_ > 0) { if (contexts_disposed_ > 0) {
if (hint >= kMaxHint) { contexts_disposed_ = 0;
// The embedder is requesting a lot of GC work after context disposal,
// we age inline caches so that they don't keep objects from
// the old context alive.
AgeInlineCaches();
}
int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000);
if (hint >= mark_sweep_time && !FLAG_expose_gc && if (hint >= mark_sweep_time && !FLAG_expose_gc &&
incremental_marking()->IsStopped()) { incremental_marking()->IsStopped()) {
...@@ -5756,8 +5750,8 @@ bool Heap::IdleNotification(int hint) { ...@@ -5756,8 +5750,8 @@ bool Heap::IdleNotification(int hint) {
"idle notification: contexts disposed"); "idle notification: contexts disposed");
} else { } else {
AdvanceIdleIncrementalMarking(step_size); AdvanceIdleIncrementalMarking(step_size);
contexts_disposed_ = 0;
} }
// After context disposal there is likely a lot of garbage remaining, reset // After context disposal there is likely a lot of garbage remaining, reset
// the idle notification counters in order to trigger more incremental GCs // the idle notification counters in order to trigger more incremental GCs
// on subsequent idle notifications. // on subsequent idle notifications.
......
...@@ -9588,7 +9588,7 @@ MaybeObject* SharedFunctionInfo::AddToOptimizedCodeMap(Context* native_context, ...@@ -9588,7 +9588,7 @@ MaybeObject* SharedFunctionInfo::AddToOptimizedCodeMap(Context* native_context,
if (value->IsSmi()) { if (value->IsSmi()) {
// No optimized code map. // No optimized code map.
ASSERT_EQ(0, Smi::cast(value)->value()); ASSERT_EQ(0, Smi::cast(value)->value());
// Crate 3 entries per context {context, code, literals}. // Create 3 entries per context {context, code, literals}.
MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength); MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength);
if (!maybe->To(&new_code_map)) return maybe; if (!maybe->To(&new_code_map)) return maybe;
new_code_map->set(kEntriesStart + 0, native_context); new_code_map->set(kEntriesStart + 0, native_context);
......
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