@Override public boolean hasImplementation() { return null != method.getImplementation(); }
private static void setRegisterCount(BuilderMethod method, int registerCount) throws Exception { MethodImplementation implementation = method.getImplementation(); Field f = implementation.getClass().getDeclaredField("registerCount"); f.setAccessible(true); // hack the planet f.set(implementation, registerCount); }
@Override public List<BuilderTryBlock> getTryBlocks() { MutableMethodImplementation implementation = (MutableMethodImplementation) method.getImplementation(); if (implementation == null) { return new LinkedList<>(); } return implementation.getTryBlocks(); }
@Override public MutableMethodImplementation getImplementation() { return (MutableMethodImplementation) getMethodDefinition().getImplementation(); }
int oldRegisterCount = builderMethod.getImplementation().getRegisterCount(); int registerCount = oldRegisterCount + invokeRegisterCount; setRegisterCount(builderMethod, registerCount); int oldRegisterCount = builderMethod.getImplementation().getRegisterCount(); int registerCount = oldRegisterCount + invokeRegisterCount; setRegisterCount(builderMethod, registerCount);
@Nonnull @Override public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return ImmutableList.of(); } return impl.getTryBlocks(); }
@Nullable @Override public Iterable<? extends Instruction> getInstructions(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getInstructions(); }
@Nonnull @Override public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return ImmutableList.of(); } return impl.getTryBlocks(); }
@Nullable @Override public Iterable<? extends Instruction> getInstructions(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getInstructions(); }
@Nonnull @Override public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return ImmutableList.of(); } return impl.getTryBlocks(); }
@Nullable @Override public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getDebugItems(); }
@Nullable @Override public Iterable<? extends Instruction> getInstructions(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getInstructions(); }
@Nonnull @Override public MutableMethodImplementation makeMutableMethodImplementation(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl instanceof MutableMethodImplementation) { return (MutableMethodImplementation)impl; } return new MutableMethodImplementation(impl); }
@Nullable @Override public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getDebugItems(); }
@Nullable @Override public Iterable<? extends DebugItem> getDebugItems(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return null; } return impl.getDebugItems(); }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }
@Nonnull @Override public MutableMethodImplementation makeMutableMethodImplementation(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl instanceof MutableMethodImplementation) { return (MutableMethodImplementation)impl; } return new MutableMethodImplementation(impl); }
@Nonnull @Override public MutableMethodImplementation makeMutableMethodImplementation(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl instanceof MutableMethodImplementation) { return (MutableMethodImplementation)impl; } return new MutableMethodImplementation(impl); }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }
@Override public int getRegisterCount(@Nonnull BuilderMethod builderMethod) { MethodImplementation impl = builderMethod.getImplementation(); if (impl == null) { return 0; } return impl.getRegisterCount(); }