830 // Technically it occurs at the Constant that materializes the base 831 // of the static fields but it's simpler to model it here. 832 bool is_init_point() const { return is_static() && (needs_patching() || !_field->holder()->is_initialized()); } 833 834 // manipulation 835 836 // Under certain circumstances, if a previous NullCheck instruction 837 // proved the target object non-null, we can eliminate the explicit 838 // null check and do an implicit one, simply specifying the debug 839 // information from the NullCheck. This field should only be consulted 840 // if needs_null_check() is true. 841 void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; } 842 843 // generic 844 virtual bool can_trap() const { return needs_null_check() || needs_patching(); } 845 virtual void input_values_do(ValueVisitor* f) { f->visit(&_obj); } 846 }; 847 848 849 LEAF(LoadField, AccessField) 850 ciValueKlass* _value_klass; 851 Value _default_value; 852 public: 853 // creation 854 LoadField(Value obj, int offset, ciField* field, bool is_static, 855 ValueStack* state_before, bool needs_patching, 856 ciValueKlass* value_klass = NULL, Value default_value = NULL ) 857 : AccessField(obj, offset, field, is_static, state_before, needs_patching) 858 , _value_klass(value_klass), _default_value(default_value) 859 {} 860 861 ciType* declared_type() const; 862 863 // generic 864 HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile 865 866 ciValueKlass* value_klass() const { return _value_klass;} 867 Value default_value() const { return _default_value; } 868 }; 869 870 871 LEAF(StoreField, AccessField) 872 private: 873 Value _value; 874 875 public: 876 // creation 877 StoreField(Value obj, int offset, ciField* field, Value value, bool is_static, 878 ValueStack* state_before, bool needs_patching) 879 : AccessField(obj, offset, field, is_static, state_before, needs_patching) 880 , _value(value) 881 { 882 set_flag(NeedsWriteBarrierFlag, as_ValueType(field_type())->is_object()); 883 ASSERT_VALUES 884 pin(); 885 } 886 887 // accessors | 830 // Technically it occurs at the Constant that materializes the base 831 // of the static fields but it's simpler to model it here. 832 bool is_init_point() const { return is_static() && (needs_patching() || !_field->holder()->is_initialized()); } 833 834 // manipulation 835 836 // Under certain circumstances, if a previous NullCheck instruction 837 // proved the target object non-null, we can eliminate the explicit 838 // null check and do an implicit one, simply specifying the debug 839 // information from the NullCheck. This field should only be consulted 840 // if needs_null_check() is true. 841 void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; } 842 843 // generic 844 virtual bool can_trap() const { return needs_null_check() || needs_patching(); } 845 virtual void input_values_do(ValueVisitor* f) { f->visit(&_obj); } 846 }; 847 848 849 LEAF(LoadField, AccessField) 850 public: 851 // creation 852 LoadField(Value obj, int offset, ciField* field, bool is_static, 853 ValueStack* state_before, bool needs_patching, 854 ciValueKlass* value_klass = NULL, Value default_value = NULL ) 855 : AccessField(obj, offset, field, is_static, state_before, needs_patching) 856 {} 857 858 ciType* declared_type() const; 859 860 // generic 861 HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile 862 }; 863 864 865 LEAF(StoreField, AccessField) 866 private: 867 Value _value; 868 869 public: 870 // creation 871 StoreField(Value obj, int offset, ciField* field, Value value, bool is_static, 872 ValueStack* state_before, bool needs_patching) 873 : AccessField(obj, offset, field, is_static, state_before, needs_patching) 874 , _value(value) 875 { 876 set_flag(NeedsWriteBarrierFlag, as_ValueType(field_type())->is_object()); 877 ASSERT_VALUES 878 pin(); 879 } 880 881 // accessors |