Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 1305f8b5c813ff1a5d814d2c8d73609170684c2c..0b80effbf21e86138f7e66ea6290998d3922b7de 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -8277,6 +8277,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeoptimizeFunction) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { |
+ HandleScope scope(isolate); |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
+ Code* unoptimized = function->shared()->code(); |
+ if (unoptimized->kind() == Code::FUNCTION) { |
+ unoptimized->ClearInlineCaches(); |
+ unoptimized->ClearTypeFeedbackCells(isolate->heap()); |
+ } |
+ return isolate->heap()->undefined_value(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { |
#if defined(USE_SIMULATOR) |
return isolate->heap()->true_value(); |