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

Unified Diff: src/runtime/runtime-internal.cc

Issue 1146963002: Add %GetCallerJSFunction intrinsic (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 6 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/runtime/runtime.h ('k') | test/mjsunit/get-caller-js-function.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index e0e583e4021122d75999f9c1de54b5c08da14c00..294e4fb138ea92769546a1270931a80d406e5839 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -416,5 +416,15 @@ RUNTIME_FUNCTION(Runtime_GetTypeFeedbackVector) {
CONVERT_ARG_CHECKED(JSFunction, function, 0);
return function->shared()->feedback_vector();
}
+
+
+RUNTIME_FUNCTION(Runtime_GetCallerJSFunction) {
+ SealHandleScope shs(isolate);
+ StackFrameIterator it(isolate);
+ RUNTIME_ASSERT(it.frame()->type() == StackFrame::STUB);
+ it.Advance();
+ RUNTIME_ASSERT(it.frame()->type() == StackFrame::JAVA_SCRIPT);
+ return JavaScriptFrame::cast(it.frame())->function();
+}
} // namespace internal
} // namespace v8
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/get-caller-js-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698