Remove deprecated ShouldSelfOptimize machinery.
R=titzer@chromium.org Review URL: https://codereview.chromium.org/582683002 Cr-Commit-Position: refs/heads/master@{#25459}
This commit is contained in:
parent
5d65e1374f
commit
9da92c1a33
@ -424,14 +424,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ b(pl, &ok);
|
||||
|
@ -413,14 +413,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
DCHECK(x0.Is(result_register()));
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2;
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2;
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ B(pl, &ok);
|
||||
|
@ -45,7 +45,6 @@ class AstNumberingVisitor FINAL : public AstVisitor {
|
||||
void IncrementNodeCount() { properties_.add_node_count(1); }
|
||||
void DisableCrankshaft(BailoutReason reason) {
|
||||
dont_crankshaft_reason_ = reason;
|
||||
properties_.flags()->Add(kDontSelfOptimize);
|
||||
}
|
||||
// TODO(turbofan): Remove the dont_turbofan_reason once no nodes are
|
||||
// DontTurbofanNode. That set of nodes must be kept in sync with
|
||||
@ -53,14 +52,9 @@ class AstNumberingVisitor FINAL : public AstVisitor {
|
||||
void DisableTurbofan(BailoutReason reason) {
|
||||
dont_crankshaft_reason_ = reason;
|
||||
dont_turbofan_reason_ = reason;
|
||||
DisableSelfOptimization();
|
||||
}
|
||||
void DisableSelfOptimization() {
|
||||
properties_.flags()->Add(kDontSelfOptimize);
|
||||
}
|
||||
void DisableCaching(BailoutReason reason) {
|
||||
dont_crankshaft_reason_ = reason;
|
||||
DisableSelfOptimization();
|
||||
properties_.flags()->Add(kDontCache);
|
||||
}
|
||||
|
||||
@ -303,7 +297,6 @@ void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
|
||||
|
||||
void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
|
||||
IncrementNodeCount();
|
||||
DisableSelfOptimization();
|
||||
node->set_base_id(ReserveIdRange(DoWhileStatement::num_ids()));
|
||||
Visit(node->body());
|
||||
Visit(node->cond());
|
||||
@ -312,7 +305,6 @@ void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
|
||||
|
||||
void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
|
||||
IncrementNodeCount();
|
||||
DisableSelfOptimization();
|
||||
node->set_base_id(ReserveIdRange(WhileStatement::num_ids()));
|
||||
Visit(node->cond());
|
||||
Visit(node->body());
|
||||
@ -371,7 +363,6 @@ void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) {
|
||||
|
||||
void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
|
||||
IncrementNodeCount();
|
||||
DisableSelfOptimization();
|
||||
ReserveFeedbackSlots(node);
|
||||
node->set_base_id(ReserveIdRange(ForInStatement::num_ids()));
|
||||
Visit(node->each());
|
||||
@ -433,7 +424,6 @@ void AstNumberingVisitor::VisitCaseClause(CaseClause* node) {
|
||||
|
||||
void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
|
||||
IncrementNodeCount();
|
||||
DisableSelfOptimization();
|
||||
node->set_base_id(ReserveIdRange(ForStatement::num_ids()));
|
||||
if (node->init() != NULL) Visit(node->init());
|
||||
if (node->cond() != NULL) Visit(node->cond());
|
||||
|
@ -150,7 +150,6 @@ typedef ZoneList<Handle<Object> > ZoneObjectList;
|
||||
|
||||
|
||||
enum AstPropertiesFlag {
|
||||
kDontSelfOptimize,
|
||||
kDontSoftInline,
|
||||
kDontCache
|
||||
};
|
||||
|
@ -276,18 +276,6 @@ Code::Flags CompilationInfo::flags() const {
|
||||
}
|
||||
|
||||
|
||||
// Primitive functions are unlikely to be picked up by the stack-walking
|
||||
// profiler, so they trigger their own optimization when they're called
|
||||
// for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
|
||||
bool CompilationInfo::ShouldSelfOptimize() {
|
||||
return FLAG_crankshaft &&
|
||||
!function()->flags()->Contains(kDontSelfOptimize) &&
|
||||
!function()->dont_optimize() &&
|
||||
function()->scope()->AllowsLazyCompilation() &&
|
||||
(shared_info().is_null() || !shared_info()->optimization_disabled());
|
||||
}
|
||||
|
||||
|
||||
void CompilationInfo::PrepareForCompilation(Scope* scope) {
|
||||
DCHECK(scope_ == NULL);
|
||||
scope_ = scope;
|
||||
|
@ -301,9 +301,6 @@ class CompilationInfo {
|
||||
SetFlag(kDeoptimizationSupport);
|
||||
}
|
||||
|
||||
// Determines whether or not to insert a self-optimization header.
|
||||
bool ShouldSelfOptimize();
|
||||
|
||||
void set_deferred_handles(DeferredHandles* deferred_handles) {
|
||||
DCHECK(deferred_handles_ == NULL);
|
||||
deferred_handles_ = deferred_handles;
|
||||
|
@ -401,7 +401,6 @@ DEFINE_INT(type_info_threshold, 25,
|
||||
"percentage of ICs that must have type info to allow optimization")
|
||||
DEFINE_INT(generic_ic_threshold, 30,
|
||||
"max percentage of megamorphic/generic ICs to allow optimization")
|
||||
DEFINE_INT(self_opt_count, 130, "call count before self-optimization")
|
||||
|
||||
DEFINE_BOOL(trace_opt_verbose, false, "extra verbose compilation tracing")
|
||||
DEFINE_IMPLICATION(trace_opt_verbose, trace_opt)
|
||||
|
@ -383,14 +383,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ j(positive, &ok, Label::kNear);
|
||||
|
@ -411,14 +411,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ Branch(&ok, ge, a3, Operand(zero_reg));
|
||||
|
@ -407,14 +407,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ Branch(&ok, ge, a3, Operand(zero_reg));
|
||||
|
@ -386,14 +386,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ j(positive, &ok, Label::kNear);
|
||||
|
@ -380,14 +380,9 @@ void FullCodeGenerator::EmitReturnSequence() {
|
||||
__ CallRuntime(Runtime::kTraceExit, 1);
|
||||
}
|
||||
// Pretend that the exit is a backwards jump to the entry.
|
||||
int weight = 1;
|
||||
if (info_->ShouldSelfOptimize()) {
|
||||
weight = FLAG_interrupt_budget / FLAG_self_opt_count;
|
||||
} else {
|
||||
int distance = masm_->pc_offset();
|
||||
weight = Min(kMaxBackEdgeWeight,
|
||||
Max(1, distance / kCodeSizeMultiplier));
|
||||
}
|
||||
int distance = masm_->pc_offset();
|
||||
int weight =
|
||||
Min(kMaxBackEdgeWeight, Max(1, distance / kCodeSizeMultiplier));
|
||||
EmitProfilingCounterDecrement(weight);
|
||||
Label ok;
|
||||
__ j(positive, &ok, Label::kNear);
|
||||
|
Loading…
Reference in New Issue
Block a user