Projects >> WALA >>f8d6f5b917617e55ea9bc263eb96e12e4af3e186

Chunk
Conflicting content
    assert topEntity.getKind() == CAstEntity.TYPE_ENTITY;
    assert n.getKind() == CAstEntity.FIELD_ENTITY;

<<<<<<< HEAD
    protected void doThrow(WalkContext context, int exception) {
	context.cfg().addInstruction(insts.ThrowInstruction(context.cfg().getCurrentInstruction(), exception));
    }

    public void doArrayRead(WalkContext context, int result, int arrayValue, CAstNode arrayRefNode, int[] dimValues) {
      TypeReference arrayTypeRef= (TypeReference) arrayRefNode.getChild(1).getValue();
      context.cfg().addInstruction(insts.ArrayLoadInstruction(context.cfg().getCurrentInstruction(), result, arrayValue, dimValues[0], arrayTypeRef));
      processExceptions(arrayRefNode, context);
=======
    // N.B.: base class may actually ask to create a synthetic type to wrap
    // code bodies, so we may see other things than TYPE_ENTITY here.
    IClass owner = loader.lookupClass(makeType(topEntity.getType()).getName());

    if (owner == null) {
      assert owner != null : makeType(topEntity.getType()).getName() + " not found in " + loader;
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }

    ((JavaSourceLoaderImpl) loader).defineField(n, owner);
Solution content
    assert topEntity.getKind() == CAstEntity.TYPE_ENTITY;
    assert n.getKind() == CAstEntity.FIELD_ENTITY;

    // N.B.: base class may actually ask to create a synthetic type to wrap
    // code bodies, so we may see other things than TYPE_ENTITY here.
    IClass owner = loader.lookupClass(makeType(topEntity.getType()).getName());

    if (owner == null) {
      assert owner != null : makeType(topEntity.getType()).getName() + " not found in " + loader;
    }

    ((JavaSourceLoaderImpl) loader).defineField(n, owner);
File
JavaCAst2IRTranslator.java
Developer's decision
Version 2
Kind of conflict
Assert statement
Cast expression
Comment
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
    ((JavaSourceLoaderImpl) loader).defineField(n, owner);
  }

<<<<<<< HEAD
      context.cfg().addInstruction(
        insts.ArrayStoreInstruction(context.cfg().getCurrentInstruction(), 
	  arrayValue,
	  dimValues[0], 
	  rval, 
	  arrayTypeRef));
      
      processExceptions(arrayRefNode, context);
    }

    protected void doFieldRead(WalkContext context, int result, int receiver, CAstNode elt, CAstNode parent) {
	// elt is a constant CAstNode whose value is a FieldReference.
	FieldReference fieldRef= (FieldReference) elt.getValue();

	if (receiver == -1) { // a static field: AstTranslator.getValue() produces -1 for null, we hope
	    context.cfg().addInstruction(insts.GetInstruction(context.cfg().getCurrentInstruction(), result, fieldRef));
	} else {
	    context.cfg().addInstruction(insts.GetInstruction(context.cfg().getCurrentInstruction(), result, receiver, fieldRef));
	    processExceptions(parent, context);
	}
=======
  // handles abstract method declarations, which do not get defineFunction
  // called for them
  protected void declareFunction(CAstEntity N, WalkContext definingContext) {
    CAstType.Method methodType = (Method) N.getType();
    CAstType owningType = methodType.getDeclaringType();
    IClass owner = loader.lookupClass(makeType(owningType).getName());

    if (owner == null) {
      assert owner != null : makeType(owningType).getName().toString() + " not found in " + loader;
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }

    ((JavaSourceLoaderImpl) loader).defineAbstractFunction(N, owner);
Solution content
    ((JavaSourceLoaderImpl) loader).defineField(n, owner);
  }

  // handles abstract method declarations, which do not get defineFunction
  // called for them
  protected void declareFunction(CAstEntity N, WalkContext definingContext) {
    CAstType.Method methodType = (Method) N.getType();
    CAstType owningType = methodType.getDeclaringType();
    IClass owner = loader.lookupClass(makeType(owningType).getName());

    if (owner == null) {
      assert owner != null : makeType(owningType).getName().toString() + " not found in " + loader;
    }

    ((JavaSourceLoaderImpl) loader).defineAbstractFunction(N, owner);
File
JavaCAst2IRTranslator.java
Developer's decision
Version 2
Kind of conflict
Assert statement
Cast expression
Comment
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
    ((JavaSourceLoaderImpl) loader).defineAbstractFunction(N, owner);
  }

<<<<<<< HEAD
	if (receiver == -1) { // a static field: AstTranslator.getValue() produces -1 for null, we hope
	    context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), rval, fieldRef));
	} else {
	    context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), receiver, rval, fieldRef));
	    processExceptions(parent, context);
	}
    }
