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

Unified Diff: src/builtins.cc

Issue 1776913005: Simplify the interface of PropertyCallbackArguments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« src/api-arguments.h ('K') | « src/api-arguments.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index eb9524f1f72c8dc7595409b1c25ddf1476956b29..eef61042b84f49a9f6c4aea751bf9203c74d5559 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -3970,14 +3970,8 @@ MUST_USE_RESULT MaybeHandle<Object> HandleApiCallHelper(
args.length() - 1,
is_construct);
- v8::Local<v8::Value> value = custom.Call(callback);
- Handle<Object> result;
- if (value.IsEmpty()) {
- result = isolate->factory()->undefined_value();
- } else {
- result = v8::Utils::OpenHandle(*value);
- result->VerifyApiCallResultType();
- }
+ Handle<Object> result = custom.Call(callback);
+ if (result.is_null()) result = isolate->factory()->undefined_value();
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (!is_construct || result->IsJSObject()) {
@@ -4144,8 +4138,6 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Handle<HeapObject> function,
MUST_USE_RESULT static Object* HandleApiCallAsFunctionOrConstructor(
Isolate* isolate, bool is_construct_call,
BuiltinArguments<BuiltinExtraArguments::kNone> args) {
- Heap* heap = isolate->heap();
-
Handle<Object> receiver = args.receiver();
// Get the object called.
@@ -4180,12 +4172,11 @@ MUST_USE_RESULT static Object* HandleApiCallAsFunctionOrConstructor(
&args[0] - 1,
args.length() - 1,
is_construct_call);
- v8::Local<v8::Value> value = custom.Call(callback);
- if (value.IsEmpty()) {
- result = heap->undefined_value();
+ Handle<Object> result_handle = custom.Call(callback);
+ if (result_handle.is_null()) {
+ result = isolate->heap()->undefined_value();
} else {
- result = *reinterpret_cast<Object**>(*value);
- result->VerifyApiCallResultType();
+ result = *result_handle;
}
}
// Check for exceptions and return result.
« src/api-arguments.h ('K') | « src/api-arguments.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698