Remove the data field from MonoVTable to reduce memory usage.
[mono.git] / mono / mini / method-to-ir.c
index b11a4cc4a305c3f455f0537aa4247463796181f3..ebf6dabbf1ae6745e56c6aacb5ba36d55c71cf67 100644 (file)
@@ -8936,7 +8936,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                        }
                                                }
                                        }
-                                       addr = (char*)vtable->data + field->offset;
+                                       addr = (char*)mono_vtable_get_static_field_data (vtable) + field->offset;
 
                                        if (cfg->compile_aot)
                                                EMIT_NEW_SFLDACONST (cfg, ins, field);
@@ -8972,7 +8972,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                }
                                if (!context_used && !((cfg->opt & MONO_OPT_SHARED) || cfg->compile_aot) && 
                                    vtable->initialized && (ftype->attrs & FIELD_ATTRIBUTE_INIT_ONLY)) {
-                                       gpointer addr = (char*)vtable->data + field->offset;
+                                       gpointer addr = (char*)mono_vtable_get_static_field_data (vtable) + field->offset;
                                        int ro_type = ftype->type;
                                        if (ro_type == MONO_TYPE_VALUETYPE && ftype->data.klass->enumtype) {
                                                ro_type = mono_class_enum_basetype (ftype->data.klass)->type;