You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2022/12/13 18:06:59 UTC

[groovy] branch GROOVY_4_0_X updated: Trivial refactoring: refine field name

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
     new e528eec3ef Trivial refactoring: refine field name
e528eec3ef is described below

commit e528eec3ef8a34a576bb5d3c80283ba8c788d73e
Author: Daniel Sun <su...@apache.org>
AuthorDate: Wed Dec 14 02:05:52 2022 +0800

    Trivial refactoring: refine field name
    
    (cherry picked from commit d47ed2d782b51a114a3106d0674cac0355eda137)
---
 .../java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.java b/src/main/java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.java
index 5f69dd87da..a356f0a20c 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.java
@@ -38,7 +38,7 @@ public class CacheableCallSite extends MutableCallSite {
     private static final int CACHE_SIZE = SystemUtil.getIntegerSafe("groovy.indy.callsite.cache.size", 4);
     private static final float LOAD_FACTOR = 0.75f;
     private static final int INITIAL_CAPACITY = (int) Math.ceil(CACHE_SIZE / LOAD_FACTOR) + 1;
-    private volatile SoftReference<MethodHandleWrapper> methodHandleWrapperSoftReference = null;
+    private volatile SoftReference<MethodHandleWrapper> latestHitMethodHandleWrapperSoftReference = null;
     private final AtomicLong fallbackCount = new AtomicLong();
     private MethodHandle defaultTarget;
     private MethodHandle fallbackTarget;
@@ -72,7 +72,7 @@ public class CacheableCallSite extends MutableCallSite {
                 lruCache.put(className, resultSoftReference);
             }
         }
-        final SoftReference<MethodHandleWrapper> mhwsr = methodHandleWrapperSoftReference;
+        final SoftReference<MethodHandleWrapper> mhwsr = latestHitMethodHandleWrapperSoftReference;
         final MethodHandleWrapper methodHandleWrapper = null == mhwsr ? null : mhwsr.get();
 
         if (methodHandleWrapper == result) {
@@ -80,7 +80,7 @@ public class CacheableCallSite extends MutableCallSite {
         } else {
             result.resetLatestHitCount();
             if (null != methodHandleWrapper) methodHandleWrapper.resetLatestHitCount();
-            methodHandleWrapperSoftReference = resultSoftReference;
+            latestHitMethodHandleWrapperSoftReference = resultSoftReference;
         }
 
         return result;