Remove obsolete JSFunction::IsOptimizable predicate.
This just delegates to SharedFunctionInfo::optimization_disabled and
was primarily used for assertions. Removing it due to misleading name
because already optimized functions reported being "non-optimizable".
This relands commit 181d7b8597
.
R=titzer@chromium.org
Review URL: https://codereview.chromium.org/1146423002
Cr-Commit-Position: refs/heads/master@{#28577}
This commit is contained in:
parent
3ce81e193d
commit
eb055cb3c4
@ -6022,11 +6022,6 @@ bool JSFunction::IsOptimized() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool JSFunction::IsOptimizable() {
|
|
||||||
return code()->kind() == Code::FUNCTION && !shared()->optimization_disabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool JSFunction::IsMarkedForOptimization() {
|
bool JSFunction::IsMarkedForOptimization() {
|
||||||
return code() == GetIsolate()->builtins()->builtin(
|
return code() == GetIsolate()->builtins()->builtin(
|
||||||
Builtins::kCompileOptimized);
|
Builtins::kCompileOptimized);
|
||||||
|
@ -9823,7 +9823,8 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
|
|||||||
void JSFunction::MarkForOptimization() {
|
void JSFunction::MarkForOptimization() {
|
||||||
Isolate* isolate = GetIsolate();
|
Isolate* isolate = GetIsolate();
|
||||||
DCHECK(!IsOptimized());
|
DCHECK(!IsOptimized());
|
||||||
DCHECK(shared()->allows_lazy_compilation() || IsOptimizable());
|
DCHECK(shared()->allows_lazy_compilation() ||
|
||||||
|
!shared()->optimization_disabled());
|
||||||
set_code_no_write_barrier(
|
set_code_no_write_barrier(
|
||||||
isolate->builtins()->builtin(Builtins::kCompileOptimized));
|
isolate->builtins()->builtin(Builtins::kCompileOptimized));
|
||||||
// No write barrier required, since the builtin is part of the root set.
|
// No write barrier required, since the builtin is part of the root set.
|
||||||
@ -9847,7 +9848,8 @@ void JSFunction::AttemptConcurrentOptimization() {
|
|||||||
}
|
}
|
||||||
DCHECK(!IsInOptimizationQueue());
|
DCHECK(!IsInOptimizationQueue());
|
||||||
DCHECK(!IsOptimized());
|
DCHECK(!IsOptimized());
|
||||||
DCHECK(shared()->allows_lazy_compilation() || IsOptimizable());
|
DCHECK(shared()->allows_lazy_compilation() ||
|
||||||
|
!shared()->optimization_disabled());
|
||||||
DCHECK(isolate->concurrent_recompilation_enabled());
|
DCHECK(isolate->concurrent_recompilation_enabled());
|
||||||
if (FLAG_trace_concurrent_recompilation) {
|
if (FLAG_trace_concurrent_recompilation) {
|
||||||
PrintF(" ** Marking ");
|
PrintF(" ** Marking ");
|
||||||
@ -9855,7 +9857,7 @@ void JSFunction::AttemptConcurrentOptimization() {
|
|||||||
PrintF(" for concurrent recompilation.\n");
|
PrintF(" for concurrent recompilation.\n");
|
||||||
}
|
}
|
||||||
set_code_no_write_barrier(
|
set_code_no_write_barrier(
|
||||||
GetIsolate()->builtins()->builtin(Builtins::kCompileOptimizedConcurrent));
|
isolate->builtins()->builtin(Builtins::kCompileOptimizedConcurrent));
|
||||||
// No write barrier required, since the builtin is part of the root set.
|
// No write barrier required, since the builtin is part of the root set.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7612,9 +7612,6 @@ class JSFunction: public JSObject {
|
|||||||
// Tells whether or not this function has been optimized.
|
// Tells whether or not this function has been optimized.
|
||||||
inline bool IsOptimized();
|
inline bool IsOptimized();
|
||||||
|
|
||||||
// Tells whether or not this function can be optimized.
|
|
||||||
inline bool IsOptimizable();
|
|
||||||
|
|
||||||
// Mark this function for lazy recompilation. The function will be
|
// Mark this function for lazy recompilation. The function will be
|
||||||
// recompiled the next time it is executed.
|
// recompiled the next time it is executed.
|
||||||
void MarkForOptimization();
|
void MarkForOptimization();
|
||||||
|
@ -88,8 +88,6 @@ static void GetICCounts(SharedFunctionInfo* shared,
|
|||||||
|
|
||||||
|
|
||||||
void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
|
void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
|
||||||
DCHECK(function->IsOptimizable());
|
|
||||||
|
|
||||||
if (FLAG_trace_opt && function->PassesFilter(FLAG_hydrogen_filter)) {
|
if (FLAG_trace_opt && function->PassesFilter(FLAG_hydrogen_filter)) {
|
||||||
PrintF("[marking ");
|
PrintF("[marking ");
|
||||||
function->ShortPrint();
|
function->ShortPrint();
|
||||||
@ -217,7 +215,7 @@ void RuntimeProfiler::OptimizeNow() {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!function->IsOptimizable()) continue;
|
if (function->IsOptimized()) continue;
|
||||||
|
|
||||||
int ticks = shared_code->profiler_ticks();
|
int ticks = shared_code->profiler_ticks();
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
|
|||||||
// The following assertion was lifted from the DCHECK inside
|
// The following assertion was lifted from the DCHECK inside
|
||||||
// JSFunction::MarkForOptimization().
|
// JSFunction::MarkForOptimization().
|
||||||
RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() ||
|
RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() ||
|
||||||
function->IsOptimizable());
|
!function->shared()->optimization_disabled());
|
||||||
|
|
||||||
// If the function is already optimized, just return.
|
// If the function is already optimized, just return.
|
||||||
if (function->IsOptimized()) return isolate->heap()->undefined_value();
|
if (function->IsOptimized()) return isolate->heap()->undefined_value();
|
||||||
@ -132,7 +132,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
|
|||||||
// The following assertion was lifted from the DCHECK inside
|
// The following assertion was lifted from the DCHECK inside
|
||||||
// JSFunction::MarkForOptimization().
|
// JSFunction::MarkForOptimization().
|
||||||
RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() ||
|
RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() ||
|
||||||
function->IsOptimizable());
|
!function->shared()->optimization_disabled());
|
||||||
|
|
||||||
// If the function is already optimized, just return.
|
// If the function is already optimized, just return.
|
||||||
if (function->IsOptimized()) return isolate->heap()->undefined_value();
|
if (function->IsOptimized()) return isolate->heap()->undefined_value();
|
||||||
|
@ -395,10 +395,8 @@ TEST(OptimizedCodeSharing) {
|
|||||||
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1"))));
|
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1"))));
|
||||||
Handle<JSFunction> fun2 = v8::Utils::OpenHandle(
|
Handle<JSFunction> fun2 = v8::Utils::OpenHandle(
|
||||||
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2"))));
|
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2"))));
|
||||||
CHECK(fun1->IsOptimized()
|
CHECK(fun1->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
|
||||||
|| !CcTest::i_isolate()->use_crankshaft() || !fun1->IsOptimizable());
|
CHECK(fun2->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
|
||||||
CHECK(fun2->IsOptimized()
|
|
||||||
|| !CcTest::i_isolate()->use_crankshaft() || !fun2->IsOptimizable());
|
|
||||||
CHECK_EQ(fun1->code(), fun2->code());
|
CHECK_EQ(fun1->code(), fun2->code());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user