Chromium Code Reviews| Index: src/runtime/runtime-internal.cc |
| diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
| index e0e583e4021122d75999f9c1de54b5c08da14c00..1c1495ca1f9eb92f96e92ca03dc9113f8f718c76 100644 |
| --- a/src/runtime/runtime-internal.cc |
| +++ b/src/runtime/runtime-internal.cc |
| @@ -416,5 +416,19 @@ 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); |
| + if (it.frame()->type() != StackFrame::STUB) { |
|
Michael Starzinger
2015/06/05 11:21:56
nit: Let's use RUNTIME_ASSERT(it.frame()->type() =
danno
2015/06/05 11:49:59
Done.
|
| + return isolate->ThrowIllegalOperation(); |
| + } |
| + it.Advance(); |
| + if (it.frame()->type() != StackFrame::JAVA_SCRIPT) { |
|
Michael Starzinger
2015/06/05 11:21:56
nit: Let's use RUNTIME_ASSERT(it.frame()->type() =
danno
2015/06/05 11:49:59
Done.
|
| + return isolate->ThrowIllegalOperation(); |
| + } |
| + return JavaScriptFrame::cast(it.frame())->function(); |
| +} |
| } // namespace internal |
| } // namespace v8 |