mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
[vm, gc] Remove expensive, low-value GC verification flags.
--verify_gc_contains is roughly O(heap^2) and gives false errors in some cases involving remembered cards --verify_on_transition takes over 30 minutes for even hello world Change-Id: Idee7e535bb96b11f0fa620532debbd21ca9d7135 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123329 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
19cab51a4b
commit
b34f11adbd
9 changed files with 0 additions and 47 deletions
|
@ -177,15 +177,6 @@ char* Dart::Init(const uint8_t* vm_isolate_snapshot,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
// Turn on verify_gc_contains if any of the other GC verification flag
|
||||
// is turned on.
|
||||
if (FLAG_verify_before_gc || FLAG_verify_after_gc ||
|
||||
FLAG_verify_on_transition) {
|
||||
FLAG_verify_gc_contains = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
FrameLayout::Init();
|
||||
|
||||
set_thread_exit_callback(thread_exit);
|
||||
|
|
|
@ -2953,7 +2953,6 @@ VM_UNIT_TEST_CASE(DartAPI_PersistentHandles) {
|
|||
for (int i = 1000; i < 1500; i++) {
|
||||
handles[i] = Dart_NewPersistentHandle(ref1);
|
||||
}
|
||||
VERIFY_ON_TRANSITION;
|
||||
Dart_ExitScope();
|
||||
}
|
||||
Dart_ExitScope();
|
||||
|
@ -3674,7 +3673,6 @@ VM_UNIT_TEST_CASE(DartAPI_LocalHandles) {
|
|||
}
|
||||
EXPECT_EQ(300, thread->CountLocalHandles());
|
||||
}
|
||||
VERIFY_ON_TRANSITION;
|
||||
Dart_ExitScope();
|
||||
}
|
||||
EXPECT_EQ(200, thread->CountLocalHandles());
|
||||
|
|
|
@ -196,9 +196,6 @@ constexpr bool kDartUseBytecode = false;
|
|||
"Enables heap verification after GC.") \
|
||||
R(verify_before_gc, false, bool, false, \
|
||||
"Enables heap verification before GC.") \
|
||||
D(verify_gc_contains, bool, false, \
|
||||
"Enables verification of address contains during GC.") \
|
||||
D(verify_on_transition, bool, false, "Verify on dart <==> VM.") \
|
||||
P(enable_slow_path_sharing, bool, true, "Enable sharing of slow-path code.") \
|
||||
P(shared_slow_path_triggers_gc, bool, false, \
|
||||
"TESTING: slow-path triggers a GC.") \
|
||||
|
|
|
@ -140,11 +140,6 @@ class ScavengerVisitor : public ObjectPointerVisitor {
|
|||
void VisitPointers(RawObject** first, RawObject** last) {
|
||||
ASSERT(Utils::IsAligned(first, sizeof(*first)));
|
||||
ASSERT(Utils::IsAligned(last, sizeof(*last)));
|
||||
if (FLAG_verify_gc_contains) {
|
||||
ASSERT((visiting_old_object_ != NULL) ||
|
||||
scavenger_->Contains(reinterpret_cast<uword>(first)) ||
|
||||
!heap_->Contains(reinterpret_cast<uword>(first)));
|
||||
}
|
||||
for (RawObject** current = first; current <= last; current++) {
|
||||
ScavengePointer(current);
|
||||
}
|
||||
|
@ -164,11 +159,6 @@ class ScavengerVisitor : public ObjectPointerVisitor {
|
|||
private:
|
||||
void UpdateStoreBuffer(RawObject** p, RawObject* obj) {
|
||||
ASSERT(obj->IsHeapObject());
|
||||
if (FLAG_verify_gc_contains) {
|
||||
uword ptr = reinterpret_cast<uword>(p);
|
||||
ASSERT(!scavenger_->Contains(ptr));
|
||||
ASSERT(heap_->DataContains(ptr));
|
||||
}
|
||||
// If the newly written object is not a new object, drop it immediately.
|
||||
if (!obj->IsNewObject() || visiting_old_object_->IsRemembered()) {
|
||||
return;
|
||||
|
|
|
@ -2139,13 +2139,6 @@ void Isolate::Shutdown() {
|
|||
delete optimizing_background_compiler_;
|
||||
optimizing_background_compiler_ = nullptr;
|
||||
|
||||
#if defined(DEBUG)
|
||||
if (heap_ != nullptr && FLAG_verify_on_transition) {
|
||||
// The VM isolate keeps all objects marked.
|
||||
heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked);
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
||||
Thread* thread = Thread::Current();
|
||||
|
||||
// Don't allow anymore dart code to execution on this isolate.
|
||||
|
|
|
@ -44,10 +44,6 @@ class Thread;
|
|||
|
||||
void VerifyOnTransition();
|
||||
|
||||
#define VERIFY_ON_TRANSITION \
|
||||
if (FLAG_verify_on_transition) { \
|
||||
VerifyOnTransition(); \
|
||||
}
|
||||
#define DEOPTIMIZE_ALOT \
|
||||
if (FLAG_deoptimize_alot) { \
|
||||
DeoptimizeFunctionsOnStack(); \
|
||||
|
@ -57,8 +53,6 @@ void VerifyOnTransition();
|
|||
|
||||
#define CHECK_STACK_ALIGNMENT \
|
||||
{}
|
||||
#define VERIFY_ON_TRANSITION \
|
||||
{}
|
||||
#define DEOPTIMIZE_ALOT \
|
||||
{}
|
||||
|
||||
|
|
|
@ -137,7 +137,6 @@ void NativeEntry::NoScopeNativeCallWrapper(Dart_NativeArguments args,
|
|||
void NativeEntry::NoScopeNativeCallWrapperNoStackCheck(
|
||||
Dart_NativeArguments args,
|
||||
Dart_NativeFunction func) {
|
||||
VERIFY_ON_TRANSITION;
|
||||
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
|
||||
// Tell MemorySanitizer 'arguments' is initialized by generated code.
|
||||
MSAN_UNPOISON(arguments, sizeof(*arguments));
|
||||
|
@ -151,7 +150,6 @@ void NativeEntry::NoScopeNativeCallWrapperNoStackCheck(
|
|||
}
|
||||
}
|
||||
ASSERT(thread->execution_state() == Thread::kThreadInGenerated);
|
||||
VERIFY_ON_TRANSITION;
|
||||
}
|
||||
|
||||
uword NativeEntry::AutoScopeNativeCallWrapperEntry() {
|
||||
|
@ -173,7 +171,6 @@ void NativeEntry::AutoScopeNativeCallWrapper(Dart_NativeArguments args,
|
|||
void NativeEntry::AutoScopeNativeCallWrapperNoStackCheck(
|
||||
Dart_NativeArguments args,
|
||||
Dart_NativeFunction func) {
|
||||
VERIFY_ON_TRANSITION;
|
||||
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
|
||||
// Tell MemorySanitizer 'arguments' is initialized by generated code.
|
||||
MSAN_UNPOISON(arguments, sizeof(*arguments));
|
||||
|
@ -196,7 +193,6 @@ void NativeEntry::AutoScopeNativeCallWrapperNoStackCheck(
|
|||
DEOPTIMIZE_ALOT;
|
||||
}
|
||||
ASSERT(thread->execution_state() == Thread::kThreadInGenerated);
|
||||
VERIFY_ON_TRANSITION;
|
||||
}
|
||||
|
||||
static NativeFunction ResolveNativeFunction(Zone* zone,
|
||||
|
@ -233,7 +229,6 @@ uword NativeEntry::LinkNativeCallEntry() {
|
|||
|
||||
void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
||||
CHECK_STACK_ALIGNMENT;
|
||||
VERIFY_ON_TRANSITION;
|
||||
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
|
||||
// Tell MemorySanitizer 'arguments' is initialized by generated code.
|
||||
MSAN_UNPOISON(arguments, sizeof(*arguments));
|
||||
|
@ -346,7 +341,6 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
|
|||
is_bootstrap_native ? "bootstrap" : "non-bootstrap");
|
||||
}
|
||||
}
|
||||
VERIFY_ON_TRANSITION;
|
||||
|
||||
// Tail-call resolved target.
|
||||
if (is_bootstrap_native) {
|
||||
|
|
|
@ -40,7 +40,6 @@ class String;
|
|||
Zone* zone, NativeArguments* arguments); \
|
||||
void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \
|
||||
CHECK_STACK_ALIGNMENT; \
|
||||
VERIFY_ON_TRANSITION; \
|
||||
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \
|
||||
/* Tell MemorySanitizer 'arguments' is initialized by generated code. */ \
|
||||
MSAN_UNPOISON(arguments, sizeof(*arguments)); \
|
||||
|
@ -65,7 +64,6 @@ class String;
|
|||
} \
|
||||
DEOPTIMIZE_ALOT; \
|
||||
} \
|
||||
VERIFY_ON_TRANSITION; \
|
||||
} \
|
||||
static RawObject* DN_Helper##name(Isolate* isolate, Thread* thread, \
|
||||
Zone* zone, NativeArguments* arguments)
|
||||
|
|
|
@ -99,7 +99,6 @@ class RuntimeEntry : public BaseRuntimeEntry {
|
|||
NativeArguments arguments); \
|
||||
void DRT_##name(NativeArguments arguments) { \
|
||||
CHECK_STACK_ALIGNMENT; \
|
||||
VERIFY_ON_TRANSITION; \
|
||||
ASSERT(arguments.ArgCount() == argument_count); \
|
||||
TRACE_RUNTIME_CALL("%s", "" #name); \
|
||||
{ \
|
||||
|
@ -111,7 +110,6 @@ class RuntimeEntry : public BaseRuntimeEntry {
|
|||
HANDLESCOPE(thread); \
|
||||
DRT_Helper##name(isolate, thread, zone.GetZone(), arguments); \
|
||||
} \
|
||||
VERIFY_ON_TRANSITION; \
|
||||
} \
|
||||
static void DRT_Helper##name(Isolate* isolate, Thread* thread, Zone* zone, \
|
||||
NativeArguments arguments)
|
||||
|
|
Loading…
Reference in a new issue