Commit 2619f59c authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[SFI] Free up unused IsDeserializedBit from SFI::flags.

BUG=v8:8395,v8:8510

Change-Id: I1571877d709d6cc37966ace9014fa327e0820a80
Reviewed-on: https://chromium-review.googlesource.com/c/1417634
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58919}
parent 0013fff6
......@@ -22,7 +22,6 @@ void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) {
isolate_->heap()->SetStackLimits();
}
void StackGuard::reset_limits(const ExecutionAccess& lock) {
DCHECK_NOT_NULL(isolate_);
thread_local_.set_jslimit(thread_local_.real_jslimit_);
......@@ -30,23 +29,6 @@ void StackGuard::reset_limits(const ExecutionAccess& lock) {
isolate_->heap()->SetStackLimits();
}
static void PrintDeserializedCodeInfo(Handle<JSFunction> function) {
if (function->code() == function->shared()->GetCode() &&
function->shared()->deserialized()) {
PrintF("[Running deserialized script");
Object script = function->shared()->script();
if (script->IsScript()) {
Object name = Script::cast(script)->name();
if (name->IsString()) {
PrintF(": %s", String::cast(name)->ToCString().get());
}
}
PrintF("]\n");
}
}
namespace {
Handle<Object> NormalizeReceiver(Isolate* isolate, Handle<Object> receiver) {
......@@ -280,9 +262,6 @@ V8_WARN_UNUSED_RESULT MaybeHandle<Object> Invoke(Isolate* isolate,
Address func = params.target->ptr();
Address recv = params.receiver->ptr();
Address** argv = reinterpret_cast<Address**>(params.argv);
if (FLAG_profile_deserialization && params.target->IsJSFunction()) {
PrintDeserializedCodeInfo(Handle<JSFunction>::cast(params.target));
}
RuntimeCallTimerScope timer(isolate, RuntimeCallCounterId::kJS_Execution);
value = Object(stub_entry.Call(isolate->isolate_data()->isolate_root(),
orig_func, func, recv, params.argc, argv));
......
......@@ -215,8 +215,6 @@ BIT_FIELD_ACCESSORS(SharedFunctionInfo, flags, name_should_print_as_anonymous,
SharedFunctionInfo::NameShouldPrintAsAnonymousBit)
BIT_FIELD_ACCESSORS(SharedFunctionInfo, flags, is_anonymous_expression,
SharedFunctionInfo::IsAnonymousExpressionBit)
BIT_FIELD_ACCESSORS(SharedFunctionInfo, flags, deserialized,
SharedFunctionInfo::IsDeserializedBit)
BIT_FIELD_ACCESSORS(SharedFunctionInfo, flags, has_reported_binary_coverage,
SharedFunctionInfo::HasReportedBinaryCoverageBit)
......
......@@ -488,9 +488,6 @@ class SharedFunctionInfo : public HeapObject {
// which does not change this flag).
DECL_BOOLEAN_ACCESSORS(is_anonymous_expression)
// Indicates that the the shared function info is deserialized from cache.
DECL_BOOLEAN_ACCESSORS(deserialized)
// Indicates that the function has been reported for binary code coverage.
DECL_BOOLEAN_ACCESSORS(has_reported_binary_coverage)
......@@ -696,7 +693,6 @@ class SharedFunctionInfo : public HeapObject {
V(ConstructAsBuiltinBit, bool, 1, _) \
V(IsAnonymousExpressionBit, bool, 1, _) \
V(NameShouldPrintAsAnonymousBit, bool, 1, _) \
V(IsDeserializedBit, bool, 1, _) \
V(HasReportedBinaryCoverageBit, bool, 1, _) \
V(IsNamedExpressionBit, bool, 1, _) \
V(IsTopLevelBit, bool, 1, _)
......
......@@ -195,11 +195,7 @@ void CodeSerializer::SerializeObject(HeapObject obj, HowToCode how_to_code,
}
DCHECK(!sfi->HasDebugInfo());
// Mark SFI to indicate whether the code is cached.
bool was_deserialized = sfi->deserialized();
sfi->set_deserialized(sfi->is_compiled());
SerializeGeneric(obj, how_to_code, where_to_point);
sfi->set_deserialized(was_deserialized);
// Restore debug info
if (!debug_info.is_null()) {
......
......@@ -2287,16 +2287,6 @@ v8::ScriptCompiler::CachedData* CompileRunAndProduceCache(
return cache;
}
void CheckDeserializedFlag(v8::Local<v8::UnboundScript> script) {
i::Handle<i::SharedFunctionInfo> sfi = v8::Utils::OpenHandle(*script);
i::SharedFunctionInfo::ScriptIterator iterator(sfi->GetIsolate(),
Script::cast(sfi->script()));
for (SharedFunctionInfo next = iterator.Next(); !next.is_null();
next = iterator.Next()) {
CHECK_EQ(next->is_compiled(), next->deserialized());
}
}
TEST(CodeSerializerIsolates) {
const char* source = "function f() { return 'abc'; }; f() + 'def'";
v8::ScriptCompiler::CachedData* cache = CompileRunAndProduceCache(source);
......@@ -2324,7 +2314,6 @@ TEST(CodeSerializerIsolates) {
.ToLocalChecked();
}
CHECK(!cache->rejected);
CheckDeserializedFlag(script);
v8::Local<v8::Value> result = script->BindToCurrentContext()
->Run(isolate2->GetCurrentContext())
.ToLocalChecked();
......@@ -2371,7 +2360,6 @@ TEST(CodeSerializerIsolatesEager) {
.ToLocalChecked();
}
CHECK(!cache->rejected);
CheckDeserializedFlag(script);
v8::Local<v8::Value> result = script->BindToCurrentContext()
->Run(isolate2->GetCurrentContext())
.ToLocalChecked();
......@@ -2415,7 +2403,6 @@ TEST(CodeSerializerAfterExecute) {
.ToLocalChecked();
}
CHECK(!cache->rejected);
CheckDeserializedFlag(script);
Handle<SharedFunctionInfo> sfi = v8::Utils::OpenHandle(*script);
CHECK(sfi->HasBytecodeArray());
......@@ -2557,7 +2544,6 @@ TEST(CodeSerializerWithHarmonyScoping) {
isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache)
.ToLocalChecked();
}
CheckDeserializedFlag(script);
v8::Local<v8::Value> result = script->BindToCurrentContext()
->Run(isolate2->GetCurrentContext())
.ToLocalChecked();
......
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