[runtime] Unify invalid size error handling

This is a follow-up to
https://chromium-review.googlesource.com/c/v8/v8/+/2833920

Bug: chromium:1209210, chromium:1198188
Change-Id: I43f18649434b06431dac6cae7946505fc4b5b398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2905607
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74678}
This commit is contained in:
Victor Gomes 2021-05-19 16:43:20 +02:00 committed by V8 LUCI CQ
parent 916eb86952
commit 7760315dbb
3 changed files with 6 additions and 3 deletions

View File

@ -482,7 +482,7 @@ Handle<JSObject> InnerAddElement(Isolate* isolate, Handle<JSArray> array,
// TODO(victorgomes): Temporarily forcing a fatal error here in case of
// overflow, until Intl::AddElement can handle exceptions.
if (JSObject::AddDataElement(array, index, element, NONE).IsNothing()) {
FATAL("Fatal JavaScript invalid array size when adding element");
FATAL("Fatal JavaScript invalid size error when adding element");
UNREACHABLE();
}
return element;

View File

@ -4980,7 +4980,9 @@ void JSObject::TransitionElementsKind(Handle<JSObject> object,
// TODO(victorgomes): Temporarily forcing a fatal error here in case of
// overflow, until all users of TransitionElementsKind can handle
// exceptions.
FATAL("Fatal JavaScript invalid array size transitioning elements kind.");
FATAL(
"Fatal JavaScript invalid size error when transitioning elements "
"kind");
UNREACHABLE();
}
}

View File

@ -33,7 +33,8 @@ RUNTIME_FUNCTION(Runtime_TransitionElementsKind) {
.IsNothing()) {
// TODO(victorgomes): EffectControlLinearizer::LowerTransitionElementsKind
// does not handle exceptions.
FATAL("Fatal JavaScript invalid array size");
FATAL(
"Fatal JavaScript invalid size error when transitioning elements kind");
UNREACHABLE();
}
return *object;