}
+bool StackGuard::IsDeoptMarkedCode() {
+ ExecutionAccess access(isolate_);
+ return (thread_local_.interrupt_flags_ & DEOPT_MARKED_CODE) != 0;
+}
+
+
+void StackGuard::DeoptMarkedCode() {
+ ExecutionAccess access(isolate_);
+ thread_local_.interrupt_flags_ |= DEOPT_MARKED_CODE;
+ set_interrupt_limits(access);
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access(isolate_);
stack_guard->Continue(FULL_DEOPT);
Deoptimizer::DeoptimizeAll(isolate);
}
+ if (stack_guard->IsDeoptMarkedCode()) {
+ stack_guard->Continue(DEOPT_MARKED_CODE);
+ Deoptimizer::DeoptimizeMarkedCode(isolate);
+ }
if (stack_guard->IsInstallCodeRequest()) {
ASSERT(isolate->concurrent_recompilation_enabled());
stack_guard->Continue(INSTALL_CODE);
GC_REQUEST = 1 << 5,
FULL_DEOPT = 1 << 6,
INSTALL_CODE = 1 << 7,
- API_INTERRUPT = 1 << 8
+ API_INTERRUPT = 1 << 8,
+ DEOPT_MARKED_CODE = 1 << 9
};
void RequestInstallCode();
bool IsFullDeopt();
void FullDeopt();
+ bool IsDeoptMarkedCode();
+ void DeoptMarkedCode();
void Continue(InterruptFlag after_what);
void RequestInterrupt(InterruptCallback callback, void* data);
int i = 0;
Object* list_element = allocation_sites_list();
+ bool trigger_deoptimization = false;
while (use_scratchpad ?
i < allocation_sites_scratchpad_length :
list_element->IsAllocationSite()) {
if (site->memento_found_count() > 0) {
active_allocation_sites++;
}
- if (site->DigestPretenuringFeedback()) {
- if (site->GetPretenureMode() == TENURED) {
- tenure_decisions++;
- } else {
- dont_tenure_decisions++;
- }
+ if (site->DigestPretenuringFeedback()) trigger_deoptimization = true;
+ if (site->GetPretenureMode() == TENURED) {
+ tenure_decisions++;
+ } else {
+ dont_tenure_decisions++;
}
allocation_sites++;
if (use_scratchpad) {
list_element = site->weak_next();
}
}
+
+ if (trigger_deoptimization) isolate_->stack_guard()->DeoptMarkedCode();
+
allocation_sites_scratchpad_length = 0;
// TODO(mvstanton): Pretenure decisions are only made once for an allocation
}
cur = casted->weak_next();
}
- if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate_);
+ if (marked) isolate_->stack_guard()->DeoptMarkedCode();
}
inline bool AllocationSite::DigestPretenuringFeedback() {
- bool decision_made = false;
+ bool decision_changed = false;
int create_count = memento_create_count();
if (create_count >= kPretenureMinimumCreated) {
int found_count = memento_found_count();
? kTenure
: kDontTenure;
set_pretenure_decision(result);
- decision_made = true;
if (current_mode != GetPretenureMode()) {
- dependent_code()->DeoptimizeDependentCodeGroup(
+ decision_changed = true;
+ dependent_code()->MarkCodeForDeoptimization(
GetIsolate(),
DependentCode::kAllocationSiteTenuringChangedGroup);
}
// Clear feedback calculation fields until the next gc.
set_memento_found_count(0);
set_memento_create_count(0);
- return decision_made;
+ return decision_changed;
}