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

Unified Diff: src/runtime/runtime-scopes.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-regexp.cc ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-scopes.cc
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index d078c38a93ad54fc8db0c7304f7aa44564acc766..bf5ecb88d55ca5cc85fa42e26576d219289fa3a6 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -162,10 +162,8 @@ RUNTIME_FUNCTION(Runtime_InitializeVarGlobal) {
CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
Handle<JSGlobalObject> global(isolate->context()->global_object());
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, Object::SetProperty(global, name, value, language_mode));
- return *result;
+ RETURN_RESULT_OR_FAILURE(
+ isolate, Object::SetProperty(global, name, value, language_mode));
}
@@ -923,10 +921,8 @@ RUNTIME_FUNCTION(Runtime_LoadLookupSlot) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
- Handle<Object> value;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, value, LoadLookupSlot(name, Object::THROW_ON_ERROR));
- return *value;
+ RETURN_RESULT_OR_FAILURE(isolate,
+ LoadLookupSlot(name, Object::THROW_ON_ERROR));
}
@@ -934,10 +930,7 @@ RUNTIME_FUNCTION(Runtime_LoadLookupSlotInsideTypeof) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
- Handle<Object> value;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, value, LoadLookupSlot(name, Object::DONT_THROW));
- return *value;
+ RETURN_RESULT_OR_FAILURE(isolate, LoadLookupSlot(name, Object::DONT_THROW));
}
@@ -1021,9 +1014,7 @@ RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Sloppy) {
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value,
- StoreLookupSlot(name, value, SLOPPY));
- return *value;
+ RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, SLOPPY));
}
@@ -1032,9 +1023,7 @@ RUNTIME_FUNCTION(Runtime_StoreLookupSlot_Strict) {
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(String, name, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value,
- StoreLookupSlot(name, value, STRICT));
- return *value;
+ RETURN_RESULT_OR_FAILURE(isolate, StoreLookupSlot(name, value, STRICT));
}
} // namespace internal
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698