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

Unified Diff: src/api-natives.cc

Issue 1407313004: Adds the possibility of setting a Code object as the callback of a FunctionTemplate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 5 years, 1 month 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
« include/v8.h ('K') | « src/api.cc ('k') | src/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index d8dd1510417641197da707cf27f79e51586886d3..b14bfbb4c71b52fbb0a001ae2f4228282dc68fa1 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -438,7 +438,15 @@ void ApiNatives::AddNativeDataProperty(Isolate* isolate,
Handle<JSFunction> ApiNatives::CreateApiFunction(
Isolate* isolate, Handle<FunctionTemplateInfo> obj,
Handle<Object> prototype, ApiInstanceType instance_type) {
- Handle<Code> code = isolate->builtins()->HandleApiCall();
+ Handle<Code> code;
+ if (obj->call_code()->IsCallHandlerInfo() &&
+ !handle(CallHandlerInfo::cast(obj->call_code()))
Toon Verwaest 2015/11/18 08:51:46 Why is this wrapped in a handle before calling fas
epertoso 2015/11/20 15:27:13 Removed.
+ ->fast_handler()
+ ->IsUndefined()) {
vogelheim 2015/11/18 17:30:05 nitpick: Why !..->IsUndefined(), instead of ...->I
epertoso 2015/11/20 15:27:13 Done.
+ code = isolate->builtins()->HandleFastApiCall();
+ } else {
+ code = isolate->builtins()->HandleApiCall();
+ }
Handle<Code> construct_stub = isolate->builtins()->JSConstructStubApi();
obj->set_instantiated(true);
« include/v8.h ('K') | « src/api.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698