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

Unified Diff: src/stub-cache.cc

Issue 225673003: Return MaybeHandle from GetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 2a683d870813ef5187bf899154124846c87bbc9d..4a200b9e3b6d72aec879042803800a57d5c577bc 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -569,8 +569,9 @@ static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) {
}
-static Handle<Object> LoadWithInterceptor(Arguments* args,
- PropertyAttributes* attrs) {
+MUST_USE_RESULT static MaybeHandle<Object> LoadWithInterceptor(
+ Arguments* args,
+ PropertyAttributes* attrs) {
ASSERT(args->length() == StubCache::kInterceptorArgsLength);
Handle<Name> name_handle =
args->at<Name>(StubCache::kInterceptorArgsNameIndex);
@@ -604,7 +605,7 @@ static Handle<Object> LoadWithInterceptor(Arguments* args,
// Use the interceptor getter.
v8::Handle<v8::Value> r =
callback_args.Call(getter, v8::Utils::ToLocal(name));
- RETURN_HANDLE_IF_SCHEDULED_EXCEPTION(isolate, Object);
+ RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (!r.IsEmpty()) {
*attrs = NONE;
Handle<Object> result = v8::Utils::OpenHandle(*r);
@@ -613,9 +614,8 @@ static Handle<Object> LoadWithInterceptor(Arguments* args,
}
}
- Handle<Object> result = JSObject::GetPropertyPostInterceptor(
+ return JSObject::GetPropertyPostInterceptor(
holder_handle, receiver_handle, name_handle, attrs);
- return result;
}
@@ -626,8 +626,9 @@ static Handle<Object> LoadWithInterceptor(Arguments* args,
RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad) {
PropertyAttributes attr = NONE;
HandleScope scope(isolate);
- Handle<Object> result = LoadWithInterceptor(&args, &attr);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result, LoadWithInterceptor(&args, &attr));
// If the property is present, return it.
if (attr != ABSENT) return *result;
@@ -638,8 +639,9 @@ RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad) {
RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall) {
PropertyAttributes attr;
HandleScope scope(isolate);
- Handle<Object> result = LoadWithInterceptor(&args, &attr);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result, LoadWithInterceptor(&args, &attr));
// This is call IC. In this case, we simply return the undefined result which
// will lead to an exception when trying to invoke the result as a
// function.
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698