comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java @ 1452:9b22e3e5df8e

Solved an issue with unresolved field patching.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Fri, 12 Nov 2010 18:04:27 +0100
parents 8c121f2190f8
children d603bdbec024
comparison
equal deleted inserted replaced
1451:8c121f2190f8 1452:9b22e3e5df8e
811 return new XirSnippet(exceptionObjectTemplates.get(site)); 811 return new XirSnippet(exceptionObjectTemplates.get(site));
812 } 812 }
813 813
814 @Override 814 @Override
815 public XirSnippet genResolveClass(XirSite site, RiType type, Representation rep) { 815 public XirSnippet genResolveClass(XirSite site, RiType type, Representation rep) {
816 assert rep == Representation.ObjectHub || rep == Representation.StaticFields : "unexpected representation: " + rep; 816 assert rep == Representation.ObjectHub || rep == Representation.StaticFields || rep == Representation.JavaClass : "unexpected representation: " + rep;
817 if (type instanceof HotSpotTypeResolved) { 817 if (type instanceof HotSpotTypeResolved) {
818 return new XirSnippet(resolveClassTemplates.get(site), XirArgument.forObject(type)); 818 return new XirSnippet(resolveClassTemplates.get(site), XirArgument.forObject(type));
819 } 819 }
820 return new XirSnippet(resolveClassTemplates.get(site, UNRESOLVED)); 820 return new XirSnippet(resolveClassTemplates.get(site, UNRESOLVED));
821 } 821 }
992 assert state == State.New; 992 assert state == State.New;
993 993
994 asm.bindInline(patchSite); 994 asm.bindInline(patchSite);
995 asm.mark(MARK_DUMMY_OOP_RELOCATION); 995 asm.mark(MARK_DUMMY_OOP_RELOCATION);
996 asm.jmp(patchStub); 996 asm.jmp(patchStub);
997
998 // TODO(tw): Need a safepoint here?
997 999
998 // TODO: make this more generic & safe - this is needed to create space for patching 1000 // TODO: make this more generic & safe - this is needed to create space for patching
999 asm.nop(5); 1001 asm.nop(5);
1000 1002
1001 state = State.Inline; 1003 state = State.Inline;
1057 } 1059 }
1058 asm.bindInline(patchSite); 1060 asm.bindInline(patchSite);
1059 asm.mark(MARK_DUMMY_OOP_RELOCATION); 1061 asm.mark(MARK_DUMMY_OOP_RELOCATION);
1060 if (nullCheck) { 1062 if (nullCheck) {
1061 asm.mark(MARK_IMPLICIT_NULL); 1063 asm.mark(MARK_IMPLICIT_NULL);
1062 asm.safepoint(); 1064 }
1063 } 1065 asm.safepoint();
1064 asm.jmp(patchStub); 1066 asm.jmp(patchStub);
1065 1067
1066 // TODO: make this more generic & safe - this is needed to create space for patching 1068 // TODO: make this more generic & safe - this is needed to create space for patching
1067 asm.nop(5); 1069 asm.nop(5);
1068 1070