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
This commit is contained in:
parent
cec8548d0e
commit
b8a77348b2
@ -1240,8 +1240,6 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
|
||||
Add<HStoreNamedField>(js_function,
|
||||
HObjectAccess::ForSharedFunctionInfoPointer(),
|
||||
shared_info);
|
||||
Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
|
||||
shared_info);
|
||||
Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
|
||||
context());
|
||||
|
||||
|
@ -262,8 +262,11 @@ static bool AlwaysFullCompiler(Isolate* isolate) {
|
||||
|
||||
void RecompileJob::RecordOptimizationStats() {
|
||||
Handle<JSFunction> function = info()->closure();
|
||||
int opt_count = function->shared()->opt_count();
|
||||
function->shared()->set_opt_count(opt_count + 1);
|
||||
if (!function->IsOptimized()) {
|
||||
// Concurrent recompilation and OSR may race. Increment only once.
|
||||
int opt_count = function->shared()->opt_count();
|
||||
function->shared()->set_opt_count(opt_count + 1);
|
||||
}
|
||||
double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF();
|
||||
double ms_optimize = time_taken_to_optimize_.InMillisecondsF();
|
||||
double ms_codegen = time_taken_to_codegen_.InMillisecondsF();
|
||||
|
12
src/heap.cc
12
src/heap.cc
@ -767,6 +767,7 @@ int Heap::NotifyContextDisposed() {
|
||||
isolate()->optimizing_compiler_thread()->Flush();
|
||||
}
|
||||
flush_monomorphic_ics_ = true;
|
||||
AgeInlineCaches();
|
||||
return ++contexts_disposed_;
|
||||
}
|
||||
|
||||
@ -1164,8 +1165,6 @@ void Heap::MarkCompact(GCTracer* tracer) {
|
||||
|
||||
isolate_->counters()->objs_since_last_full()->Set(0);
|
||||
|
||||
contexts_disposed_ = 0;
|
||||
|
||||
flush_monomorphic_ics_ = false;
|
||||
}
|
||||
|
||||
@ -5742,12 +5741,7 @@ bool Heap::IdleNotification(int hint) {
|
||||
size_factor * IncrementalMarking::kAllocatedThreshold;
|
||||
|
||||
if (contexts_disposed_ > 0) {
|
||||
if (hint >= kMaxHint) {
|
||||
// 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();
|
||||
}
|
||||
contexts_disposed_ = 0;
|
||||
int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000);
|
||||
if (hint >= mark_sweep_time && !FLAG_expose_gc &&
|
||||
incremental_marking()->IsStopped()) {
|
||||
@ -5756,8 +5750,8 @@ bool Heap::IdleNotification(int hint) {
|
||||
"idle notification: contexts disposed");
|
||||
} else {
|
||||
AdvanceIdleIncrementalMarking(step_size);
|
||||
contexts_disposed_ = 0;
|
||||
}
|
||||
|
||||
// After context disposal there is likely a lot of garbage remaining, reset
|
||||
// the idle notification counters in order to trigger more incremental GCs
|
||||
// on subsequent idle notifications.
|
||||
|
@ -9588,7 +9588,7 @@ MaybeObject* SharedFunctionInfo::AddToOptimizedCodeMap(Context* native_context,
|
||||
if (value->IsSmi()) {
|
||||
// No optimized code map.
|
||||
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);
|
||||
if (!maybe->To(&new_code_map)) return maybe;
|
||||
new_code_map->set(kEntriesStart + 0, native_context);
|
||||
|
Loading…
Reference in New Issue
Block a user