=======
  protected void defineFunction(CAstEntity N, WalkContext definingContext, AbstractCFG cfg, SymbolTable symtab,
      boolean hasCatchBlock, TypeReference[][] caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo,
      DebuggingInformation debugInfo) {
    // N.B.: base class may actually ask to create a synthetic type to wrap
    // code bodies, so we may see other things than TYPE_ENTITY here.
    CAstType.Method methodType = (Method) N.getType();
    CAstType owningType = methodType.getDeclaringType();
    TypeName typeName = makeType(owningType).getName();
    IClass owner = loader.lookupClass(typeName);
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

    if (owner == null) {
      assert owner != null : typeName.toString() + " not found in " + loader;
Solution content
    ((JavaSourceLoaderImpl) loader).defineAbstractFunction(N, owner);
  }

  protected void defineFunction(CAstEntity N, WalkContext definingContext, AbstractCFG cfg, SymbolTable symtab,
      boolean hasCatchBlock, TypeReference[][] caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo,
      DebuggingInformation debugInfo) {
    // N.B.: base class may actually ask to create a synthetic type to wrap
    // code bodies, so we may see other things than TYPE_ENTITY here.
    CAstType.Method methodType = (Method) N.getType();
    CAstType owningType = methodType.getDeclaringType();
    TypeName typeName = makeType(owningType).getName();
    IClass owner = loader.lookupClass(typeName);

    if (owner == null) {
      assert owner != null : typeName.toString() + " not found in " + loader;
File
JavaCAst2IRTranslator.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Method signature
Variable
Chunk
Conflicting content
			       Object type, 
			       CAstNode newNode,
      assert owner != null : typeName.toString() + " not found in " + loader;
    }

<<<<<<< HEAD
    protected void doNewObject(WalkContext context, 
			       int result, 
			       int[] arguments)
    {
      TypeReference typeRef = (TypeReference) type;

      NewSiteReference site = 
	NewSiteReference.make(context.cfg().getCurrentInstruction(), typeRef);
      
      if ( newNode.getKind() == CAstNode.NEW_ENCLOSING ) {
        context.cfg().addInstruction ( new AstJavaNewEnclosingInstruction(context.cfg().getCurrentInstruction(), result, site, arguments[0]));
      } else {
        context.cfg().addInstruction(
            (arguments == null)?
                insts.NewInstruction(context.cfg().getCurrentInstruction(), result, site):
                insts.NewInstruction(context.cfg().getCurrentInstruction(), result, site, arguments));
      }
      processExceptions(newNode, context);
    }
=======
    symtab.getConstant(0);
    symtab.getNullConstant();
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

    ((JavaSourceLoaderImpl) loader).defineFunction(N, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo,
        debugInfo);
Solution content
      assert owner != null : typeName.toString() + " not found in " + loader;
    }

    symtab.getConstant(0);
    symtab.getNullConstant();

    ((JavaSourceLoaderImpl) loader).defineFunction(N, owner, cfg, symtab, hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo,
        debugInfo);
File
JavaCAst2IRTranslator.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Method invocation
Chunk
Conflicting content
    case CAstEntity.TYPE_ENTITY: {
      return (parent.getName().length() == 0) ? f.getName() : parent.getName() + "/" + f.getName();
    }
<<<<<<< HEAD

    protected void doCall(WalkContext context, CAstNode call, int result, int exception,
	    CAstNode name, int receiver, int[] arguments) {
	assert name.getKind() == CAstNode.CONSTANT;
	CallSiteReference dummySiteRef= (CallSiteReference) name.getValue();
	int pc= context.cfg().getCurrentInstruction();
	boolean isStatic= (receiver == -1);
	int[] realArgs= isStatic ? arguments : new int[arguments.length + 1];

	if (!isStatic) {
	    realArgs[0]= receiver;
	    System.arraycopy(arguments, 0, realArgs, 1, arguments.length);
	}
	CallSiteReference realSiteRef= CallSiteReference.make(pc, dummySiteRef.getDeclaredTarget(), dummySiteRef.getInvocationCode());

	if (realSiteRef.getDeclaredTarget().getReturnType().equals(TypeReference.Void))
	    context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), realArgs, exception, realSiteRef));
	else
	    context.cfg().addInstruction(new AstJavaInvokeInstruction(context.cfg().getCurrentInstruction(), result, realArgs, exception, realSiteRef));
	processExceptions(call, context);
=======
    case CAstEntity.FUNCTION_ENTITY: {
      // TODO properly handle types with clashing names/signatures within a
      // given method
      return parent.getName() + "/" + f.getSignature();
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
    default: {
      return parent.getName();
Solution content
    case CAstEntity.TYPE_ENTITY: {
      return (parent.getName().length() == 0) ? f.getName() : parent.getName() + "/" + f.getName();
    }
    case CAstEntity.FUNCTION_ENTITY: {
      // TODO properly handle types with clashing names/signatures within a
      // given method
      return parent.getName() + "/" + f.getSignature();
    }
    default: {
      return parent.getName();
File
JavaCAst2IRTranslator.java
Developer's decision
Version 2
Kind of conflict
Assert statement
Case statement
Cast expression
Comment
If statement
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
    context.cfg().addInstruction(insts.InstanceofInstruction(result, getValue(n.getChild(1)), ref));
  }

<<<<<<< HEAD
    protected void leaveThis(CAstNode n, Context c, CAstVisitor visitor) {
      if (n.getChildCount() == 0) {
	super.leaveThis(n, c, visitor);
      } else {
	WalkContext wc = (WalkContext)c;
	int result = wc.currentScope().allocateTempValue();
	setValue(n, result);
	wc.cfg().addInstruction(new EnclosingObjectReference(wc.cfg().getCurrentInstruction(), result, (TypeReference)n.getChild(0).getValue()));
      }
    }

    protected boolean visitCast(CAstNode n, Context c, CAstVisitor visitor) {
      WalkContext context = (WalkContext)c;
      int result = context.currentScope().allocateTempValue();
      setValue(n, result);
      return false;
    }
    protected void leaveCast(CAstNode n, Context c, CAstVisitor visitor) {
      WalkContext context = (WalkContext)c;
      int result = getValue(n);
      CAstType toType = (CAstType) n.getChild(0).getValue();
      TypeReference toRef = makeType(toType);

      CAstType fromType = (CAstType) n.getChild(2).getValue();
      TypeReference fromRef = makeType(fromType);

      if (toRef.isPrimitiveType()) {
    	context.cfg().addInstruction(
    	  insts.ConversionInstruction(context.cfg().getCurrentInstruction(), 
            result, 
            getValue(n.getChild(1)), 
            fromRef,
            toRef,
            false));
     
      } else {
        context.cfg().addInstruction(
          insts.CheckCastInstruction(context.cfg().getCurrentInstruction(), 
            result, 
            getValue(n.getChild(1)), 
            toRef));

	processExceptions(n, context);
      }
    }
    protected boolean visitInstanceOf(CAstNode n, Context c, CAstVisitor visitor) {
      WalkContext context = (WalkContext)c;
      int result = context.currentScope().allocateTempValue();
      setValue(n, result);
      return false;
    }
    protected void leaveInstanceOf(CAstNode n, Context c, CAstVisitor visitor) {
      WalkContext context = (WalkContext)c;
      int result = getValue(n);
      CAstType type = (CAstType) n.getChild(0).getValue();

      TypeReference ref = makeType( type );
      context.cfg().addInstruction(
        insts.InstanceofInstruction(context.cfg().getCurrentInstruction(), 
          result, 
          getValue(n.getChild(1)), 
          ref));
    }

    protected boolean doVisit(CAstNode n, Context context, CAstVisitor visitor) {
      WalkContext wc = (WalkContext) context;
      if (n.getKind() == CAstNode.MONITOR_ENTER) {
        visitor.visit(n.getChild(0), wc, visitor);
        wc.cfg().addInstruction(
            insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), 
                getValue(n.getChild(0)), 
                true));
        processExceptions(n, wc);
        
        return true;	
      } else if (n.getKind() == CAstNode.MONITOR_EXIT) {
        visitor.visit(n.getChild(0), wc, visitor);
        wc.cfg().addInstruction(
            insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), 
                getValue(n.getChild(0)), 
                false));
        processExceptions(n, wc);

        return true;
      } else {
        return super.doVisit(n, wc, visitor);
      }
=======
  protected boolean doVisit(CAstNode n, Context context, CAstVisitor visitor) {
    WalkContext wc = (WalkContext) context;
    if (n.getKind() == CAstNode.MONITOR_ENTER) {
      visitor.visit(n.getChild(0), wc, visitor);
      wc.cfg().addInstruction(insts.MonitorInstruction(getValue(n.getChild(0)), true));
      processExceptions(n, wc);

      return true;
    } else if (n.getKind() == CAstNode.MONITOR_EXIT) {
      visitor.visit(n.getChild(0), wc, visitor);
      wc.cfg().addInstruction(insts.MonitorInstruction(getValue(n.getChild(0)), false));
      processExceptions(n, wc);

      return true;
    } else {
      return super.doVisit(n, wc, visitor);
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
  }
Solution content
      return true;

  protected boolean doVisit(CAstNode n, Context context, CAstVisitor visitor) {
    WalkContext wc = (WalkContext) context;
    if (n.getKind() == CAstNode.MONITOR_ENTER) {
      visitor.visit(n.getChild(0), wc, visitor);
      wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), getValue(n.getChild(0)), true));
      processExceptions(n, wc);
    } else if (n.getKind() == CAstNode.MONITOR_EXIT) {
      visitor.visit(n.getChild(0), wc, visitor);
      wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), getValue(n.getChild(0)), false));
      processExceptions(n, wc);

      return true;
    } else {
      return super.doVisit(n, wc, visitor);
    }
  }
File
JavaCAst2IRTranslator.java
Developer's decision
Manual
Kind of conflict
Cast expression
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
          return new JavaScriptCheckReference(iindex, ref);
        }

<<<<<<< HEAD
        public SSAGetInstruction GetInstruction(int iindex, int result, int ref, String field) {
          return GetInstruction(iindex, result, ref, FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreateUnicodeAtom(field),
              JavaScriptTypes.Root));
