Commit 1f386f4f authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[runtime] Add %ClearMegamorphicStubCache() intrinsic.

This adds a new %ClearMegamorphicStubCache() runtime function, which can
be used to easily wipe the megamorphic stub cache. This is useful when
investigating performance issues that are related to high contention on
the megamorphic stub cache.

Change-Id: I7abb496bf1dd658298a90065241dd317f2fb6624
Reviewed-on: https://chromium-review.googlesource.com/c/1459637
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59456}
parent 9b2bcf57
......@@ -16,6 +16,7 @@
#include "src/counters.h"
#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/ic/stub-cache.h"
#include "src/isolate-inl.h"
#include "src/objects/heap-object-inl.h"
#include "src/objects/smi.h"
......@@ -103,6 +104,14 @@ bool WasmInstanceOverride(const v8::FunctionCallbackInfo<v8::Value>& args) {
} // namespace
RUNTIME_FUNCTION(Runtime_ClearMegamorphicStubCache) {
HandleScope scope(isolate);
DCHECK_EQ(0, args.length());
isolate->load_stub_cache()->Clear();
isolate->store_stub_cache()->Clear();
return ReadOnlyRoots(isolate).undefined_value();
}
RUNTIME_FUNCTION(Runtime_ConstructDouble) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
......
......@@ -433,6 +433,7 @@ namespace internal {
F(SymbolIsPrivate, 1, 1)
#define FOR_EACH_INTRINSIC_TEST(F, I) \
F(ClearMegamorphicStubCache, 0, 1) \
F(Abort, 1, 1) \
F(AbortJS, 1, 1) \
F(ClearFunctionFeedback, 1, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment