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

Unified Diff: src/builtins.cc

Issue 1041753002: fast path for api function creation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/builtins.h ('k') | src/execution.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 2457a956a7a801c59f6885aad59d3ca79b150bca..0b93b9ee8997be21b0e3c062f5b1eeaef7700044 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1147,8 +1147,8 @@ class RelocatableArguments : public BuiltinArguments<NEEDS_CALLED_FUNCTION>,
MaybeHandle<Object> Builtins::InvokeApiFunction(Handle<JSFunction> function,
Handle<Object> receiver,
- int argc,
- Handle<Object> args[]) {
+ int argc, Handle<Object> args[],
+ bool is_construct) {
// Construct BuiltinArguments object: function, arguments reversed, receiver.
const int kBufferSize = 32;
Object* small_argv[kBufferSize];
@@ -1167,7 +1167,11 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Handle<JSFunction> function,
{
auto isolate = function->GetIsolate();
RelocatableArguments arguments(isolate, argc + 2, &argv[argc + 1]);
- result = HandleApiCallHelper<false>(isolate, arguments);
+ if (is_construct) {
+ result = HandleApiCallHelper<true>(isolate, arguments);
+ } else {
+ result = HandleApiCallHelper<false>(isolate, arguments);
+ }
}
if (argv != small_argv) {
delete[] argv;
« no previous file with comments | « src/builtins.h ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698