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

Unified Diff: src/builtins.cc

Issue 1756973002: Reland "[api] Don't go to javascript to construct API functions" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/builtins.h ('k') | src/execution.cc » ('j') | src/execution.cc » ('J')
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 18f398d7d6192fdb8f9ed8a90f60309dbaa4e5bc..c4b97c68e5cd7ea313f04e9c06c0bae74ca4831e 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -4153,7 +4153,8 @@ class RelocatableArguments
} // namespace
-MaybeHandle<Object> Builtins::InvokeApiFunction(Handle<HeapObject> function,
+MaybeHandle<Object> Builtins::InvokeApiFunction(bool is_construct,
+ Handle<HeapObject> function,
Handle<Object> receiver,
int argc,
Handle<Object> args[]) {
@@ -4175,7 +4176,8 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Handle<HeapObject> function,
{
auto isolate = function->GetIsolate();
RelocatableArguments arguments(isolate, argc + 2, &argv[argc + 1]);
- result = HandleApiCallHelper<false>(isolate, arguments);
+ result = is_construct ? HandleApiCallHelper<true>(isolate, arguments)
+ : HandleApiCallHelper<false>(isolate, arguments);
}
if (argv != small_argv) {
delete[] argv;
« no previous file with comments | « src/builtins.h ('k') | src/execution.cc » ('j') | src/execution.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698