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

Unified Diff: src/runtime.cc

Issue 247013002: Replaced empty handle checks with MaybeHandles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed unnecessary assert. Created 6 years, 8 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/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index b4136424145111fbbac0004896f8a0b0f879515d..34211541f8885463d13105cab970bda559d29899 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -512,8 +512,9 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_CreateObjectLiteral) {
AllocationSiteCreationContext creation_context(isolate);
site = creation_context.EnterNewScope();
- RETURN_IF_EMPTY_HANDLE(isolate,
- JSObject::DeepWalk(boilerplate, &creation_context));
+ RETURN_FAILURE_ON_EXCEPTION(
+ isolate,
+ JSObject::DeepWalk(boilerplate, &creation_context));
creation_context.ExitScope(site, boilerplate);
// Update the functions literal and return the boilerplate.
@@ -526,9 +527,11 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_CreateObjectLiteral) {
AllocationSiteUsageContext usage_context(isolate, site, true);
usage_context.EnterNewScope();
- Handle<Object> copy = JSObject::DeepCopy(boilerplate, &usage_context);
+ MaybeHandle<Object> maybe_copy = JSObject::DeepCopy(
+ boilerplate, &usage_context);
usage_context.ExitScope(site, boilerplate);
- RETURN_IF_EMPTY_HANDLE(isolate, copy);
+ Handle<Object> copy;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, copy, maybe_copy);
return *copy;
}
@@ -586,8 +589,8 @@ static MaybeHandle<JSObject> CreateArrayLiteralImpl(Isolate* isolate,
JSObject::DeepCopyHints hints = (flags & ArrayLiteral::kShallowElements) == 0
? JSObject::kNoHints
: JSObject::kObjectIsShallowArray;
- Handle<JSObject> copy = JSObject::DeepCopy(boilerplate, &usage_context,
- hints);
+ MaybeHandle<JSObject> copy = JSObject::DeepCopy(boilerplate, &usage_context,
+ hints);
usage_context.ExitScope(site, boilerplate);
return copy;
}
@@ -1759,9 +1762,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) {
}
if (obj->map()->is_observed()) {
Handle<Object> old_value = GetPrototypeSkipHiddenPrototypes(isolate, obj);
-
- Handle<Object> result = JSObject::SetPrototype(obj, prototype, true);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ JSObject::SetPrototype(obj, prototype, true));
Handle<Object> new_value = GetPrototypeSkipHiddenPrototypes(isolate, obj);
if (!new_value->SameValue(*old_value)) {
@@ -1771,8 +1775,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) {
}
return *result;
}
- Handle<Object> result = JSObject::SetPrototype(obj, prototype, true);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ JSObject::SetPrototype(obj, prototype, true));
return *result;
}
@@ -2600,11 +2606,10 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_RegExpExec) {
RUNTIME_ASSERT(index >= 0);
RUNTIME_ASSERT(index <= subject->length());
isolate->counters()->regexp_entry_runtime()->Increment();
- Handle<Object> result = RegExpImpl::Exec(regexp,
- subject,
- index,
- last_match_info);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ RegExpImpl::Exec(regexp, subject, index, last_match_info));
return *result;
}
@@ -14845,7 +14850,6 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate,
Handle<Map> initial_map(constructor->initial_map(), isolate);
if (to_kind != initial_map->elements_kind()) {
initial_map = Map::AsElementsKind(initial_map, to_kind);
- RETURN_IF_EMPTY_HANDLE(isolate, initial_map);
}
// If we don't care to track arrays of to_kind ElementsKind, then
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698