Package org.adoptopenjdk.jitwatch.model.assembly

Examples of org.adoptopenjdk.jitwatch.model.assembly.AssemblyInstruction


    List<String> operands = new ArrayList<>();
    operands.add("%rdx");
    operands.add("%rax");
    String firstComment = null;

    AssemblyInstruction ins = new AssemblyInstruction(annotation, address, modifier, mnemonic, operands, firstComment);

    OptimizedVirtualCall vCall = OptimizedVirtualCallFinder.findOptimizedCall(null, ins);

    assertNull(vCall);
  }
View Full Code Here


    List<String> operands = new ArrayList<>();
    operands.add("%rdx");
    operands.add("%rax");
    String firstComment = "; - FooClass::fooMethod@1 (line 42)";

    AssemblyInstruction ins = new AssemblyInstruction(annotation, address, modifier, mnemonic, operands, firstComment);

    OptimizedVirtualCall vCall = OptimizedVirtualCallFinder.findOptimizedCall(null, ins);

    assertNull(vCall);
  }
View Full Code Here

    operands.add("%rax");
    String comment1 = "; - BarClass::barMethod@22 (line 19)";
    String comment2 = "; - FooClass::fooMethod@11 (line 76)";
    String comment3 = ";  " + JITWatchConstants.S_OPTIMIZED_VIRTUAL_CALL;

    AssemblyInstruction ins = new AssemblyInstruction(annotation, address, modifier, mnemonic, operands, comment1);
    ins.addCommentLine(comment2);
    ins.addCommentLine(comment3);

    OptimizedVirtualCall vCall = OptimizedVirtualCallFinder.findOptimizedCall(null, ins);

    assertNotNull(vCall);
View Full Code Here

  @Test
  public void testInstructionParse()
  {
    String line = "0x00007f4475904140: mov  0x8(%rsi),%r10d ;comment";
   
    AssemblyInstruction instr = AssemblyUtil.createInstruction(line);
   
    assertNotNull(instr);
   
    assertEquals(Long.parseLong("7f4475904140", 16), instr.getAddress());
   
    assertEquals("mov", instr.getMnemonic());
   
    List<String> operands = instr.getOperands();
   
    assertEquals(2, operands.size());
   
    assertEquals("0x8(%rsi)", operands.get(0));
    assertEquals("%r10d", operands.get(1));
   
    assertEquals(";comment", instr.getComment());   
  }
View Full Code Here

  @Test
  public void testInstructionParseWithModifier()
  {
    String line = "0x00007f447590414d: data32 xchg %ax,%ax";
   
    AssemblyInstruction instr = AssemblyUtil.createInstruction(line);
   
    assertNotNull(instr);
   
    assertEquals(Long.parseLong("7f447590414d", 16), instr.getAddress());
   
    assertEquals("data32", instr.getModifier());
   
    assertEquals("xchg", instr.getMnemonic());
   
    List<String> operands = instr.getOperands();
   
    assertEquals(2, operands.size());
   
    assertEquals("%ax", operands.get(0));
    assertEquals("%ax", operands.get(1));
   
    assertEquals(S_EMPTY, instr.getComment());   
  }
View Full Code Here

  @Test
  public void testInstructionParseNoOperands()
  {
    String line = "0x00007f447590416e: hlt";
   
    AssemblyInstruction instr = AssemblyUtil.createInstruction(line);
   
    assertNotNull(instr);
   
    assertEquals(Long.parseLong("7f447590416e", 16), instr.getAddress());
   
    assertEquals(null, instr.getModifier());
   
    assertEquals("hlt", instr.getMnemonic());
   
    List<String> operands = instr.getOperands();
   
    assertEquals(0, operands.size());
   
    assertEquals(S_EMPTY, instr.getComment());   
  }
View Full Code Here

  @Test
  public void testInstructionParseMultiplePrefixes()
  {
    String line = "0x00007fbbc41082e5: data32 data32 nopw 0x0(%rax,%rax,1)";
   
    AssemblyInstruction instr = AssemblyUtil.createInstruction(line);
   
    assertNotNull(instr);
   
    assertEquals(Long.parseLong("7fbbc41082e5", 16), instr.getAddress());
   
    assertEquals("data32 data32", instr.getModifier());
   
    assertEquals("nopw", instr.getMnemonic());
   
    List<String> operands = instr.getOperands();
   
    assertEquals(1, operands.size());
   
    assertEquals("0x0(%rax,%rax,1)", operands.get(0));   
  }
View Full Code Here

  @Test
  public void testInstructionParseRegression1()
  {
    String line = "0x00007f54f9bfd2f0: mov    %eax,-0x14000(%rsp)";
   
    AssemblyInstruction instr = AssemblyUtil.createInstruction(line);
   
    assertNotNull(instr);
   
    assertEquals(Long.parseLong("7f54f9bfd2f0", 16), instr.getAddress());
   
    assertNull(instr.getModifier());
   
    assertEquals("mov", instr.getMnemonic());
   
    List<String> operands = instr.getOperands();
   
    assertEquals(2, operands.size());
   
    assertEquals("%eax", operands.get(0))
    assertEquals("-0x14000(%rsp)", operands.get(1));   
View Full Code Here

    assertEquals(2, asmBlocks.size());

    assertEquals(7, asmBlocks.get(0).getInstructions().size());
    assertEquals(11, asmBlocks.get(1).getInstructions().size());
   
    AssemblyInstruction instr9 = asmBlocks.get(1).getInstructions().get(8);
   
    assertEquals("79.12%   95.68%    ", instr9.getAnnotation());
    assertEquals(Long.parseLong("00007f25cd19c8b8", 16), instr9.getAddress());
    assertEquals("fstpl", instr9.getMnemonic());
   
    List<String> operands = new ArrayList<String>();
    operands.add("(%rsp)");
   
    assertEquals(operands, instr9.getOperands());
  }
View Full Code Here

TOP

Related Classes of org.adoptopenjdk.jitwatch.model.assembly.AssemblyInstruction

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.