Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java @ 8913:653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 08 Apr 2013 17:30:05 +0200 |
parents | 75db7afee829 |
children | f50d10434d3e |
comparison
equal
deleted
inserted
replaced
8912:9631f95971a3 | 8913:653110156f8a |
---|---|
88 private CheckCastSnippets.Templates checkcastSnippets; | 88 private CheckCastSnippets.Templates checkcastSnippets; |
89 private InstanceOfSnippets.Templates instanceofSnippets; | 89 private InstanceOfSnippets.Templates instanceofSnippets; |
90 private NewObjectSnippets.Templates newObjectSnippets; | 90 private NewObjectSnippets.Templates newObjectSnippets; |
91 private MonitorSnippets.Templates monitorSnippets; | 91 private MonitorSnippets.Templates monitorSnippets; |
92 private WriteBarrierSnippets.Templates writeBarrierSnippets; | 92 private WriteBarrierSnippets.Templates writeBarrierSnippets; |
93 private BoxingSnippets.Templates boxingSnippets; | |
93 | 94 |
94 private final Map<Descriptor, HotSpotRuntimeCallTarget> runtimeCalls = new HashMap<>(); | 95 private final Map<Descriptor, HotSpotRuntimeCallTarget> runtimeCalls = new HashMap<>(); |
95 private final Map<ResolvedJavaMethod, Stub> stubs = new HashMap<>(); | 96 private final Map<ResolvedJavaMethod, Stub> stubs = new HashMap<>(); |
96 | 97 |
97 /** | 98 /** |
339 | 340 |
340 replacements.registerSnippets(NewInstanceStub.class); | 341 replacements.registerSnippets(NewInstanceStub.class); |
341 replacements.registerSnippets(NewArrayStub.class); | 342 replacements.registerSnippets(NewArrayStub.class); |
342 replacements.registerSnippets(WriteBarrierSnippets.class); | 343 replacements.registerSnippets(WriteBarrierSnippets.class); |
343 | 344 |
345 replacements.registerSnippets(BoxingSnippets.class); | |
346 for (Class<?> clazz : BoxingSubstitutions.getClasses()) { | |
347 replacements.registerSubstitutions(clazz); | |
348 } | |
349 | |
344 checkcastSnippets = new CheckCastSnippets.Templates(this, replacements, graalRuntime.getTarget()); | 350 checkcastSnippets = new CheckCastSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
345 instanceofSnippets = new InstanceOfSnippets.Templates(this, replacements, graalRuntime.getTarget()); | 351 instanceofSnippets = new InstanceOfSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
346 newObjectSnippets = new NewObjectSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useTLAB); | 352 newObjectSnippets = new NewObjectSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useTLAB); |
347 monitorSnippets = new MonitorSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useFastLocking); | 353 monitorSnippets = new MonitorSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useFastLocking); |
348 writeBarrierSnippets = new WriteBarrierSnippets.Templates(this, replacements, graalRuntime.getTarget()); | 354 writeBarrierSnippets = new WriteBarrierSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
355 boxingSnippets = new BoxingSnippets.Templates(this, replacements, graalRuntime.getTarget()); | |
349 | 356 |
350 registerStub(new NewInstanceStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_INSTANCE))); | 357 registerStub(new NewInstanceStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_INSTANCE))); |
351 registerStub(new NewArrayStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_ARRAY))); | 358 registerStub(new NewArrayStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_ARRAY))); |
352 } | 359 } |
353 | 360 |
780 } else if (n instanceof IntegerDivNode || n instanceof IntegerRemNode || n instanceof UnsignedDivNode || n instanceof UnsignedRemNode) { | 787 } else if (n instanceof IntegerDivNode || n instanceof IntegerRemNode || n instanceof UnsignedDivNode || n instanceof UnsignedRemNode) { |
781 // Nothing to do for division nodes. The HotSpot signal handler catches divisions by | 788 // Nothing to do for division nodes. The HotSpot signal handler catches divisions by |
782 // zero and the MIN_VALUE / -1 cases. | 789 // zero and the MIN_VALUE / -1 cases. |
783 } else if (n instanceof UnwindNode || n instanceof ExceptionObjectNode) { | 790 } else if (n instanceof UnwindNode || n instanceof ExceptionObjectNode) { |
784 // Nothing to do, using direct LIR lowering for these nodes. | 791 // Nothing to do, using direct LIR lowering for these nodes. |
792 } else if (n instanceof BoxNode) { | |
793 boxingSnippets.lower((BoxNode) n); | |
794 } else if (n instanceof UnboxNode) { | |
795 boxingSnippets.lower((UnboxNode) n); | |
785 } else { | 796 } else { |
786 assert false : "Node implementing Lowerable not handled: " + n; | 797 assert false : "Node implementing Lowerable not handled: " + n; |
787 throw GraalInternalError.shouldNotReachHere(); | 798 throw GraalInternalError.shouldNotReachHere(); |
788 } | 799 } |
789 } | 800 } |