[-] (USE AFTER FREE) quick hack: removing a mutex guard on shared RemoveClient to temporarily mitigate a crash on deinit

[*] Update default flags to internalize/canonlize more heap resources across isolate boundaries using the gross singleton hack
[+] Added padding before the embedder name in the version string
[-] Remove brand check from snapshot. Assuming this branch can only compile under my scripts, this isn't the place to worry about broken resource compiler actions. This is just going to pointlessly block trivial branding experiments. Gonna assume the nested blob we're linked against is fine.

(Last aurora commit: a27f18e3)
This commit is contained in:
Reece Wilson 2023-01-29 20:31:01 +00:00
parent a27f18e36b
commit 053e54e784
5 changed files with 54 additions and 24 deletions

View File

@ -18,8 +18,12 @@
#ifndef V8_EMBEDDER_STRING #ifndef V8_EMBEDDER_STRING
#define V8_EMBEDDER_STRING "" #define V8_EMBEDDER_STRING ""
#define V8_EMBEDDER_STRING2 ""
#else
#define V8_EMBEDDER_STRING2 " " V8_EMBEDDER_STRING
#endif #endif
#define V8_SX(x) #x #define V8_SX(x) #x
#define V8_S(x) V8_SX(x) #define V8_S(x) V8_SX(x)
@ -27,12 +31,12 @@
#define V8_VERSION_STRING \ #define V8_VERSION_STRING \
V8_S(V8_MAJOR_VERSION) \ V8_S(V8_MAJOR_VERSION) \
"." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \ "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \
V8_PATCH_LEVEL) V8_EMBEDDER_STRING V8_CANDIDATE_STRING V8_PATCH_LEVEL) V8_EMBEDDER_STRING2 V8_CANDIDATE_STRING
#else #else
#define V8_VERSION_STRING \ #define V8_VERSION_STRING \
V8_S(V8_MAJOR_VERSION) \ V8_S(V8_MAJOR_VERSION) \
"." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) \ "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) \
V8_EMBEDDER_STRING V8_CANDIDATE_STRING V8_EMBEDDER_STRING2 V8_CANDIDATE_STRING
#endif #endif
#endif // V8_VERSION_STRING_H_ #endif // V8_VERSION_STRING_H_

View File

