Commit 1df05d5d authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[snapshot] Use v8_flags for accessing flag values

Avoid the deprecated FLAG_* syntax, access flag values via the
{v8_flags} struct instead.

R=jgruber@chromium.org

Bug: v8:12887
Change-Id: Id293b260c1d84c2f9bd7f5c3c826f374ac6a68b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3875086
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82990}
parent ca2a9683
...@@ -57,9 +57,9 @@ ScriptCompiler::CachedData* CodeSerializer::Serialize( ...@@ -57,9 +57,9 @@ ScriptCompiler::CachedData* CodeSerializer::Serialize(
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileSerialize"); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileSerialize");
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
Handle<Script> script(Script::cast(info->script()), isolate); Handle<Script> script(Script::cast(info->script()), isolate);
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF("[Serializing from"); PrintF("[Serializing from");
script->name().ShortPrint(); script->name().ShortPrint();
PrintF("]\n"); PrintF("]\n");
...@@ -79,7 +79,7 @@ ScriptCompiler::CachedData* CodeSerializer::Serialize( ...@@ -79,7 +79,7 @@ ScriptCompiler::CachedData* CodeSerializer::Serialize(
cs.reference_map()->AddAttachedReference(*source); cs.reference_map()->AddAttachedReference(*source);
AlignedCachedData* cached_data = cs.SerializeSharedFunctionInfo(info); AlignedCachedData* cached_data = cs.SerializeSharedFunctionInfo(info);
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
int length = cached_data->length(); int length = cached_data->length();
PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms); PrintF("[Serializing to %d bytes took %0.3f ms]\n", length, ms);
...@@ -241,7 +241,7 @@ void CodeSerializer::SerializeObjectImpl(Handle<HeapObject> obj) { ...@@ -241,7 +241,7 @@ void CodeSerializer::SerializeObjectImpl(Handle<HeapObject> obj) {
// bytecode array stored within the InterpreterData, which is the important // bytecode array stored within the InterpreterData, which is the important
// information. On deserialization we'll create our code objects again, if // information. On deserialization we'll create our code objects again, if
// --interpreted-frames-native-stack is on. See v8:9122 for more context // --interpreted-frames-native-stack is on. See v8:9122 for more context
if (V8_UNLIKELY(FLAG_interpreted_frames_native_stack) && if (V8_UNLIKELY(v8_flags.interpreted_frames_native_stack) &&
obj->IsInterpreterData()) { obj->IsInterpreterData()) {
obj = handle(InterpreterData::cast(*obj).bytecode_array(), isolate()); obj = handle(InterpreterData::cast(*obj).bytecode_array(), isolate());
} }
...@@ -269,8 +269,8 @@ void CodeSerializer::SerializeGeneric(Handle<HeapObject> heap_object) { ...@@ -269,8 +269,8 @@ void CodeSerializer::SerializeGeneric(Handle<HeapObject> heap_object) {
namespace { namespace {
// NOTE(mmarchini): when FLAG_interpreted_frames_native_stack is on, we want to // NOTE(mmarchini): when v8_flags.interpreted_frames_native_stack is on, we want
// create duplicates of InterpreterEntryTrampoline for the deserialized // to create duplicates of InterpreterEntryTrampoline for the deserialized
// functions, otherwise we'll call the builtin IET for those functions (which // functions, otherwise we'll call the builtin IET for those functions (which
// is not what a user of this flag wants). // is not what a user of this flag wants).
void CreateInterpreterDataForDeserializedCode(Isolate* isolate, void CreateInterpreterDataForDeserializedCode(Isolate* isolate,
...@@ -355,21 +355,21 @@ void FinalizeDeserialization(Isolate* isolate, ...@@ -355,21 +355,21 @@ void FinalizeDeserialization(Isolate* isolate,
isolate->is_profiling() || isolate->is_profiling() ||
isolate->logger()->is_listening_to_code_events(); isolate->logger()->is_listening_to_code_events();
if (V8_UNLIKELY(FLAG_interpreted_frames_native_stack)) { if (V8_UNLIKELY(v8_flags.interpreted_frames_native_stack)) {
CreateInterpreterDataForDeserializedCode(isolate, result, CreateInterpreterDataForDeserializedCode(isolate, result,
log_code_creation); log_code_creation);
} }
bool needs_source_positions = isolate->NeedsSourcePositionsForProfiling(); bool needs_source_positions = isolate->NeedsSourcePositionsForProfiling();
if (log_code_creation || FLAG_log_function_events) { if (log_code_creation || v8_flags.log_function_events) {
Handle<Script> script(Script::cast(result->script()), isolate); Handle<Script> script(Script::cast(result->script()), isolate);
Handle<String> name(script->name().IsString() Handle<String> name(script->name().IsString()
? String::cast(script->name()) ? String::cast(script->name())
: ReadOnlyRoots(isolate).empty_string(), : ReadOnlyRoots(isolate).empty_string(),
isolate); isolate);
if (FLAG_log_function_events) { if (v8_flags.log_function_events) {
LOG(isolate, LOG(isolate,
FunctionEvent("deserialize", script->id(), FunctionEvent("deserialize", script->id(),
timer.Elapsed().InMillisecondsF(), timer.Elapsed().InMillisecondsF(),
...@@ -414,7 +414,7 @@ void BaselineBatchCompileIfSparkplugCompiled(Isolate* isolate, Script script) { ...@@ -414,7 +414,7 @@ void BaselineBatchCompileIfSparkplugCompiled(Isolate* isolate, Script script) {
// Here is main thread, we trigger early baseline compilation only in // Here is main thread, we trigger early baseline compilation only in
// concurrent sparkplug and baseline batch compilation mode which consumes // concurrent sparkplug and baseline batch compilation mode which consumes
// little main thread execution time. // little main thread execution time.
if (FLAG_concurrent_sparkplug && FLAG_baseline_batch_compilation) { if (v8_flags.concurrent_sparkplug && v8_flags.baseline_batch_compilation) {
SharedFunctionInfo::ScriptIterator iter(isolate, script); SharedFunctionInfo::ScriptIterator iter(isolate, script);
for (SharedFunctionInfo info = iter.Next(); !info.is_null(); for (SharedFunctionInfo info = iter.Next(); !info.is_null();
info = iter.Next()) { info = iter.Next()) {
...@@ -430,7 +430,7 @@ void BaselineBatchCompileIfSparkplugCompiled(Isolate* isolate, Script script) { ...@@ -430,7 +430,7 @@ void BaselineBatchCompileIfSparkplugCompiled(Isolate* isolate, Script script) {
MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
Isolate* isolate, AlignedCachedData* cached_data, Handle<String> source, Isolate* isolate, AlignedCachedData* cached_data, Handle<String> source,
ScriptOriginOptions origin_options) { ScriptOriginOptions origin_options) {
if (FLAG_stress_background_compile) { if (v8_flags.stress_background_compile) {
StressOffThreadDeserializeThread thread(isolate, cached_data); StressOffThreadDeserializeThread thread(isolate, cached_data);
CHECK(thread.Start()); CHECK(thread.Start());
thread.Join(); thread.Join();
...@@ -439,7 +439,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( ...@@ -439,7 +439,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
} }
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization || FLAG_log_function_events) timer.Start(); if (v8_flags.profile_deserialization || v8_flags.log_function_events)
timer.Start();
HandleScope scope(isolate); HandleScope scope(isolate);
...@@ -449,7 +450,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( ...@@ -449,7 +450,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
cached_data, SerializedCodeData::SourceHash(source, origin_options), cached_data, SerializedCodeData::SourceHash(source, origin_options),
&sanity_check_result); &sanity_check_result);
if (sanity_check_result != SerializedCodeSanityCheckResult::kSuccess) { if (sanity_check_result != SerializedCodeSanityCheckResult::kSuccess) {
if (FLAG_profile_deserialization) PrintF("[Cached code failed check]\n"); if (v8_flags.profile_deserialization)
PrintF("[Cached code failed check]\n");
DCHECK(cached_data->rejected()); DCHECK(cached_data->rejected());
isolate->counters()->code_cache_reject_reason()->AddSample( isolate->counters()->code_cache_reject_reason()->AddSample(
static_cast<int>(sanity_check_result)); static_cast<int>(sanity_check_result));
...@@ -463,12 +465,12 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize( ...@@ -463,12 +465,12 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
Handle<SharedFunctionInfo> result; Handle<SharedFunctionInfo> result;
if (!maybe_result.ToHandle(&result)) { if (!maybe_result.ToHandle(&result)) {
// Deserializing may fail if the reservations cannot be fulfilled. // Deserializing may fail if the reservations cannot be fulfilled.
if (FLAG_profile_deserialization) PrintF("[Deserializing failed]\n"); if (v8_flags.profile_deserialization) PrintF("[Deserializing failed]\n");
return MaybeHandle<SharedFunctionInfo>(); return MaybeHandle<SharedFunctionInfo>();
} }
BaselineBatchCompileIfSparkplugCompiled(isolate, BaselineBatchCompileIfSparkplugCompiled(isolate,
Script::cast(result->script())); Script::cast(result->script()));
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
int length = cached_data->length(); int length = cached_data->length();
PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms); PrintF("[Deserializing from %d bytes took %0.3f ms]\n", length, ms);
...@@ -532,7 +534,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize( ...@@ -532,7 +534,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize(
ScriptOriginOptions origin_options, ScriptOriginOptions origin_options,
BackgroundMergeTask* background_merge_task) { BackgroundMergeTask* background_merge_task) {
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization || FLAG_log_function_events) timer.Start(); if (v8_flags.profile_deserialization || v8_flags.log_function_events)
timer.Start();
HandleScope scope(isolate); HandleScope scope(isolate);
...@@ -557,7 +560,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize( ...@@ -557,7 +560,8 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize(
DCHECK_IMPLIES(sanity_check_result != data.sanity_check_result, DCHECK_IMPLIES(sanity_check_result != data.sanity_check_result,
sanity_check_result == sanity_check_result ==
SerializedCodeSanityCheckResult::kSourceMismatch); SerializedCodeSanityCheckResult::kSourceMismatch);
if (FLAG_profile_deserialization) PrintF("[Cached code failed check]\n"); if (v8_flags.profile_deserialization)
PrintF("[Cached code failed check]\n");
DCHECK(cached_data->rejected()); DCHECK(cached_data->rejected());
isolate->counters()->code_cache_reject_reason()->AddSample( isolate->counters()->code_cache_reject_reason()->AddSample(
static_cast<int>(sanity_check_result)); static_cast<int>(sanity_check_result));
...@@ -567,7 +571,7 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize( ...@@ -567,7 +571,7 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize(
Handle<SharedFunctionInfo> result; Handle<SharedFunctionInfo> result;
if (!data.maybe_result.ToHandle(&result)) { if (!data.maybe_result.ToHandle(&result)) {
// Deserializing may fail if the reservations cannot be fulfilled. // Deserializing may fail if the reservations cannot be fulfilled.
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
PrintF("[Off-thread deserializing failed]\n"); PrintF("[Off-thread deserializing failed]\n");
} }
return MaybeHandle<SharedFunctionInfo>(); return MaybeHandle<SharedFunctionInfo>();
...@@ -605,7 +609,7 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize( ...@@ -605,7 +609,7 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::FinishOffThreadDeserialize(
isolate->heap()->SetRootScriptList(*list); isolate->heap()->SetRootScriptList(*list);
} }
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
int length = cached_data->length(); int length = cached_data->length();
PrintF("[Finishing off-thread deserialize from %d bytes took %0.3f ms]\n", PrintF("[Finishing off-thread deserialize from %d bytes took %0.3f ms]\n",
...@@ -645,7 +649,7 @@ SerializedCodeData::SerializedCodeData(const std::vector<byte>* payload, ...@@ -645,7 +649,7 @@ SerializedCodeData::SerializedCodeData(const std::vector<byte>* payload,
CopyBytes(data_ + kHeaderSize, payload->data(), CopyBytes(data_ + kHeaderSize, payload->data(),
static_cast<size_t>(payload->size())); static_cast<size_t>(payload->size()));
uint32_t checksum = uint32_t checksum =
FLAG_verify_snapshot_checksum ? Checksum(ChecksummedContent()) : 0; v8_flags.verify_snapshot_checksum ? Checksum(ChecksummedContent()) : 0;
SetHeaderValue(kChecksumOffset, checksum); SetHeaderValue(kChecksumOffset, checksum);
} }
...@@ -687,7 +691,7 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckWithoutSource() ...@@ -687,7 +691,7 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckWithoutSource()
if (payload_length > max_payload_length) { if (payload_length > max_payload_length) {
return SerializedCodeSanityCheckResult::kLengthMismatch; return SerializedCodeSanityCheckResult::kLengthMismatch;
} }
if (FLAG_verify_snapshot_checksum) { if (v8_flags.verify_snapshot_checksum) {
uint32_t checksum = GetHeaderValue(kChecksumOffset); uint32_t checksum = GetHeaderValue(kChecksumOffset);
if (Checksum(ChecksummedContent()) != checksum) { if (Checksum(ChecksummedContent()) != checksum) {
return SerializedCodeSanityCheckResult::kChecksumMismatch; return SerializedCodeSanityCheckResult::kChecksumMismatch;
......
...@@ -216,7 +216,7 @@ bool ContextSerializer::ShouldBeInTheStartupObjectCache(HeapObject o) { ...@@ -216,7 +216,7 @@ bool ContextSerializer::ShouldBeInTheStartupObjectCache(HeapObject o) {
} }
bool ContextSerializer::ShouldBeInTheSharedObjectCache(HeapObject o) { bool ContextSerializer::ShouldBeInTheSharedObjectCache(HeapObject o) {
// FLAG_shared_string_table may be true during deserialization, so put // v8_flags.shared_string_table may be true during deserialization, so put
// internalized strings into the shared object snapshot. // internalized strings into the shared object snapshot.
return o.IsInternalizedString(); return o.IsInternalizedString();
} }
......
...@@ -196,7 +196,7 @@ Deserializer<IsolateT>::Deserializer(IsolateT* isolate, ...@@ -196,7 +196,7 @@ Deserializer<IsolateT>::Deserializer(IsolateT* isolate,
source_(payload), source_(payload),
magic_number_(magic_number), magic_number_(magic_number),
deserializing_user_code_(deserializing_user_code), deserializing_user_code_(deserializing_user_code),
should_rehash_((FLAG_rehash_snapshot && can_rehash) || should_rehash_((v8_flags.rehash_snapshot && can_rehash) ||
deserializing_user_code) { deserializing_user_code) {
DCHECK_NOT_NULL(isolate); DCHECK_NOT_NULL(isolate);
isolate->RegisterDeserializerStarted(); isolate->RegisterDeserializerStarted();
...@@ -261,10 +261,10 @@ void Deserializer<IsolateT>::DeserializeDeferredObjects() { ...@@ -261,10 +261,10 @@ void Deserializer<IsolateT>::DeserializeDeferredObjects() {
template <typename IsolateT> template <typename IsolateT>
void Deserializer<IsolateT>::LogNewMapEvents() { void Deserializer<IsolateT>::LogNewMapEvents() {
if (V8_LIKELY(!FLAG_log_maps)) return; if (V8_LIKELY(!v8_flags.log_maps)) return;
DisallowGarbageCollection no_gc; DisallowGarbageCollection no_gc;
for (Handle<Map> map : new_maps_) { for (Handle<Map> map : new_maps_) {
DCHECK(FLAG_log_maps); DCHECK(v8_flags.log_maps);
LOG(isolate(), MapCreate(*map)); LOG(isolate(), MapCreate(*map));
LOG(isolate(), MapDetails(*map)); LOG(isolate(), MapDetails(*map));
} }
...@@ -501,7 +501,7 @@ void Deserializer<IsolateT>::PostProcessNewObject(Handle<Map> map, ...@@ -501,7 +501,7 @@ void Deserializer<IsolateT>::PostProcessNewObject(Handle<Map> map,
} }
#endif #endif
} else if (InstanceTypeChecker::IsMap(instance_type)) { } else if (InstanceTypeChecker::IsMap(instance_type)) {
if (FLAG_log_maps) { if (v8_flags.log_maps) {
// Keep track of all seen Maps to log them later since they might be only // Keep track of all seen Maps to log them later since they might be only
// partially initialized at this point. // partially initialized at this point.
new_maps_.push_back(Handle<Map>::cast(obj)); new_maps_.push_back(Handle<Map>::cast(obj));
...@@ -597,7 +597,7 @@ Handle<HeapObject> Deserializer<IsolateT>::ReadObject(SnapshotSpace space) { ...@@ -597,7 +597,7 @@ Handle<HeapObject> Deserializer<IsolateT>::ReadObject(SnapshotSpace space) {
// strings internalized strings are allocated in the shared heap. // strings internalized strings are allocated in the shared heap.
// //
// TODO(12007): When shipping, add a new SharedOld SnapshotSpace. // TODO(12007): When shipping, add a new SharedOld SnapshotSpace.
if (FLAG_shared_string_table) { if (v8_flags.shared_string_table) {
InstanceType instance_type = map->instance_type(); InstanceType instance_type = map->instance_type();
if (InstanceTypeChecker::IsInternalizedString(instance_type) || if (InstanceTypeChecker::IsInternalizedString(instance_type) ||
String::IsInPlaceInternalizable(instance_type)) { String::IsInPlaceInternalizable(instance_type)) {
......
...@@ -149,7 +149,7 @@ void OffHeapInstructionStream::CreateOffHeapOffHeapInstructionStream( ...@@ -149,7 +149,7 @@ void OffHeapInstructionStream::CreateOffHeapOffHeapInstructionStream(
// in the binary) and what we are currently setting up here (where the blob is // in the binary) and what we are currently setting up here (where the blob is
// on the native heap). // on the native heap).
std::memcpy(allocated_code_bytes, d.code(), d.code_size()); std::memcpy(allocated_code_bytes, d.code(), d.code_size());
if (FLAG_experimental_flush_embedded_blob_icache) { if (v8_flags.experimental_flush_embedded_blob_icache) {
FlushInstructionCache(allocated_code_bytes, d.code_size()); FlushInstructionCache(allocated_code_bytes, d.code_size());
} }
CHECK(SetPermissions(page_allocator, allocated_code_bytes, CHECK(SetPermissions(page_allocator, allocated_code_bytes,
...@@ -440,11 +440,11 @@ EmbeddedData EmbeddedData::FromIsolate(Isolate* isolate) { ...@@ -440,11 +440,11 @@ EmbeddedData EmbeddedData::FromIsolate(Isolate* isolate) {
} }
} }
// Ensure that InterpreterEntryTrampolineForProfiling is relocatable. // Ensure that InterpreterEntryTrampolineForProfiling is relocatable.
// See FLAG_interpreted_frames_native_stack for details. // See v8_flags.interpreted_frames_native_stack for details.
EnsureRelocatable( EnsureRelocatable(
builtins->code(Builtin::kInterpreterEntryTrampolineForProfiling)); builtins->code(Builtin::kInterpreterEntryTrampolineForProfiling));
if (FLAG_serialization_statistics) d.PrintStatistics(); if (v8_flags.serialization_statistics) d.PrintStatistics();
return d; return d;
} }
...@@ -463,13 +463,13 @@ size_t EmbeddedData::CreateEmbeddedBlobDataHash() const { ...@@ -463,13 +463,13 @@ size_t EmbeddedData::CreateEmbeddedBlobDataHash() const {
} }
size_t EmbeddedData::CreateEmbeddedBlobCodeHash() const { size_t EmbeddedData::CreateEmbeddedBlobCodeHash() const {
CHECK(FLAG_text_is_readable); CHECK(v8_flags.text_is_readable);
base::Vector<const byte> payload(code_, code_size_); base::Vector<const byte> payload(code_, code_size_);
return Checksum(payload); return Checksum(payload);
} }
void EmbeddedData::PrintStatistics() const { void EmbeddedData::PrintStatistics() const {
DCHECK(FLAG_serialization_statistics); DCHECK(v8_flags.serialization_statistics);
constexpr int kCount = Builtins::kBuiltinCount; constexpr int kCount = Builtins::kBuiltinCount;
int sizes[kCount]; int sizes[kCount];
......
...@@ -161,7 +161,7 @@ v8::StartupData CreateSnapshotDataBlob(v8::Isolate* isolate, ...@@ -161,7 +161,7 @@ v8::StartupData CreateSnapshotDataBlob(v8::Isolate* isolate,
v8::SnapshotCreator::FunctionCodeHandling::kClear, embedded_source, v8::SnapshotCreator::FunctionCodeHandling::kClear, embedded_source,
isolate); isolate);
if (i::FLAG_profile_deserialization) { if (i::v8_flags.profile_deserialization) {
i::PrintF("[Creating snapshot took %0.3f ms]\n", i::PrintF("[Creating snapshot took %0.3f ms]\n",
timer.Elapsed().InMillisecondsF()); timer.Elapsed().InMillisecondsF());
} }
...@@ -178,7 +178,7 @@ v8::StartupData WarmUpSnapshotDataBlob(v8::StartupData cold_snapshot_blob, ...@@ -178,7 +178,7 @@ v8::StartupData WarmUpSnapshotDataBlob(v8::StartupData cold_snapshot_blob,
v8::StartupData result = v8::StartupData result =
i::WarmUpSnapshotDataBlobInternal(cold_snapshot_blob, warmup_source); i::WarmUpSnapshotDataBlobInternal(cold_snapshot_blob, warmup_source);
if (i::FLAG_profile_deserialization) { if (i::v8_flags.profile_deserialization) {
i::PrintF("Warming up snapshot took %0.3f ms\n", i::PrintF("Warming up snapshot took %0.3f ms\n",
timer.Elapsed().InMillisecondsF()); timer.Elapsed().InMillisecondsF());
} }
...@@ -204,7 +204,7 @@ void MaybeSetCounterFunction(v8::Isolate* isolate) { ...@@ -204,7 +204,7 @@ void MaybeSetCounterFunction(v8::Isolate* isolate) {
// distinguish between them. In theory it should be okay to just return an // distinguish between them. In theory it should be okay to just return an
// incremented int value each time this function is called, but we play it // incremented int value each time this function is called, but we play it
// safe and return a real distinct memory location tied to every counter name. // safe and return a real distinct memory location tied to every counter name.
if (i::FLAG_native_code_counters) { if (i::v8_flags.native_code_counters) {
counter_map_ = new CounterMap(); counter_map_ = new CounterMap();
isolate->SetCounterFunction([](const char* name) -> int* { isolate->SetCounterFunction([](const char* name) -> int* {
auto map_entry = counter_map_->find(name); auto map_entry = counter_map_->find(name);
...@@ -222,7 +222,7 @@ int main(int argc, char** argv) { ...@@ -222,7 +222,7 @@ int main(int argc, char** argv) {
v8::base::EnsureConsoleOutput(); v8::base::EnsureConsoleOutput();
// Make mksnapshot runs predictable to create reproducible snapshots. // Make mksnapshot runs predictable to create reproducible snapshots.
i::FLAG_predictable = true; i::v8_flags.predictable = true;
// Print the usage if an error occurs when parsing the command line // Print the usage if an error occurs when parsing the command line
// flags or if the help flag is set. // flags or if the help flag is set.
...@@ -247,14 +247,14 @@ int main(int argc, char** argv) { ...@@ -247,14 +247,14 @@ int main(int argc, char** argv) {
{ {
SnapshotFileWriter snapshot_writer; SnapshotFileWriter snapshot_writer;
snapshot_writer.SetSnapshotFile(i::FLAG_startup_src); snapshot_writer.SetSnapshotFile(i::v8_flags.startup_src);
snapshot_writer.SetStartupBlobFile(i::FLAG_startup_blob); snapshot_writer.SetStartupBlobFile(i::v8_flags.startup_blob);
i::EmbeddedFileWriter embedded_writer; i::EmbeddedFileWriter embedded_writer;
embedded_writer.SetEmbeddedFile(i::FLAG_embedded_src); embedded_writer.SetEmbeddedFile(i::v8_flags.embedded_src);
embedded_writer.SetEmbeddedVariant(i::FLAG_embedded_variant); embedded_writer.SetEmbeddedVariant(i::v8_flags.embedded_variant);
embedded_writer.SetTargetArch(i::FLAG_target_arch); embedded_writer.SetTargetArch(i::v8_flags.target_arch);
embedded_writer.SetTargetOs(i::FLAG_target_os); embedded_writer.SetTargetOs(i::v8_flags.target_os);
std::unique_ptr<char> embed_script( std::unique_ptr<char> embed_script(
GetExtraCode(argc >= 2 ? argv[1] : nullptr, "embedding")); GetExtraCode(argc >= 2 ? argv[1] : nullptr, "embedding"));
......
...@@ -43,7 +43,7 @@ Serializer::Serializer(Isolate* isolate, Snapshot::SerializerFlags flags) ...@@ -43,7 +43,7 @@ Serializer::Serializer(Isolate* isolate, Snapshot::SerializerFlags flags)
#endif #endif
{ {
#ifdef OBJECT_PRINT #ifdef OBJECT_PRINT
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
for (int space = 0; space < kNumberOfSnapshotSpaces; ++space) { for (int space = 0; space < kNumberOfSnapshotSpaces; ++space) {
// Value-initialized to 0. // Value-initialized to 0.
instance_type_count_[space] = std::make_unique<int[]>(kInstanceTypes); instance_type_count_[space] = std::make_unique<int[]>(kInstanceTypes);
...@@ -58,7 +58,7 @@ void Serializer::PopStack() { stack_.Pop(); } ...@@ -58,7 +58,7 @@ void Serializer::PopStack() { stack_.Pop(); }
#endif #endif
void Serializer::CountAllocation(Map map, int size, SnapshotSpace space) { void Serializer::CountAllocation(Map map, int size, SnapshotSpace space) {
DCHECK(FLAG_serialization_statistics); DCHECK(v8_flags.serialization_statistics);
const int space_number = static_cast<int>(space); const int space_number = static_cast<int>(space);
allocation_size_[space_number] += size; allocation_size_[space_number] += size;
...@@ -78,7 +78,7 @@ int Serializer::TotalAllocationSize() const { ...@@ -78,7 +78,7 @@ int Serializer::TotalAllocationSize() const {
} }
void Serializer::OutputStatistics(const char* name) { void Serializer::OutputStatistics(const char* name) {
if (!FLAG_serialization_statistics) return; if (!v8_flags.serialization_statistics) return;
PrintF("%s:\n", name); PrintF("%s:\n", name);
...@@ -113,7 +113,7 @@ void Serializer::OutputStatistics(const char* name) { ...@@ -113,7 +113,7 @@ void Serializer::OutputStatistics(const char* name) {
} }
void Serializer::SerializeDeferredObjects() { void Serializer::SerializeDeferredObjects() {
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF("Serializing deferred objects\n"); PrintF("Serializing deferred objects\n");
} }
WHILE_WITH_HANDLE_SCOPE(isolate(), !deferred_objects_.empty(), { WHILE_WITH_HANDLE_SCOPE(isolate(), !deferred_objects_.empty(), {
...@@ -188,7 +188,7 @@ bool Serializer::SerializeHotObject(HeapObject obj) { ...@@ -188,7 +188,7 @@ bool Serializer::SerializeHotObject(HeapObject obj) {
int index = hot_objects_.Find(obj); int index = hot_objects_.Find(obj);
if (index == HotObjectsList::kNotFound) return false; if (index == HotObjectsList::kNotFound) return false;
DCHECK(index >= 0 && index < kHotObjectCount); DCHECK(index >= 0 && index < kHotObjectCount);
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding hot object %d:", index); PrintF(" Encoding hot object %d:", index);
obj.ShortPrint(); obj.ShortPrint();
PrintF("\n"); PrintF("\n");
...@@ -206,14 +206,14 @@ bool Serializer::SerializeBackReference(HeapObject obj) { ...@@ -206,14 +206,14 @@ bool Serializer::SerializeBackReference(HeapObject obj) {
// offset fromthe start of the deserialized objects or as an offset // offset fromthe start of the deserialized objects or as an offset
// backwards from thecurrent allocation pointer. // backwards from thecurrent allocation pointer.
if (reference->is_attached_reference()) { if (reference->is_attached_reference()) {
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding attached reference %d\n", PrintF(" Encoding attached reference %d\n",
reference->attached_reference_index()); reference->attached_reference_index());
} }
PutAttachedReference(*reference); PutAttachedReference(*reference);
} else { } else {
DCHECK(reference->is_back_reference()); DCHECK(reference->is_back_reference());
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding back reference to: "); PrintF(" Encoding back reference to: ");
obj.ShortPrint(); obj.ShortPrint();
PrintF("\n"); PrintF("\n");
...@@ -244,7 +244,7 @@ void Serializer::PutRoot(RootIndex root) { ...@@ -244,7 +244,7 @@ void Serializer::PutRoot(RootIndex root) {
DisallowGarbageCollection no_gc; DisallowGarbageCollection no_gc;
int root_index = static_cast<int>(root); int root_index = static_cast<int>(root);
HeapObject object = HeapObject::cast(isolate()->root(root)); HeapObject object = HeapObject::cast(isolate()->root(root));
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding root %d:", root_index); PrintF(" Encoding root %d:", root_index);
object.ShortPrint(); object.ShortPrint();
PrintF("\n"); PrintF("\n");
...@@ -450,7 +450,7 @@ void Serializer::ObjectSerializer::SerializePrologue(SnapshotSpace space, ...@@ -450,7 +450,7 @@ void Serializer::ObjectSerializer::SerializePrologue(SnapshotSpace space,
serializer_->ResolvePendingObject(*object_); serializer_->ResolvePendingObject(*object_);
} }
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
serializer_->CountAllocation(object_->map(), size, space); serializer_->CountAllocation(object_->map(), size, space);
} }
...@@ -707,7 +707,7 @@ void Serializer::ObjectSerializer::Serialize() { ...@@ -707,7 +707,7 @@ void Serializer::ObjectSerializer::Serialize() {
if ((recursion.ExceedsMaximum() && CanBeDeferred(raw)) || if ((recursion.ExceedsMaximum() && CanBeDeferred(raw)) ||
serializer_->MustBeDeferred(raw)) { serializer_->MustBeDeferred(raw)) {
DCHECK(CanBeDeferred(raw)); DCHECK(CanBeDeferred(raw));
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Deferring heap object: "); PrintF(" Deferring heap object: ");
object_->ShortPrint(); object_->ShortPrint();
PrintF("\n"); PrintF("\n");
...@@ -720,7 +720,7 @@ void Serializer::ObjectSerializer::Serialize() { ...@@ -720,7 +720,7 @@ void Serializer::ObjectSerializer::Serialize() {
return; return;
} }
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding heap object: "); PrintF(" Encoding heap object: ");
object_->ShortPrint(); object_->ShortPrint();
PrintF("\n"); PrintF("\n");
...@@ -826,7 +826,7 @@ void Serializer::ObjectSerializer::SerializeDeferred() { ...@@ -826,7 +826,7 @@ void Serializer::ObjectSerializer::SerializeDeferred() {
serializer_->reference_map()->LookupReference(object_); serializer_->reference_map()->LookupReference(object_);
if (back_reference != nullptr) { if (back_reference != nullptr) {
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Deferred heap object "); PrintF(" Deferred heap object ");
object_->ShortPrint(); object_->ShortPrint();
PrintF(" was already serialized\n"); PrintF(" was already serialized\n");
...@@ -834,7 +834,7 @@ void Serializer::ObjectSerializer::SerializeDeferred() { ...@@ -834,7 +834,7 @@ void Serializer::ObjectSerializer::SerializeDeferred() {
return; return;
} }
if (FLAG_trace_serializer) { if (v8_flags.trace_serializer) {
PrintF(" Encoding deferred heap object\n"); PrintF(" Encoding deferred heap object\n");
} }
Serialize(); Serialize();
......
...@@ -60,7 +60,7 @@ void SharedHeapSerializer::FinalizeSerialization() { ...@@ -60,7 +60,7 @@ void SharedHeapSerializer::FinalizeSerialization() {
VisitRootPointer(Root::kSharedHeapObjectCache, nullptr, VisitRootPointer(Root::kSharedHeapObjectCache, nullptr,
FullObjectSlot(&undefined)); FullObjectSlot(&undefined));
// When FLAG_shared_string_table is true, all internalized and // When v8_flags.shared_string_table is true, all internalized and
// internalizable-in-place strings are in the shared heap. // internalizable-in-place strings are in the shared heap.
SerializeStringTable(isolate()->string_table()); SerializeStringTable(isolate()->string_table());
SerializeDeferredObjects(); SerializeDeferredObjects();
......
...@@ -22,7 +22,7 @@ SnapshotData SnapshotCompression::Compress( ...@@ -22,7 +22,7 @@ SnapshotData SnapshotCompression::Compress(
const SnapshotData* uncompressed_data) { const SnapshotData* uncompressed_data) {
SnapshotData snapshot_data; SnapshotData snapshot_data;
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
static_assert(sizeof(Bytef) == 1, ""); static_assert(sizeof(Bytef) == 1, "");
const uLongf input_size = const uLongf input_size =
...@@ -55,7 +55,7 @@ SnapshotData SnapshotCompression::Compress( ...@@ -55,7 +55,7 @@ SnapshotData SnapshotCompression::Compress(
DCHECK_EQ(payload_length, DCHECK_EQ(payload_length,
GetUncompressedSize(snapshot_data.RawData().begin())); GetUncompressedSize(snapshot_data.RawData().begin()));
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
PrintF("[Compressing %d bytes took %0.3f ms]\n", payload_length, ms); PrintF("[Compressing %d bytes took %0.3f ms]\n", payload_length, ms);
} }
...@@ -66,7 +66,7 @@ SnapshotData SnapshotCompression::Decompress( ...@@ -66,7 +66,7 @@ SnapshotData SnapshotCompression::Decompress(
base::Vector<const byte> compressed_data) { base::Vector<const byte> compressed_data) {
SnapshotData snapshot_data; SnapshotData snapshot_data;
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
const Bytef* input_bytef = const Bytef* input_bytef =
base::bit_cast<const Bytef*>(compressed_data.begin()); base::bit_cast<const Bytef*>(compressed_data.begin());
...@@ -87,7 +87,7 @@ SnapshotData SnapshotCompression::Decompress( ...@@ -87,7 +87,7 @@ SnapshotData SnapshotCompression::Decompress(
sizeof(uncompressed_payload_length))), sizeof(uncompressed_payload_length))),
Z_OK); Z_OK);
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
PrintF("[Decompressing %d bytes took %0.3f ms]\n", PrintF("[Decompressing %d bytes took %0.3f ms]\n",
uncompressed_payload_length, ms); uncompressed_payload_length, ms);
......
...@@ -41,7 +41,7 @@ bool Snapshot::ShouldVerifyChecksum(const v8::StartupData* data) { ...@@ -41,7 +41,7 @@ bool Snapshot::ShouldVerifyChecksum(const v8::StartupData* data) {
#ifdef V8_TARGET_OS_ANDROID #ifdef V8_TARGET_OS_ANDROID
base::MutexGuard lock_guard(external_startup_data_mutex.Pointer()); base::MutexGuard lock_guard(external_startup_data_mutex.Pointer());
if (data != &external_startup_blob) { if (data != &external_startup_blob) {
return FLAG_verify_snapshot_checksum; return v8_flags.verify_snapshot_checksum;
} }
// Verify the external snapshot maximally once per process due to the // Verify the external snapshot maximally once per process due to the
// additional overhead. // additional overhead.
...@@ -49,7 +49,7 @@ bool Snapshot::ShouldVerifyChecksum(const v8::StartupData* data) { ...@@ -49,7 +49,7 @@ bool Snapshot::ShouldVerifyChecksum(const v8::StartupData* data) {
external_startup_checksum_verified = true; external_startup_checksum_verified = true;
return true; return true;
#else #else
return FLAG_verify_snapshot_checksum; return v8_flags.verify_snapshot_checksum;
#endif #endif
} }
......
...@@ -158,7 +158,7 @@ bool Snapshot::Initialize(Isolate* isolate) { ...@@ -158,7 +158,7 @@ bool Snapshot::Initialize(Isolate* isolate) {
TRACE_EVENT0("v8", "V8.DeserializeIsolate"); TRACE_EVENT0("v8", "V8.DeserializeIsolate");
RCS_SCOPE(isolate, RuntimeCallCounterId::kDeserializeIsolate); RCS_SCOPE(isolate, RuntimeCallCounterId::kDeserializeIsolate);
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
const v8::StartupData* blob = isolate->snapshot_blob(); const v8::StartupData* blob = isolate->snapshot_blob();
SnapshotImpl::CheckVersion(blob); SnapshotImpl::CheckVersion(blob);
...@@ -182,7 +182,7 @@ bool Snapshot::Initialize(Isolate* isolate) { ...@@ -182,7 +182,7 @@ bool Snapshot::Initialize(Isolate* isolate) {
bool success = isolate->InitWithSnapshot( bool success = isolate->InitWithSnapshot(
&startup_snapshot_data, &read_only_snapshot_data, &startup_snapshot_data, &read_only_snapshot_data,
&shared_heap_snapshot_data, ExtractRehashability(blob)); &shared_heap_snapshot_data, ExtractRehashability(blob));
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
int bytes = startup_data.length(); int bytes = startup_data.length();
PrintF("[Deserializing isolate (%d bytes) took %0.3f ms]\n", bytes, ms); PrintF("[Deserializing isolate (%d bytes) took %0.3f ms]\n", bytes, ms);
...@@ -197,7 +197,7 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot( ...@@ -197,7 +197,7 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot(
TRACE_EVENT0("v8", "V8.DeserializeContext"); TRACE_EVENT0("v8", "V8.DeserializeContext");
RCS_SCOPE(isolate, RuntimeCallCounterId::kDeserializeContext); RCS_SCOPE(isolate, RuntimeCallCounterId::kDeserializeContext);
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
const v8::StartupData* blob = isolate->snapshot_blob(); const v8::StartupData* blob = isolate->snapshot_blob();
bool can_rehash = ExtractRehashability(blob); bool can_rehash = ExtractRehashability(blob);
...@@ -212,7 +212,7 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot( ...@@ -212,7 +212,7 @@ MaybeHandle<Context> Snapshot::NewContextFromSnapshot(
Handle<Context> result; Handle<Context> result;
if (!maybe_result.ToHandle(&result)) return MaybeHandle<Context>(); if (!maybe_result.ToHandle(&result)) return MaybeHandle<Context>();
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
int bytes = context_data.length(); int bytes = context_data.length();
PrintF("[Deserializing context #%zu (%d bytes) took %0.3f ms]\n", PrintF("[Deserializing context #%zu (%d bytes) took %0.3f ms]\n",
...@@ -354,7 +354,7 @@ void Snapshot::SerializeDeserializeAndVerifyForTesting( ...@@ -354,7 +354,7 @@ void Snapshot::SerializeDeserializeAndVerifyForTesting(
CHECK(new_native_context->IsNativeContext()); CHECK(new_native_context->IsNativeContext());
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) HeapVerifier::VerifyHeap(new_isolate->heap()); if (v8_flags.verify_heap) HeapVerifier::VerifyHeap(new_isolate->heap());
#endif // VERIFY_HEAP #endif // VERIFY_HEAP
} }
new_isolate->Exit(); new_isolate->Exit();
...@@ -405,7 +405,7 @@ v8::StartupData Snapshot::Create( ...@@ -405,7 +405,7 @@ v8::StartupData Snapshot::Create(
context_serializer.Serialize(&contexts->at(i), no_gc); context_serializer.Serialize(&contexts->at(i), no_gc);
can_be_rehashed = can_be_rehashed && context_serializer.can_be_rehashed(); can_be_rehashed = can_be_rehashed && context_serializer.can_be_rehashed();
context_snapshots.push_back(new SnapshotData(&context_serializer)); context_snapshots.push_back(new SnapshotData(&context_serializer));
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
context_allocation_sizes.push_back( context_allocation_sizes.push_back(
context_serializer.TotalAllocationSize()); context_serializer.TotalAllocationSize());
} }
...@@ -422,7 +422,7 @@ v8::StartupData Snapshot::Create( ...@@ -422,7 +422,7 @@ v8::StartupData Snapshot::Create(
read_only_serializer.FinalizeSerialization(); read_only_serializer.FinalizeSerialization();
can_be_rehashed = can_be_rehashed && read_only_serializer.can_be_rehashed(); can_be_rehashed = can_be_rehashed && read_only_serializer.can_be_rehashed();
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
// These prints should match the regexp in test/memory/Memory.json // These prints should match the regexp in test/memory/Memory.json
DCHECK_NE(read_only_serializer.TotalAllocationSize(), 0); DCHECK_NE(read_only_serializer.TotalAllocationSize(), 0);
DCHECK_NE(shared_heap_serializer.TotalAllocationSize(), 0); DCHECK_NE(shared_heap_serializer.TotalAllocationSize(), 0);
...@@ -537,7 +537,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob( ...@@ -537,7 +537,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob(
CopyBytes(data + payload_offset, CopyBytes(data + payload_offset,
reinterpret_cast<const char*>(startup_snapshot->RawData().begin()), reinterpret_cast<const char*>(startup_snapshot->RawData().begin()),
payload_length); payload_length);
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
PrintF("Snapshot blob consists of:\n%10d bytes for startup\n", PrintF("Snapshot blob consists of:\n%10d bytes for startup\n",
payload_length); payload_length);
} }
...@@ -551,7 +551,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob( ...@@ -551,7 +551,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob(
data + payload_offset, data + payload_offset,
reinterpret_cast<const char*>(read_only_snapshot->RawData().begin()), reinterpret_cast<const char*>(read_only_snapshot->RawData().begin()),
payload_length); payload_length);
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
PrintF("%10d bytes for read-only\n", payload_length); PrintF("%10d bytes for read-only\n", payload_length);
} }
payload_offset += payload_length; payload_offset += payload_length;
...@@ -564,7 +564,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob( ...@@ -564,7 +564,7 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob(
data + payload_offset, data + payload_offset,
reinterpret_cast<const char*>(shared_heap_snapshot->RawData().begin()), reinterpret_cast<const char*>(shared_heap_snapshot->RawData().begin()),
payload_length); payload_length);
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
PrintF("%10d bytes for shared heap\n", payload_length); PrintF("%10d bytes for shared heap\n", payload_length);
} }
payload_offset += payload_length; payload_offset += payload_length;
...@@ -579,12 +579,12 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob( ...@@ -579,12 +579,12 @@ v8::StartupData SnapshotImpl::CreateSnapshotBlob(
data + payload_offset, data + payload_offset,
reinterpret_cast<const char*>(context_snapshot->RawData().begin()), reinterpret_cast<const char*>(context_snapshot->RawData().begin()),
payload_length); payload_length);
if (FLAG_serialization_statistics) { if (v8_flags.serialization_statistics) {
PrintF("%10d bytes for context #%d\n", payload_length, i); PrintF("%10d bytes for context #%d\n", payload_length, i);
} }
payload_offset += payload_length; payload_offset += payload_length;
} }
if (FLAG_serialization_statistics) PrintF("\n"); if (v8_flags.serialization_statistics) PrintF("\n");
DCHECK_EQ(total_length, payload_offset); DCHECK_EQ(total_length, payload_offset);
v8::StartupData result = {data, static_cast<int>(total_length)}; v8::StartupData result = {data, static_cast<int>(total_length)};
...@@ -611,10 +611,10 @@ uint32_t Snapshot::CalculateChecksum(const v8::StartupData* data) { ...@@ -611,10 +611,10 @@ uint32_t Snapshot::CalculateChecksum(const v8::StartupData* data) {
bool Snapshot::VerifyChecksum(const v8::StartupData* data) { bool Snapshot::VerifyChecksum(const v8::StartupData* data) {
base::ElapsedTimer timer; base::ElapsedTimer timer;
if (FLAG_profile_deserialization) timer.Start(); if (v8_flags.profile_deserialization) timer.Start();
uint32_t expected = GetExpectedChecksum(data); uint32_t expected = GetExpectedChecksum(data);
uint32_t result = CalculateChecksum(data); uint32_t result = CalculateChecksum(data);
if (FLAG_profile_deserialization) { if (v8_flags.profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF(); double ms = timer.Elapsed().InMillisecondsF();
PrintF("[Verifying snapshot checksum took %0.3f ms]\n", ms); PrintF("[Verifying snapshot checksum took %0.3f ms]\n", ms);
} }
......
...@@ -74,7 +74,7 @@ void StartupDeserializer::DeserializeIntoIsolate() { ...@@ -74,7 +74,7 @@ void StartupDeserializer::DeserializeIntoIsolate() {
} }
void StartupDeserializer::LogNewMapEvents() { void StartupDeserializer::LogNewMapEvents() {
if (FLAG_log_maps) LOG(isolate(), LogAllMaps()); if (v8_flags.log_maps) LOG(isolate(), LogAllMaps());
} }
void StartupDeserializer::FlushICache() { void StartupDeserializer::FlushICache() {
......
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