=======
        public SSAGetInstruction GetInstruction(int result, int ref, String field) {
          return GetInstruction(result, ref,
              FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreateUnicodeAtom(field), JavaScriptTypes.Root));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
        }

        public JavaScriptInstanceOf InstanceOf(int iindex, int result, int objVal, int typeVal) {
Solution content
          return new JavaScriptCheckReference(iindex, ref);
        }

        public SSAGetInstruction GetInstruction(int iindex, int result, int ref, String field) {
          return GetInstruction(iindex, result, ref, 
              FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreateUnicodeAtom(field), JavaScriptTypes.Root));
        }

        public JavaScriptInstanceOf InstanceOf(int iindex, int result, int objVal, int typeVal) {
File
JavaScriptLoader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Return statement
Chunk
Conflicting content
        public SSAPutInstruction PutInstruction(int iindex, int ref, int value, String field) {
          try {
            byte[] utf8 = field.getBytes("UTF-8");
<<<<<<< HEAD
            return PutInstruction(iindex, ref, value, FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length),
                JavaScriptTypes.Root));
=======
            return PutInstruction(ref, value,
                FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
          } catch (UnsupportedEncodingException e) {
            Assertions.UNREACHABLE();
            return null;
Solution content
        public SSAPutInstruction PutInstruction(int iindex, int ref, int value, String field) {
          try {
            byte[] utf8 = field.getBytes("UTF-8");
            return PutInstruction(iindex, ref, value, 
                FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreate(utf8, 0, utf8.length), JavaScriptTypes.Root));
          } catch (UnsupportedEncodingException e) {
            Assertions.UNREACHABLE();
            return null;
File
JavaScriptLoader.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Return statement
Chunk
Conflicting content
          throw new UnsupportedOperationException();
        }

<<<<<<< HEAD
        public SSACheckCastInstruction CheckCastInstruction(int iindex, int result, int val, int typeValue) {
          return CheckCastInstruction(iindex, result, val, new int[]{ typeValue });
        }

        public SSACheckCastInstruction CheckCastInstruction(int iindex, int result, int val, TypeReference type) {
          return CheckCastInstruction(iindex, result, val, new TypeReference[]{ type });
=======
        public SSACheckCastInstruction CheckCastInstruction(int result, int val, int typeValue) {
          return CheckCastInstruction(result, val, new int[] { typeValue });
        }

        public SSACheckCastInstruction CheckCastInstruction(int result, int val, TypeReference type) {
          return CheckCastInstruction(result, val, new TypeReference[] { type });
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
        }

        public SSAComparisonInstruction ComparisonInstruction(int iindex, Operator operator, int result, int val1, int val2) {
Solution content
          throw new UnsupportedOperationException();
        }

        public SSACheckCastInstruction CheckCastInstruction(int iindex, int result, int val, int typeValue) {
          return CheckCastInstruction(iindex, result, val, new int[] { typeValue });
        }

        public SSACheckCastInstruction CheckCastInstruction(int iindex, int result, int val, TypeReference type) {
          return CheckCastInstruction(iindex, result, val, new TypeReference[] { type });
        }

        public SSAComparisonInstruction ComparisonInstruction(int iindex, Operator operator, int result, int val1, int val2) {
File
JavaScriptLoader.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Method invocation
Method signature
Return statement
Chunk
Conflicting content
   */
  private void addDefinedCheck(CAstNode n, WalkContext context, int readVn) {
    context.cfg().addPreNode(n);
<<<<<<< HEAD
    context.cfg().addInstruction(((JSInstructionFactory)insts).CheckReference(context.cfg().getCurrentInstruction(), readVn));
    
=======
    context.cfg().addInstruction(((JSInstructionFactory) insts).CheckReference(readVn));

>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    CAstNode target = context.getControlFlow().getTarget(n, JavaScriptTypes.ReferenceError);
    if (target != null) {
      context.cfg().addPreEdge(n, target, true);
Solution content
   */
  private void addDefinedCheck(CAstNode n, WalkContext context, int readVn) {
    context.cfg().addPreNode(n);
    context.cfg().addInstruction(((JSInstructionFactory)insts).CheckReference(context.cfg().getCurrentInstruction(), readVn));
    
    CAstNode target = context.getControlFlow().getTarget(n, JavaScriptTypes.ReferenceError);
    if (target != null) {
      context.cfg().addPreEdge(n, target, true);
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
        .fnReference(JavaScriptTypes.CodeBody);

    context.cfg().addInstruction(
<<<<<<< HEAD
        ((JSInstructionFactory)insts).Invoke(context.cfg().getCurrentInstruction(), receiver, result, arguments, exception, 
        new JSCallSiteReference(ref, context.cfg().getCurrentInstruction())));
=======
        ((JSInstructionFactory) insts).Invoke(receiver, result, arguments, exception, new JSCallSiteReference(ref, context.cfg()
            .getCurrentInstruction())));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

    context.cfg().addPreNode(call, context.getUnwindState());
Solution content
        .fnReference(JavaScriptTypes.CodeBody);

    context.cfg().addInstruction(
        ((JSInstructionFactory)insts).Invoke(context.cfg().getCurrentInstruction(), receiver, result, arguments, exception, 
        new JSCallSiteReference(ref, context.cfg().getCurrentInstruction())));

    context.cfg().addPreNode(call, context.getUnwindState());
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    TypeReference typeRef = TypeReference.findOrCreate(JavaScriptTypes.jsLoader, TypeName.string2TypeName("L" + type));

    context.cfg().addInstruction(
<<<<<<< HEAD
      insts.NewInstruction(context.cfg().getCurrentInstruction(), 
        result,
	NewSiteReference.make( 
          context.cfg().getCurrentInstruction(), 
	  typeRef)));
=======
        insts.NewInstruction(result, NewSiteReference.make(context.cfg().getCurrentInstruction(), typeRef)));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
  }

  protected void doMaterializeFunction(CAstNode n, WalkContext context, int result, int exception, CAstEntity fn) {
Solution content
    TypeReference typeRef = TypeReference.findOrCreate(JavaScriptTypes.jsLoader, TypeName.string2TypeName("L" + type));

    context.cfg().addInstruction(insts.NewInstruction(context.cfg().getCurrentInstruction(), result, 
        NewSiteReference.make(context.cfg().getCurrentInstruction(), typeRef)));
  }

  protected void doMaterializeFunction(CAstNode n, WalkContext context, int result, int exception, CAstEntity fn) {
File
JSAstTranslator.java
Developer's decision
Manual
Kind of conflict
Method invocation
Chunk
Conflicting content
    // "Function" is the name we use to model the constructor of function values
    int tmp = super.doGlobalRead(n, context, "Function");
    context.cfg().addInstruction(
<<<<<<< HEAD
      ((JSInstructionFactory)insts).Invoke(context.cfg().getCurrentInstruction(), tmp, result, new int[]{ nm }, exception,
        new JSCallSiteReference(
          JavaScriptMethods.ctorReference,
	  context.cfg().getCurrentInstruction())));
=======
        ((JSInstructionFactory) insts).Invoke(tmp, result, new int[] { nm }, exception, new JSCallSiteReference(
            JavaScriptMethods.ctorReference, context.cfg().getCurrentInstruction())));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
  }

  public void doArrayRead(WalkContext context, int result, int arrayValue, CAstNode arrayRef, int[] dimValues) {
Solution content
    // "Function" is the name we use to model the constructor of function values
    int tmp = super.doGlobalRead(n, context, "Function");
    context.cfg().addInstruction(
      ((JSInstructionFactory)insts).Invoke(context.cfg().getCurrentInstruction(), tmp, result, new int[]{ nm }, exception,
        new JSCallSiteReference(JavaScriptMethods.ctorReference, context.cfg().getCurrentInstruction())));
  }

  public void doArrayRead(WalkContext context, int result, int arrayValue, CAstNode arrayRef, int[] dimValues) {
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    this.visit(elt, context, this);
    int x = context.currentScope().allocateTempValue();

<<<<<<< HEAD
    context.cfg().addInstruction(((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), x, receiver));
=======
    context.cfg().addInstruction(((JSInstructionFactory) insts).AssignInstruction(x, receiver));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

    if (elt.getKind() == CAstNode.CONSTANT && elt.getValue() instanceof String) {
      String field = (String) elt.getValue();
Solution content
    this.visit(elt, context, this);
    int x = context.currentScope().allocateTempValue();

    context.cfg().addInstruction(((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), x, receiver));

    if (elt.getKind() == CAstNode.CONSTANT && elt.getValue() instanceof String) {
      String field = (String) elt.getValue();
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      String field = (String) elt.getValue();
      // symtab needs to have this value
      context.currentScope().getConstantValue(field);
<<<<<<< HEAD
      context.cfg().addInstruction(
        ((JSInstructionFactory)insts).GetInstruction(context.cfg().getCurrentInstruction(), result, x, field));
    } else {
      context.cfg().addInstruction(
          ((JSInstructionFactory)insts).PropertyRead(context.cfg().getCurrentInstruction(), result, x, getValue(elt) ));
=======
      context.cfg().addInstruction(((JSInstructionFactory) insts).GetInstruction(result, x, field));
    } else {
      context.cfg().addInstruction(((JSInstructionFactory) insts).PropertyRead(result, x, getValue(elt)));
    }

    // generate code to handle read of non-existent property
    if (context.getControlFlow().getMappedNodes().contains(readNode)) {
      context.cfg().addPreNode(readNode, context.getUnwindState());

      context.cfg().newBlock(true);

      if (context.getControlFlow().getTarget(readNode, JavaScriptTypes.TypeError) != null)
        context.cfg().addPreEdge(readNode, context.getControlFlow().getTarget(readNode, JavaScriptTypes.TypeError), true);
      else
        context.cfg().addPreEdgeToExit(readNode, true);
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
  }
Solution content
      String field = (String) elt.getValue();
      // symtab needs to have this value
      context.currentScope().getConstantValue(field);
      context.cfg().addInstruction(
        ((JSInstructionFactory)insts).GetInstruction(context.cfg().getCurrentInstruction(), result, x, field));
    } else {
      context.cfg().addInstruction(((JSInstructionFactory) insts).PropertyRead(context.cfg().getCurrentInstruction(), result, x, getValue(elt)));
    }

    // generate code to handle read of non-existent property
    if (context.getControlFlow().getMappedNodes().contains(readNode)) {
      context.cfg().addPreNode(readNode, context.getUnwindState());

      context.cfg().newBlock(true);

      if (context.getControlFlow().getTarget(readNode, JavaScriptTypes.TypeError) != null)
        context.cfg().addPreEdge(readNode, context.getControlFlow().getTarget(readNode, JavaScriptTypes.TypeError), true);
      else
        context.cfg().addPreEdgeToExit(readNode, true);
    }
  }
File
JSAstTranslator.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
        assert field.equals(put.getDeclaredField().getName().toUnicodeString());
    if (elt.getKind() == CAstNode.CONSTANT && elt.getValue() instanceof String) {
      String field = (String) elt.getValue();
      context.currentScope().getConstantValue(field);
<<<<<<< HEAD
      SSAPutInstruction put = ((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), receiver, rval, field);
=======
      SSAPutInstruction put = ((JSInstructionFactory) insts).PutInstruction(receiver, rval, field);
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
      try {
      } catch (UTFDataFormatException e) {
Solution content
    if (elt.getKind() == CAstNode.CONSTANT && elt.getValue() instanceof String) {
      String field = (String) elt.getValue();
      context.currentScope().getConstantValue(field);
      SSAPutInstruction put = ((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), receiver, rval, field);
      try {
        assert field.equals(put.getDeclaredField().getName().toUnicodeString());
      } catch (UTFDataFormatException e) {
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
      }
      context.cfg().addInstruction(put);
    } else {
<<<<<<< HEAD
      context.cfg().addInstruction(
          ((JSInstructionFactory)insts).PropertyWrite(context.cfg().getCurrentInstruction(), receiver, getValue(elt), rval));
=======
      context.cfg().addInstruction(((JSInstructionFactory) insts).PropertyWrite(receiver, getValue(elt), rval));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
  }
Solution content
      }
      context.cfg().addInstruction(put);
    } else {
      context.cfg().addInstruction(((JSInstructionFactory) insts).PropertyWrite(context.cfg().getCurrentInstruction(), receiver, getValue(elt), rval));
    }
  }
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    // set the class property of the new object
    int rval = context.currentScope().getConstantValue(typeName);
    context.currentScope().getConstantValue("class");
<<<<<<< HEAD
    context.cfg().addInstruction(
        ((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), resultVal, rval, "class"));
  } 
=======
    context.cfg().addInstruction(((JSInstructionFactory) insts).PutInstruction(resultVal, rval, "class"));
  }
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

  protected void doPrimitive(int resultVal, WalkContext context, CAstNode primitiveCall) {
    try {
Solution content
    // set the class property of the new object
    int rval = context.currentScope().getConstantValue(typeName);
    context.currentScope().getConstantValue("class");
    context.cfg().addInstruction(
        ((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), resultVal, rval, "class"));
  } 

  protected void doPrimitive(int resultVal, WalkContext context, CAstNode primitiveCall) {
    try {
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    try {
      String name = (String) primitiveCall.getChild(0).getValue();
      if (name.equals("GlobalNaN")) {
<<<<<<< HEAD
	context.cfg().addInstruction(
	    ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
	    resultVal, 
	    context.currentScope().getConstantValue(new Float(Float.NaN))));
      } else if (name.equals("GlobalInfinity")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Float(Float.POSITIVE_INFINITY))));
      } else if (name.equals("MathE")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.E))));
      } else if (name.equals("MathPI")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.PI))));
      } else if (name.equals("MathSQRT1_2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.sqrt(.5)))));
      } else if (name.equals("MathSQRT2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.sqrt(2)))));
      } else if (name.equals("MathLN2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.log(2)))));
      } else if (name.equals("MathLN10")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue(new Double(Math.log(10)))));
=======
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Float(Float.NaN))));
      } else if (name.equals("GlobalInfinity")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Float(Float.POSITIVE_INFINITY))));
      } else if (name.equals("MathE")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts)
                .AssignInstruction(resultVal, context.currentScope().getConstantValue(new Double(Math.E))));
      } else if (name.equals("MathPI")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal, context.currentScope()
                .getConstantValue(new Double(Math.PI))));
      } else if (name.equals("MathSQRT1_2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Double(Math.sqrt(.5)))));
      } else if (name.equals("MathSQRT2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Double(Math.sqrt(2)))));
      } else if (name.equals("MathLN2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Double(Math.log(2)))));
      } else if (name.equals("MathLN10")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal,
                context.currentScope().getConstantValue(new Double(Math.log(10)))));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
      } else if (name.equals("NewObject")) {
        doNewObject(context, null, resultVal, "Object", null);
Solution content
    try {
      String name = (String) primitiveCall.getChild(0).getValue();
      if (name.equals("GlobalNaN")) {
	context.cfg().addInstruction(
	    ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
	    resultVal, context.currentScope().getConstantValue(new Float(Float.NaN))));
      } else if (name.equals("GlobalInfinity")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Float(Float.POSITIVE_INFINITY))));
      } else if (name.equals("MathE")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.E))));
      } else if (name.equals("MathPI")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.PI))));
      } else if (name.equals("MathSQRT1_2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.sqrt(.5)))));
      } else if (name.equals("MathSQRT2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.sqrt(2)))));
      } else if (name.equals("MathLN2")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.log(2)))));
      } else if (name.equals("MathLN10")) {
        context.cfg().addInstruction(
            ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue(new Double(Math.log(10)))));
      } else if (name.equals("NewObject")) {
        doNewObject(context, null, resultVal, "Object", null);
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
        doNewObject(context, null, resultVal, "Undefined", null);

      } else {
<<<<<<< HEAD
	context.cfg().addInstruction(
	    ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, 
            context.currentScope().getConstantValue( null )));
