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

Unified Diff: src/ic/x64/handler-compiler-x64.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: 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
Index: src/ic/x64/handler-compiler-x64.cc
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc
index 6bc3aafa89fe8353fd0ff6304b7f8ac3036021e1..77a09753d62fa3ca0129bb1d8b944ecd512ee1bd 100644
--- a/src/ic/x64/handler-compiler-x64.cc
+++ b/src/ic/x64/handler-compiler-x64.cc
@@ -188,6 +188,14 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset));
}
+ if (api_call_info->callback()->IsCode()) {
+ // Just tail call into the code.
+ __ Move(rdx, handle(Code::cast(api_call_info->callback())));
Benedikt Meurer 2015/11/12 04:31:21 You should be able to use __ Jump(code, RelocInfo:
epertoso 2015/11/13 01:39:28 Done.
+ __ addp(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag));
+ __ jmp(rdx);
+ return;
+ }
+
// Put api_function_address in place.
Address function_address = v8::ToCData<Address>(api_call_info->callback());
__ Move(api_function_address, function_address,

Powered by Google App Engine
This is Rietveld 408576698