[vm] Remove some dead error entry points.

TEST=ci
Change-Id: I78e13654ba4425e07e92a5a879595cae2045ea99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231360
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2022-02-03 17:55:16 +00:00
committed by Commit Bot
parent 692f9c28eb
commit f3996e4e96
3 changed files with 0 additions and 59 deletions
-51
View File
@@ -168,57 +168,6 @@ DEFINE_NATIVE_ENTRY(TypeError_throwNew, 0, 4) {
return Object::null();
}
// Allocate and throw a new FallThroughError.
// Arg0: index of the case clause token into which we fall through.
// Return value: none, throws an exception.
DEFINE_NATIVE_ENTRY(FallThroughError_throwNew, 0, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_pos, arguments->NativeArgAt(0));
TokenPosition fallthrough_pos = TokenPosition::Deserialize(smi_pos.Value());
const Array& args = Array::Handle(Array::New(2));
// Initialize 'url' and 'line' arguments.
DartFrameIterator iterator(thread,
StackFrameIterator::kNoCrossThreadIteration);
iterator.NextFrame(); // Skip native call.
const Script& script = Script::Handle(Exceptions::GetCallerScript(&iterator));
args.SetAt(0, String::Handle(script.url()));
intptr_t line = -1;
script.GetTokenLocation(fallthrough_pos, &line);
args.SetAt(1, Smi::Handle(Smi::New(line)));
Exceptions::ThrowByType(Exceptions::kFallThrough, args);
UNREACHABLE();
return Object::null();
}
// Allocate and throw a new AbstractClassInstantiationError.
// Arg0: Token position of allocation statement.
// Arg1: class name of the abstract class that cannot be instantiated.
// Return value: none, throws an exception.
DEFINE_NATIVE_ENTRY(AbstractClassInstantiationError_throwNew, 0, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_pos, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, class_name, arguments->NativeArgAt(1));
TokenPosition error_pos = TokenPosition::Deserialize(smi_pos.Value());
const Array& args = Array::Handle(Array::New(3));
// Initialize 'className', 'url' and 'line' arguments.
DartFrameIterator iterator(thread,
StackFrameIterator::kNoCrossThreadIteration);
iterator.NextFrame(); // Skip native call.
const Script& script = Script::Handle(Exceptions::GetCallerScript(&iterator));
args.SetAt(0, class_name);
args.SetAt(1, String::Handle(script.url()));
intptr_t line = -1;
script.GetTokenLocation(error_pos, &line);
args.SetAt(2, Smi::Handle(Smi::New(line)));
Exceptions::ThrowByType(Exceptions::kAbstractClassInstantiation, args);
UNREACHABLE();
return Object::null();
}
// Rethrow an error with a stacktrace.
DEFINE_NATIVE_ENTRY(Error_throwWithStackTrace, 0, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance, error, arguments->NativeArgAt(0));
-2
View File
@@ -152,8 +152,6 @@ namespace dart {
V(Error_throwWithStackTrace, 2) \
V(StackTrace_current, 0) \
V(TypeError_throwNew, 4) \
V(FallThroughError_throwNew, 1) \
V(AbstractClassInstantiationError_throwNew, 2) \
V(Stopwatch_now, 0) \
V(Stopwatch_frequency, 0) \
V(Timeline_getNextAsyncId, 0) \
@@ -134,9 +134,6 @@ class FallThroughError {
@pragma("vm:entry-point")
FallThroughError._create(this._url, this._line);
@pragma("vm:external-name", "FallThroughError_throwNew")
external static _throwNew(int caseClausePos);
@patch
String toString() {
return "'$_url': Switch case fall-through at line $_line.";
@@ -176,9 +173,6 @@ class AbstractClassInstantiationError {
AbstractClassInstantiationError._create(
this._className, this._url, this._line);
@pragma("vm:external-name", "AbstractClassInstantiationError_throwNew")
external static _throwNew(int caseClausePos, String className);
@patch
String toString() {
return "Cannot instantiate abstract class $_className: "