=======
        context.cfg().addInstruction(
            ((JSInstructionFactory) insts).AssignInstruction(resultVal, context.currentScope().getConstantValue(null)));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
      }
    } catch (ClassCastException e) {
      throw new RuntimeException("Cannot translate primitive " + primitiveCall.getChild(0).getValue());
Solution content
      } else {
        doNewObject(context, null, resultVal, "Undefined", null);

	context.cfg().addInstruction(
	    ((JSInstructionFactory)insts).AssignInstruction(context.cfg().getCurrentInstruction(), 
            resultVal, context.currentScope().getConstantValue( null )));
      }
    } catch (ClassCastException e) {
      throw new RuntimeException("Cannot translate primitive " + primitiveCall.getChild(0).getValue());
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    if (f.getKind() == CAstNode.CONSTANT && f.getValue() instanceof String) {
      String field = (String) f.getValue();

<<<<<<< HEAD
      FieldReference fieldRef =
        FieldReference.findOrCreate(
          JavaScriptTypes.Root,
	  Atom.findOrCreateUnicodeAtom((String)field),
	  JavaScriptTypes.Root);
    
      context.cfg()
	.addInstruction(((JSInstructionFactory)insts).IsDefinedInstruction(context.cfg().getCurrentInstruction(), result, ref, fieldRef));

    } else {

      context.cfg()
        .addInstruction(((JSInstructionFactory)insts).IsDefinedInstruction(context.cfg().getCurrentInstruction(), result, ref, getValue(f)));
=======
      FieldReference fieldRef = FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreateUnicodeAtom((String) field),
          JavaScriptTypes.Root);

      context.cfg().addInstruction(((JSInstructionFactory) insts).IsDefinedInstruction(result, ref, fieldRef));

    } else {

      context.cfg().addInstruction(((JSInstructionFactory) insts).IsDefinedInstruction(result, ref, getValue(f)));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
  }