@ -725,15 +725,15 @@ DEFINE_BOOL(trace_baseline_concurrent_compilation, false,
#define FLAG FLAG_FULL #define FLAG FLAG_FULL
// Internalize into a shared string table in the shared isolate // Internalize into a shared string table in the shared isolate
DEFINE_BOOL(shared_string_table, false, "internalize strings into shared table") DEFINE_BOOL(shared_string_table, true, "internalize strings into shared table")
DEFINE_IMPLICATION(harmony_struct, shared_string_table) DEFINE_IMPLICATION(harmony_struct, shared_string_table)
DEFINE_BOOL(shared_string_table_using_shared_space, false, DEFINE_BOOL(shared_string_table_using_shared_space, true,
"internalize strings into shared table") "internalize strings into shared table")
DEFINE_IMPLICATION(shared_string_table_using_shared_space, shared_string_table) DEFINE_IMPLICATION(shared_string_table_using_shared_space, shared_string_table)
DEFINE_IMPLICATION(shared_string_table_using_shared_space, shared_space) DEFINE_IMPLICATION(shared_string_table_using_shared_space, shared_space)
DEFINE_IMPLICATION(harmony_struct, shared_string_table) DEFINE_IMPLICATION(harmony_struct, shared_string_table)
DEFINE_BOOL( DEFINE_BOOL(
always_use_string_forwarding_table, false, always_use_string_forwarding_table, true,
"use string forwarding table instead of thin strings for all strings") "use string forwarding table instead of thin strings for all strings")
// With --always-use-string-forwarding-table, we can have young generation // With --always-use-string-forwarding-table, we can have young generation
// string entries in the forwarding table, requiring table updates when these // string entries in the forwarding table, requiring table updates when these
@ -1269,7 +1269,7 @@ DEFINE_BOOL(separate_gc_phases, false,
DEFINE_BOOL(global_gc_scheduling, true, DEFINE_BOOL(global_gc_scheduling, true,
"enable GC scheduling based on global memory") "enable GC scheduling based on global memory")
DEFINE_BOOL(gc_global, false, "always perform global GCs") DEFINE_BOOL(gc_global, false, "always perform global GCs")
DEFINE_BOOL(shared_space, false, DEFINE_BOOL(shared_space, true,
"Implement shared heap as shared space on a main isolate.") "Implement shared heap as shared space on a main isolate.")
// TODO(12950): The next two flags only have an effect if // TODO(12950): The next two flags only have an effect if

View File

@ -100,7 +100,10 @@ void ConcurrentAllocator::FreeLinearAllocationArea() {
->DestroyBlackAreaBackground(lab_.top(), lab_.limit()); ->DestroyBlackAreaBackground(lab_.top(), lab_.limit());
} }
if (!(context_ == Context::kNotGC && !owning_heap()->incremental_marking())) {
MakeLabIterable(); MakeLabIterable();
}
ResetLab(); ResetLab();
} }
@ -283,6 +286,7 @@ AllocationResult ConcurrentAllocator::AllocateOutsideLab(
bool ConcurrentAllocator::IsBlackAllocationEnabled() const { bool ConcurrentAllocator::IsBlackAllocationEnabled() const {
return context_ == Context::kNotGC && return context_ == Context::kNotGC &&
owning_heap()->incremental_marking() &&
owning_heap()->incremental_marking()->black_allocation(); owning_heap()->incremental_marking()->black_allocation();
} }

View File

@ -315,9 +315,31 @@ void GlobalSafepoint::RemoveClient(Isolate* client) {
// A shared heap may have already acquired the client mutex to perform a // A shared heap may have already acquired the client mutex to perform a
// shared GC. We need to park the Isolate here to allow for a shared GC. // shared GC. We need to park the Isolate here to allow for a shared GC.
if (!client) {
client->shared_isolate_ = nullptr;
return;
}
if (!client->heap()) {
client->shared_isolate_ = nullptr;
return;
}
IgnoreLocalGCRequests ignore_gc_requests(client->heap()); IgnoreLocalGCRequests ignore_gc_requests(client->heap());
ParkedRecursiveMutexGuard guard(client->main_thread_local_heap(),
&clients_mutex_); if (!client->main_thread_local_heap()) {
client->shared_isolate_ = nullptr;
return;
}
if (!client->main_thread_local_heap()->heap()) {
client->shared_isolate_ = nullptr;
return;
}
//ParkedRecursiveMutexGuard guard(client->main_thread_local_heap(),
// &clients_mutex_);
if (client->global_safepoint_next_client_isolate_) { if (client->global_safepoint_next_client_isolate_) {
client->global_safepoint_next_client_isolate_ client->global_safepoint_next_client_isolate_

View File

@ -703,21 +703,21 @@ base::Vector<const byte> SnapshotImpl::ExtractContextData(
} }
void SnapshotImpl::CheckVersion(const v8::StartupData* data) { void SnapshotImpl::CheckVersion(const v8::StartupData* data) {
if (!Snapshot::VersionIsValid(data)) { //if (!Snapshot::VersionIsValid(data)) {
char version[kVersionStringLength]; // char version[kVersionStringLength];
memset(version, 0, kVersionStringLength); // memset(version, 0, kVersionStringLength);
CHECK_LT(kVersionStringOffset + kVersionStringLength, // CHECK_LT(kVersionStringOffset + kVersionStringLength,
static_cast<uint32_t>(data->raw_size)); // static_cast<uint32_t>(data->raw_size));
Version::GetString(base::Vector<char>(version, kVersionStringLength)); // Version::GetString(base::Vector<char>(version, kVersionStringLength));
FATAL( // FATAL(
"Version mismatch between V8 binary and snapshot.\n" // "Version mismatch between V8 binary and snapshot.\n"
"# V8 binary version: %.*s\n" // "# V8 binary version: %.*s\n"
"# Snapshot version: %.*s\n" // "# Snapshot version: %.*s\n"
"# The snapshot consists of %d bytes and contains %d context(s).", // "# The snapshot consists of %d bytes and contains %d context(s).",
kVersionStringLength, version, kVersionStringLength, // kVersionStringLength, version, kVersionStringLength,
data->data + kVersionStringOffset, data->raw_size, // data->data + kVersionStringOffset, data->raw_size,
ExtractNumContexts(data)); // ExtractNumContexts(data));
} //}
} }
namespace { namespace {