mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-07 21:48:41 +00:00
8005873: JRuby test_respond_to.rb asserts with: MT-unsafe modification of inline cache
Reviewed-by: vlivanov, jrose, psandoz
This commit is contained in:
parent
1618f90bc9
commit
4d074d6309
@ -607,7 +607,7 @@ class LambdaForm {
|
||||
assert(m.getName().equals("interpret" + sig.substring(sig.indexOf('_'))));
|
||||
LambdaForm form = new LambdaForm(sig);
|
||||
form.vmentry = m;
|
||||
mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
|
||||
form = mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
|
||||
// FIXME: get rid of PREPARED_FORMS; use MethodTypeForm cache only
|
||||
forms.put(sig, form);
|
||||
}
|
||||
|
||||
@ -692,8 +692,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
|
||||
lform = new LambdaForm("guardWithCatch", lambdaType.parameterCount(), names);
|
||||
|
||||
basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
|
||||
return lform;
|
||||
return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
|
||||
}
|
||||
|
||||
static
|
||||
|
||||
@ -91,8 +91,10 @@ final class MethodTypeForm {
|
||||
return lambdaForms[which];
|
||||
}
|
||||
|
||||
public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
|
||||
// Should we perform some sort of CAS, to avoid racy duplication?
|
||||
synchronized public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
|
||||
// Simulate a CAS, to avoid racy duplication of results.
|
||||
LambdaForm prev = lambdaForms[which];
|
||||
if (prev != null) return prev;
|
||||
return lambdaForms[which] = form;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user