Solution content
    if (f.getKind() == CAstNode.CONSTANT && f.getValue() instanceof String) {
      String field = (String) f.getValue();

      FieldReference fieldRef = FieldReference.findOrCreate(JavaScriptTypes.Root, Atom.findOrCreateUnicodeAtom((String)field), JavaScriptTypes.Root);
    
      context.cfg().addInstruction(((JSInstructionFactory)insts).IsDefinedInstruction(context.cfg().getCurrentInstruction(), result, ref, fieldRef));

    } else {

      context.cfg().addInstruction(((JSInstructionFactory)insts).IsDefinedInstruction(context.cfg().getCurrentInstruction(), result, ref, getValue(f)));
    }
  }
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    visit(n.getChild(1), context, visitor);
    int type = getValue(n.getChild(1));

<<<<<<< HEAD
    context.cfg().addInstruction(new JavaScriptInstanceOf(context.cfg().getCurrentInstruction(), result, value, type));
}
=======
    context.cfg().addInstruction(new JavaScriptInstanceOf(result, value, type));
  }
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

  protected void doPrologue(WalkContext context) {
    super.doPrologue(context);
Solution content
    visit(n.getChild(1), context, visitor);
    int type = getValue(n.getChild(1));

    context.cfg().addInstruction(new JavaScriptInstanceOf(context.cfg().getCurrentInstruction(), result, value, type));
  }

  protected void doPrologue(WalkContext context) {
    super.doPrologue(context);
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    doNewObject(context, null, tempVal, "Array", null);
    CAstSymbol args = new CAstSymbolImpl("arguments");
    context.currentScope().declare(args, tempVal);
<<<<<<< HEAD
    context.cfg().addInstruction(
        ((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), 1, tempVal, "arguments"));
=======
    context.cfg().addInstruction(((JSInstructionFactory) insts).PutInstruction(1, tempVal, "arguments"));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
  }

  protected boolean doVisit(CAstNode n, Context cntxt, CAstVisitor visitor) {
Solution content
    doNewObject(context, null, tempVal, "Array", null);
    CAstSymbol args = new CAstSymbolImpl("arguments");
    context.currentScope().declare(args, tempVal);
    context.cfg().addInstruction(((JSInstructionFactory)insts).PutInstruction(context.cfg().getCurrentInstruction(), 1, tempVal, "arguments"));
  }

  protected boolean doVisit(CAstNode n, Context cntxt, CAstVisitor visitor) {
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      this.visit(n.getChild(0), context, this);
      int ref = getValue(n.getChild(0));

<<<<<<< HEAD
      context.cfg().addInstruction(
          ((JSInstructionFactory)insts).TypeOfInstruction(context.cfg().getCurrentInstruction(), result, ref));
=======
      context.cfg().addInstruction(((JSInstructionFactory) insts).TypeOfInstruction(result, ref));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

      setValue(n, result);
      return true;
Solution content
      this.visit(n.getChild(0), context, this);
      int ref = getValue(n.getChild(0));

      context.cfg().addInstruction(((JSInstructionFactory)insts).TypeOfInstruction(context.cfg().getCurrentInstruction(), result, ref));

      setValue(n, result);
      return true;
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      this.visit(n.getChild(0), context, this);
      int ref = getValue(n.getChild(0));

<<<<<<< HEAD
      context.cfg().addInstruction(((JSInstructionFactory)insts).WithRegion(context.cfg().getCurrentInstruction(), ref, n.getKind()==JavaScriptCAstNode.ENTER_WITH));
=======
      context.cfg().addInstruction(((JSInstructionFactory) insts).WithRegion(ref, n.getKind() == JavaScriptCAstNode.ENTER_WITH));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

      return true;
    }
