Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8260283: [lworld] C1's EliminateFieldAccess optimization fails with "wrong types" #311

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1912,6 +1912,7 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
obj = pending_field_access()->obj();
offset += pending_field_access()->offset() - field->holder()->as_inline_klass()->first_field_offset();
field = pending_field_access()->field()->holder()->get_field_by_offset(offset, false);
assert(field != NULL, "field not found");
set_pending_field_access(NULL);
} else if (has_pending_load_indexed()) {
assert(!needs_patching, "Can't patch delayed field access");
@@ -1963,7 +1964,7 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
if (has_pending_load_indexed()) {
pending_load_indexed()->update(field, offset - field->holder()->as_inline_klass()->first_field_offset());
} else if (has_pending_field_access()) {
pending_field_access()->update(field, offset - field->holder()->as_inline_klass()->first_field_offset());
pending_field_access()->inc_offset(offset - field->holder()->as_inline_klass()->first_field_offset());
} else {
null_check(obj);
DelayedFieldAccess* dfa = new DelayedFieldAccess(obj, field, field->offset());
@@ -37,22 +37,17 @@ class MemoryBuffer;

class DelayedFieldAccess : public CompilationResourceObj {
private:
Value _obj;
Value _obj;
ciField* _field;
int _offset;
int _offset;
public:
DelayedFieldAccess(Value obj, ciField* field, int offset)
: _obj(obj)
, _field(field)
, _offset(offset) { }
: _obj(obj), _field(field) , _offset(offset) { }

void update(ciField* field, int offset) {
_field = field;
_offset += offset;
}
Value obj() { return _obj; }
ciField* field() { return _field; }
int offset() { return _offset; }
Value obj() const { return _obj; }
ciField* field() const { return _field; }
int offset() const { return _offset; }
void inc_offset(int offset) { _offset += offset; }
};

class GraphBuilder {