File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/java/org/truffleruby/stdlib Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 10
10
package org .truffleruby .stdlib ;
11
11
12
12
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
13
+ import com .oracle .truffle .api .dsl .Cached ;
13
14
import com .oracle .truffle .api .dsl .Specialization ;
14
15
import com .oracle .truffle .api .object .DynamicObject ;
15
16
import org .truffleruby .Layouts ;
@@ -32,8 +33,6 @@ public abstract class ObjSpaceNodes {
32
33
@ CoreMethod (names = "memsize_of" , isModuleFunction = true , required = 1 )
33
34
public abstract static class MemsizeOfNode extends CoreMethodArrayArgumentsNode {
34
35
35
- @ Child private ValuesNode matchDataValues = ValuesNode .create ();
36
-
37
36
@ Specialization (guards = "isNil(object)" )
38
37
public int memsizeOfNil (DynamicObject object ) {
39
38
return 0 ;
@@ -55,7 +54,8 @@ public int memsizeOfString(DynamicObject object) {
55
54
}
56
55
57
56
@ Specialization (guards = "isRubyMatchData(object)" )
58
- public int memsizeOfMatchData (DynamicObject object ) {
57
+ public int memsizeOfMatchData (DynamicObject object ,
58
+ @ Cached ("create()" ) ValuesNode matchDataValues ) {
59
59
return memsizeOfObject (object ) + matchDataValues .execute (object ).length ;
60
60
}
61
61
You can’t perform that action at this time.
0 commit comments