Solution content
      this.visit(n.getChild(0), context, this);
      int ref = getValue(n.getChild(0));

      context.cfg().addInstruction(((JSInstructionFactory)insts).WithRegion(context.cfg().getCurrentInstruction(), ref, 
          n.getKind() == JavaScriptCAstNode.ENTER_WITH));

      return true;
    }
File
JSAstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      addExposedName(context.top(), E, name, vn);
      addAccess(context.top(), A);

<<<<<<< HEAD
      context.cfg().addInstruction(new AssignInstruction(context.cfg().currentInstruction, vn, rval));
      context.cfg().addInstruction(new AstLexicalWrite(context.cfg().currentInstruction, A));
=======
      context.cfg().addInstruction(new AssignInstruction(vn, rval));
      // we add write instructions at every access for now
      // eventually, we may restructure the method to do a single combined write
      // before exit
      context.cfg().addInstruction(new AstLexicalWrite(A));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

      // lexically-scoped variables can be read from their scope each time
    } else {
Solution content
      addExposedName(context.top(), E, name, vn);
      addAccess(context.top(), A);

      context.cfg().addInstruction(new AssignInstruction(context.cfg().currentInstruction, vn, rval));
      // we add write instructions at every access for now
      // eventually, we may restructure the method to do a single combined write
      // before exit
      context.cfg().addInstruction(new AstLexicalWrite(context.cfg().currentInstruction, A));

      // lexically-scoped variables can be read from their scope each time
    } else {
File
AstTranslator.java
Developer's decision
Combination
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
    assert getValue(n.getChild(0)) != -1 : "error in loop test " + CAstPrinter.print(n.getChild(0), context.top().getSourceMap())
        + " of loop " + CAstPrinter.print(n, context.top().getSourceMap());
    context.cfg().addInstruction(
<<<<<<< HEAD
        insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(n
            .getChild(0)), context.currentScope().getConstantValue(new Integer(0))));
=======
        insts.ConditionalBranchInstruction(translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(n.getChild(0)), context
            .currentScope().getConstantValue(new Integer(0))));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    PreBasicBlock branchB = context.cfg().getCurrentBlock();

    // loop body
Solution content
    assert getValue(n.getChild(0)) != -1 : "error in loop test " + CAstPrinter.print(n.getChild(0), context.top().getSourceMap())
        + " of loop " + CAstPrinter.print(n, context.top().getSourceMap());
    context.cfg().addInstruction(
        insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(n
            .getChild(0)), context.currentScope().getConstantValue(new Integer(0))));
    PreBasicBlock branchB = context.cfg().getCurrentBlock();

    // loop body
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    String nm = (String) n.getChild(0).getValue();
    context.currentScope().declare(new FinalCAstSymbol(nm));
    context.cfg().addInstruction(
<<<<<<< HEAD
        insts.GetCaughtExceptionInstruction(context.cfg().currentInstruction, context.cfg().getCurrentBlock().getNumber(), context.currentScope()
            .lookup(nm).valueNumber()));
=======
        insts.GetCaughtExceptionInstruction(context.cfg().getCurrentBlock().getNumber(), context.currentScope().lookup(nm)
            .valueNumber()));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
  }

  protected boolean visitThis(CAstNode n, Context c, CAstVisitor visitor) { /* empty */
Solution content
    String nm = (String) n.getChild(0).getValue();
    context.currentScope().declare(new FinalCAstSymbol(nm));
    context.cfg().addInstruction(
        insts.GetCaughtExceptionInstruction(context.cfg().currentInstruction, context.cfg().getCurrentBlock().getNumber(), context.currentScope()
            .lookup(nm).valueNumber()));
  }

  protected boolean visitThis(CAstNode n, Context c, CAstVisitor visitor) { /* empty */
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    WalkContext context = (WalkContext) c;
    int result = getValue(n);
    CAstNode v = n.getChild(1);
<<<<<<< HEAD
    context.cfg()
        .addInstruction(insts.UnaryOpInstruction(context.cfg().currentInstruction, translateUnaryOpcode(n.getChild(0)), result, getValue(v)));
=======
    context.cfg().addInstruction(insts.UnaryOpInstruction(translateUnaryOpcode(n.getChild(0)), result, getValue(v)));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
  }

  protected boolean visitArrayLength(CAstNode n, Context c, CAstVisitor visitor) {
Solution content
    WalkContext context = (WalkContext) c;
    int result = getValue(n);
    CAstNode v = n.getChild(1);
    context.cfg().addInstruction(insts.UnaryOpInstruction(context.cfg().currentInstruction, 
        translateUnaryOpcode(n.getChild(0)), result, getValue(v)));
  }

  protected boolean visitArrayLength(CAstNode n, Context c, CAstVisitor visitor) {
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    WalkContext context = (WalkContext) c;
    if (n.getChildCount() == 1) {
      context.cfg().addInstruction(
<<<<<<< HEAD
          insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_NE), null, getValue(n
              .getChild(0)), context.currentScope().getConstantValue(new Integer(0))));
    } else if (n.getChildCount() == 3) {
      context.cfg().addInstruction(
          insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(n.getChild(0)), null,
              getValue(n.getChild(1)), getValue(n.getChild(2))));
