--- a/src/hotspot/share/code/icBuffer.hpp Fri Dec 07 11:15:18 2018 +0100
+++ b/src/hotspot/share/code/icBuffer.hpp Fri Dec 07 13:15:35 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,9 @@
#include "code/stubs.hpp"
#include "interpreter/bytecodes.hpp"
#include "memory/allocation.hpp"
+#include "runtime/safepointVerifiers.hpp"
#include "utilities/align.hpp"
+#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
//
@@ -93,6 +95,43 @@
return stub;
}
+#ifdef ASSERT
+// The ICRefillVerifier class is a stack allocated RAII object used to
+// detect if a failed IC transition that required IC stub refilling has
+// been accidentally missed. It is up to the caller to in that case
+// refill IC stubs.
+class ICRefillVerifier: StackObj {
+ bool _refill_requested;
+ bool _refill_remembered;
+
+ public:
+ ICRefillVerifier();
+ ~ICRefillVerifier();
+
+ void request_refill() { _refill_requested = true; }
+ void request_remembered() { _refill_remembered = true; }
+};
+
+// The ICRefillVerifierMark is used to set the thread's current
+// ICRefillVerifier to a provided one. This is useful in particular
+// when transitioning IC stubs in parallel and refilling from the
+// master thread invoking the IC stub transitioning code.
+class ICRefillVerifierMark: StackObj {
+ public:
+ ICRefillVerifierMark(ICRefillVerifier* verifier);
+ ~ICRefillVerifierMark();
+};
+#else
+class ICRefillVerifier: StackObj {
+ public:
+ ICRefillVerifier() {}
+};
+class ICRefillVerifierMark: StackObj {
+ public:
+ ICRefillVerifierMark(ICRefillVerifier* verifier) {}
+};
+#endif
+
class InlineCacheBuffer: public AllStatic {
private:
// friends
@@ -105,8 +144,6 @@
static CompiledICHolder* _pending_released;
static int _pending_count;
- DEBUG_ONLY(static volatile int _needs_refill;)
-
static StubQueue* buffer() { return _buffer; }
static ICStub* new_ic_stub();