Package com.strobel.assembler.ir.attributes

Examples of com.strobel.assembler.ir.attributes.ExceptionTableEntry


        final InstructionCollection instructions = _instructions;

        for (int i = 0, n = instructions.size(); i < n; i++) {
            final Instruction blockStart = instructions.get(i);
            final ExceptionTableEntry blockStartExceptionHandler = findInnermostExceptionHandler(blockStart.getOffset());

            //
            // See how big we can make that block...
            //
            for (; i + 1 < n; i++) {
                final Instruction instruction = instructions.get(i);
                final OpCode opCode = instruction.getOpCode();

                if (opCode.isUnconditionalBranch() /*|| opCode.canThrow()*/ || _hasIncomingJumps[i + 1]) {
                    break;
                }

                final Instruction next = instruction.getNext();

                if (next != null) {
                    //
                    // Ensure that blocks never contain instructions from different try blocks.
                    //
                    final ExceptionTableEntry innermostExceptionHandler = findInnermostExceptionHandler(next.getOffset());

                    if (innermostExceptionHandler != blockStartExceptionHandler) {
                        break;
                    }
                }
View Full Code Here


                if (innermostHandler == null) {
                    continue;
                }

                for (final ExceptionTableEntry entry : _tableEntries) {
                    final ExceptionTableEntry handlerEntry = (ExceptionTableEntry) innermostHandler.getUserData();

                    if (handlerEntry == null) {
                        continue;
                    }

                    if (entry.getStartOffset() == handlerEntry.getStartOffset() &&
                        entry.getEndOffset() == handlerEntry.getEndOffset()) {

                        final ControlFlowNode handlerNode = firstOrDefault(
                            _nodes,
                            new Predicate<ControlFlowNode>() {
                                @Override
View Full Code Here

            }
        }
    }

    private ControlFlowNode findInnermostExceptionHandlerNode(final int offsetInTryBlock) {
        final ExceptionTableEntry entry = findInnermostExceptionHandler(offsetInTryBlock);

        if (entry == null) {
            return null;
        }

        final Instruction nodeStart = _instructions.atOffset(entry.getHandlerOffset());

        for (final ControlFlowNode node : _nodes) {
            if (node.getStart() == nodeStart) {
                return node;
            }
View Full Code Here

TOP

Related Classes of com.strobel.assembler.ir.attributes.ExceptionTableEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.