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

Unified Diff: src/runtime/runtime-internal.cc

Issue 2006673002: Reduce boilerplace for common pattern to return MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase and fix Created 4 years, 7 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 | « src/runtime/runtime-i18n.cc ('k') | src/runtime/runtime-json.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index f805fdb74f346737254339dbf2150c87d21417f7..7a6c5362b0cc759884f4dc957f9eb037ab51574e 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -369,12 +369,9 @@ RUNTIME_FUNCTION(Runtime_FormatMessageString) {
CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1);
CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2);
CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3);
- Handle<String> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- MessageTemplate::FormatMessage(template_index, arg0, arg1, arg2));
isolate->native_context()->IncrementErrorsThrown();
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate, MessageTemplate::FormatMessage(
+ template_index, arg0, arg1, arg2));
}
#define CALLSITE_GET(NAME, RETURN) \
@@ -515,11 +512,8 @@ RUNTIME_FUNCTION(Runtime_CreateListFromArrayLike) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
- Handle<FixedArray> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Object::CreateListFromArrayLike(isolate, object, ElementTypes::kAll));
- return *result;
+ RETURN_RESULT_OR_FAILURE(isolate, Object::CreateListFromArrayLike(
+ isolate, object, ElementTypes::kAll));
}
@@ -597,10 +591,8 @@ RUNTIME_FUNCTION(Runtime_OrdinaryHasInstance) {
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, callable, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, object, 1);
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, Object::OrdinaryHasInstance(isolate, callable, object));
- return *result;
+ RETURN_RESULT_OR_FAILURE(
+ isolate, Object::OrdinaryHasInstance(isolate, callable, object));
}
} // namespace internal
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | src/runtime/runtime-json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698