Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: runtime/vm/exceptions.cc

Issue 1703503002: Remove --abort_on_assertion_errors and all associated infrastructure. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/exceptions.h ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 27b3852a661b41583d0cbba8f9a26ab5bc6cd040..800a802dbee47779f830315135cf1dce188551ff 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -19,10 +19,6 @@
namespace dart {
-// TODO(vegorov): Remove --abort_on_assertion_errors flag and associated
-// infrastructure (dartbug.com/25753)
-DEFINE_FLAG(bool, abort_on_assertion_errors, false,
- "Abort on assertion and typecheck failures");
DEFINE_FLAG(bool, print_stacktrace_at_throw, false,
"Prints a stack trace everytime a throw occurs.");
@@ -461,7 +457,7 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
// Type errors in the core library may be difficult to diagnose.
// Print type error information before throwing the error when debugging.
- if (FLAG_print_stacktrace_at_throw || FLAG_abort_on_assertion_errors) {
+ if (FLAG_print_stacktrace_at_throw) {
if (!error_msg.IsNull()) {
OS::Print("%s\n", error_msg.ToCString());
}
@@ -477,10 +473,6 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
}
}
- if (FLAG_abort_on_assertion_errors) {
- PrintStackTraceAndAbort("a type error");
- }
-
// Throw TypeError or CastError instance.
Exceptions::ThrowByType(exception_type, args);
UNREACHABLE();
@@ -672,30 +664,4 @@ RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) {
}
-static bool IsLikelyInternalDart2JSCrash(const Stacktrace& stacktrace) {
- Function& function = Function::Handle();
- String& name = String::Handle();
- for (intptr_t i = 0, len = stacktrace.Length(); i < len; i++) {
- function = stacktrace.FunctionAtFrame(i);
- name = function.QualifiedPrettyName();
- if (name.Equals("_CompilerDiagnosticReporter.withCurrentElement")) {
- return true;
- }
- }
- return false;
-}
-
-
-void Exceptions::PrintStackTraceAndAbort(const char* reason) {
- const Stacktrace& stacktrace = Stacktrace::Handle(CurrentStacktrace());
- if (!IsLikelyInternalDart2JSCrash(stacktrace)) {
- return;
- }
-
- OS::PrintErr("\n\n\nAborting due to %s. Stacktrace:\n%s\n",
- reason,
- stacktrace.ToCString());
- OS::Abort();
-}
-
} // namespace dart
« no previous file with comments | « runtime/vm/exceptions.h ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698