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

Unified Diff: src/objects.cc

Issue 2089703004: Further streamline HandleApiCall (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 6d82325e5b210797ec8087cfcf6f74ec49735bb7..fd4b397d2bf074090a0a4359cbf37b0778b2234f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -988,11 +988,6 @@ bool Object::ToInt32(int32_t* value) {
return false;
}
-bool FunctionTemplateInfo::IsTemplateFor(JSObject* object) {
- return IsTemplateFor(object->map());
-}
-
-
bool FunctionTemplateInfo::IsTemplateFor(Map* map) {
// There is a constraint on the object; check.
if (!map->IsJSObjectMap()) return false;
@@ -1156,16 +1151,9 @@ MaybeHandle<Object> Object::GetPropertyWithAccessor(LookupIterator* it) {
// Regular accessor.
Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate);
if (getter->IsFunctionTemplateInfo()) {
- auto result = Builtins::InvokeApiFunction(
- Handle<FunctionTemplateInfo>::cast(getter), receiver, 0, nullptr);
- if (isolate->has_pending_exception()) {
- return MaybeHandle<Object>();
- }
- Handle<Object> return_value;
- if (result.ToHandle(&return_value)) {
- return_value->VerifyApiCallResultType();
- return handle(*return_value, isolate);
- }
+ return Builtins::InvokeApiFunction(
+ isolate, Handle<FunctionTemplateInfo>::cast(getter), receiver, 0,
+ nullptr);
} else if (getter->IsCallable()) {
// TODO(rossberg): nicer would be to cast to some JSCallable here...
return Object::GetPropertyWithDefinedGetter(
@@ -1245,12 +1233,11 @@ Maybe<bool> Object::SetPropertyWithAccessor(LookupIterator* it,
Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate);
if (setter->IsFunctionTemplateInfo()) {
Handle<Object> argv[] = {value};
- auto result =
- Builtins::InvokeApiFunction(Handle<FunctionTemplateInfo>::cast(setter),
- receiver, arraysize(argv), argv);
- if (isolate->has_pending_exception()) {
- return Nothing<bool>();
- }
+ RETURN_ON_EXCEPTION_VALUE(
+ isolate, Builtins::InvokeApiFunction(
+ isolate, Handle<FunctionTemplateInfo>::cast(setter),
+ receiver, arraysize(argv), argv),
+ Nothing<bool>());
return Just(true);
} else if (setter->IsCallable()) {
// TODO(rossberg): nicer would be to cast to some JSCallable here...
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698