=======
          insts.ConditionalBranchInstruction(translateConditionOpcode(CAstOperator.OP_NE), null, getValue(n.getChild(0)), context
              .currentScope().getConstantValue(new Integer(0))));
    } else if (n.getChildCount() == 3) {
      context.cfg().addInstruction(
          insts.ConditionalBranchInstruction(translateConditionOpcode(n.getChild(0)), null, getValue(n.getChild(1)),
              getValue(n.getChild(2))));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    } else {
      Assertions.UNREACHABLE();
    }
Solution content
    WalkContext context = (WalkContext) c;
    if (n.getChildCount() == 1) {
      context.cfg().addInstruction(
          insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_NE), null, getValue(n
              .getChild(0)), context.currentScope().getConstantValue(new Integer(0))));
    } else if (n.getChildCount() == 3) {
      context.cfg().addInstruction(
          insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(n.getChild(0)), null,
              getValue(n.getChild(1)), getValue(n.getChild(2))));
    } else {
      Assertions.UNREACHABLE();
    }
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
  protected void leaveGoto(CAstNode n, Context c, CAstVisitor visitor) {
    WalkContext context = (WalkContext) c;
<<<<<<< HEAD
    context.cfg().addPreNode(n, context.getUnwindState());
    context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction));
    context.cfg().newBlock(false);
    if (context.getControlFlow().getTarget(n, null) == null) {
      assert context.getControlFlow().getTarget(n, null) != null : context.getControlFlow() + " does not map " + n
      + " (" + context.getSourceMap().getPosition(n) + ")";
=======
    if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) {
      context.cfg().addPreNode(n, context.getUnwindState());
      context.cfg().addInstruction(insts.GotoInstruction());
      context.cfg().newBlock(false);
      if (context.getControlFlow().getTarget(n, null) == null) {
        assert context.getControlFlow().getTarget(n, null) != null : context.getControlFlow() + " does not map " + n + " ("
            + context.getSourceMap().getPosition(n) + ")";
      }
      context.cfg().addPreEdge(n, context.getControlFlow().getTarget(n, null), false);
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    }
  }
Solution content
  protected void leaveGoto(CAstNode n, Context c, CAstVisitor visitor) {
    WalkContext context = (WalkContext) c;
    if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) {
      context.cfg().addPreNode(n, context.getUnwindState());
      context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction));
      context.cfg().newBlock(false);
      if (context.getControlFlow().getTarget(n, null) == null) {
        assert context.getControlFlow().getTarget(n, null) != null : context.getControlFlow() + " does not map " + n + " ("
            + context.getSourceMap().getPosition(n) + ")";
      }
      context.cfg().addPreEdge(n, context.getControlFlow().getTarget(n, null), false);
    }
  }
File
AstTranslator.java
Developer's decision
Combination
Kind of conflict
Assert statement
If statement
Method invocation
Chunk
Conflicting content
    CAstNode l = n.getChild(0);
    visitor.visit(l, context, visitor);
    context.cfg().addInstruction(
<<<<<<< HEAD
        insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(l), context
            .currentScope().getConstantValue(new Integer(0))));
=======
        insts.ConditionalBranchInstruction(translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(l), context.currentScope()
            .getConstantValue(new Integer(0))));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
    PreBasicBlock srcB = context.cfg().getCurrentBlock();
    // true clause
    context.cfg().newBlock(true);
Solution content
    CAstNode l = n.getChild(0);
    visitor.visit(l, context, visitor);
    context.cfg().addInstruction(
        insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, getValue(l),
            context.currentScope().getConstantValue(new Integer(0))));
    PreBasicBlock srcB = context.cfg().getCurrentBlock();
    // true clause
    context.cfg().newBlock(true);
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      if (x != CAstControlFlowMap.SWITCH_DEFAULT) {
        visitor.visit((CAstNode) x, context, visitor);
        context.cfg().addInstruction(
<<<<<<< HEAD
            insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, v,
                getValue((CAstNode) x)));
=======
            insts.ConditionalBranchInstruction(translateConditionOpcode(CAstOperator.OP_EQ), null, v, getValue((CAstNode) x)));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
        labelToBlock.put(x, context.cfg().getCurrentBlock());
        context.cfg().newBlock(true);
      }
Solution content
      if (x != CAstControlFlowMap.SWITCH_DEFAULT) {
        visitor.visit((CAstNode) x, context, visitor);
        context.cfg().addInstruction(
            insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), 
                null, v, getValue((CAstNode) x)));
        labelToBlock.put(x, context.cfg().getCurrentBlock());
        context.cfg().newBlock(true);
      }
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
      context.currentScope().declare(new FinalCAstSymbol(id));
    }
    context.cfg().addInstruction(
<<<<<<< HEAD
        insts.GetCaughtExceptionInstruction(context.cfg().currentInstruction, context.cfg().getCurrentBlock().getNumber(), context.currentScope()
            .lookup(id).valueNumber()));
=======
        insts.GetCaughtExceptionInstruction(context.cfg().getCurrentBlock().getNumber(), context.currentScope().lookup(id)
            .valueNumber()));
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5

    context.cfg().addPreNode(n, context.getUnwindState());
Solution content
      context.currentScope().declare(new FinalCAstSymbol(id));
    }
    context.cfg().addInstruction(
        insts.GetCaughtExceptionInstruction(context.cfg().currentInstruction, context.cfg().getCurrentBlock().getNumber(), context.currentScope()
            .lookup(id).valueNumber()));

    context.cfg().addPreNode(n, context.getUnwindState());
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
<<<<<<< HEAD
      ;

    if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) {
      addSkipCatchGoto = true;
      context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction));
=======
      context.cfg().addInstruction(insts.GotoInstruction());
>>>>>>> 2de1da2948c7ad4accabaf1317193ea54c9565c5
      context.cfg().newBlock(false);
    }
Solution content
    if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) {
      addSkipCatchGoto = true;
      ;
      context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction));
      context.cfg().newBlock(false);
    }
File
AstTranslator.java
Developer's decision
Version 1
Kind of conflict
Method invocation