private String getLabel(int address) { Object label = mLabels.get(new Integer(address)); if (label == null || (!(label instanceof String))) { return "L?_" + address; } else { return (String)label; } }
/** * Returns the value to which this map maps the specified key. Returns * <tt>null</tt> if the map contains no mapping for this key. A return * value of <tt>null</tt> does not <i>necessarily</i> indicate that the * map contains no mapping for the key; it's also possible that the map * explicitly maps the key to <tt>null</tt>. The <tt>containsKey</tt> * operation may be used to distinguish these two cases. * * @return the value to which this map maps the specified key. * @param key key whose associated value is to be returned. */ public V get(Integer key) { return get(key.intValue()); }
private Label getLabel(int address) { int labelKey = address; Object labelValue = mLabels.get(labelKey); // labelValue will never be null unless gatherLabels is broken. if (!(labelValue instanceof Label)) { labelValue = mAssembler.createLabel(); mLabels.put(labelKey, labelValue); } return (Label)labelValue; } }
private void locateLabel(String indent) { int labelKey = mAddress; Object labelValue = mLabels.get(labelKey); if (labelValue == null) { return; } int len = indent.length() - 4; if (len > 0) { print(indent.substring(0, len)); } print(labelValue); println(":"); List<ExceptionHandler> handlers = mCatchLocations.get(labelKey); if (handlers != null) { for (int i=0; i<handlers.size(); i++) { ExceptionHandler handler = handlers.get(i); print(indent, "try ("); print(getLabel(handler.getStartLocation().getLocation())); print(".."); print(getLabel(handler.getEndLocation().getLocation())); print(") catch ("); if (handler.getCatchType() == null) { print("..."); } else { disassemble(handler.getCatchType()); } println(")"); } } }
private void locateLabel() { int labelKey = mAddress; Object labelValue = mLabels.get(labelKey); if (labelValue != null) { if (labelValue instanceof Label) { ((Label)labelValue).setLocation(); } else { labelValue = mAssembler.createLabel().setLocation(); mLabels.put(labelKey, labelValue); } } List<ExceptionHandler> handlers = mCatchLocations.get(labelKey); if (handlers != null) { for (int i=0; i<handlers.size(); i++) { ExceptionHandler handler = handlers.get(i); Label start = getLabel(handler.getStartLocation().getLocation()); Label end = getLabel(handler.getEndLocation().getLocation()); String catchClassName; if (handler.getCatchType() == null) { catchClassName = null; } else { catchClassName = handler.getCatchType().getType().getFullName(); } mAssembler.exceptionHandler(start, end, catchClassName); } } }
private String getLabel(int address) { Object label = mLabels.get(address); if (label == null || (!(label instanceof String))) { return "L?_" + address; } else { return (String)label; } }
/** * Returns a previously registered method. * * @param mid method identifier * @return registered method or null if not found */ public synchronized TracedMethod getTracedMethod(int mid) { return mMethodMap.get(mid); }
int labelKey = handler.getCatchLocation().getLocation(); createLabel(labelKey); List<ExceptionHandler> list = mCatchLocations.get(labelKey); if (list == null) { list = new ArrayList<ExceptionHandler>(2);
/** * Returns the value to which this map maps the specified key. Returns * <tt>null</tt> if the map contains no mapping for this key. A return * value of <tt>null</tt> does not <i>necessarily</i> indicate that the * map contains no mapping for the key; it's also possible that the map * explicitly maps the key to <tt>null</tt>. The <tt>containsKey</tt> * operation may be used to distinguish these two cases. * * @return the value to which this map maps the specified key. * @param key key whose associated value is to be returned. */ public V get(Integer key) { return get(key.intValue()); }
/** * Finish registering a method once it has been loaded. * * @param mid reserved method identifier * @param method method to assign to identifier * @throws IllegalStateException if id has already been registered or is unknown */ public synchronized void registerMethod(int mid, TracedMethod method) { if (mMethodMap.get(mid) == null && mMethodMap.containsKey(mid)) { mMethodMap.put(mid, method); } else { throw new IllegalStateException("Unknown mid: " + mid); } } }
private Label getLabel(int address) { int labelKey = address; Object labelValue = mLabels.get(labelKey); // labelValue will never be null unless gatherLabels is broken. if (!(labelValue instanceof Label)) { labelValue = mAssembler.createLabel(); mLabels.put(labelKey, labelValue); } return (Label)labelValue; } }
mLabels.put(labelKey, (Object) labelKey); labelKey = handler.getCatchLocation().getLocation(); List<ExceptionHandler> list = mCatchLocations.get(labelKey); if (list == null) { list = new ArrayList<ExceptionHandler>(2);
private MethodData getMethodData(int mid) { MethodData md = mMethodDataMap.get(mid); if (md == null) { md = new MethodData(mToolbox.getTracedMethod(mid)); mMethodDataMap.put(mid, md); mMethodDataSequence.add(md); } return md; } }
/** * Transfers gathered data to parent scope, or returns null if no * parent. */ Scope transferToParent() { Scope parent = mParent; if (parent != null) { for (MethodData md : mMethodDataSequence) { int mid = md.mMethod.getMethodId(); MethodData pmd = parent.mMethodDataMap.get(mid); if (pmd == null) { parent.mMethodDataMap.put(mid, md); parent.mMethodDataSequence.add(md); } else { md.transferToParent(pmd); } } } return parent; }
private void locateLabel() { int labelKey = mAddress; Object labelValue = mLabels.get(labelKey); if (labelValue != null) { if (labelValue instanceof Label) { ((Label)labelValue).setLocation(); } else { labelValue = mAssembler.createLabel().setLocation(); mLabels.put(labelKey, labelValue); } } List<ExceptionHandler> handlers = mCatchLocations.get(labelKey); if (handlers != null) { for (int i=0; i<handlers.size(); i++) { ExceptionHandler handler = handlers.get(i); Label start = getLabel(handler.getStartLocation().getLocation()); Label end = getLabel(handler.getEndLocation().getLocation()); String catchClassName; if (handler.getCatchType() == null) { catchClassName = null; } else { catchClassName = handler.getCatchType().getType().getFullName(); } mAssembler.exceptionHandler(start, end, catchClassName); } } }
private void locateLabel(String indent) { int labelKey = mAddress; Object labelValue = mLabels.get(labelKey); if (labelValue == null) { return; } int len = indent.length() - 4; if (len > 0) { print(indent.substring(0, len)); } print(labelValue); println(":"); List<ExceptionHandler> handlers = mCatchLocations.get(labelKey); if (handlers != null) { for (int i=0; i<handlers.size(); i++) { ExceptionHandler handler = handlers.get(i); print(indent, "try ("); print(getLabel(handler.getStartLocation().getLocation())); print(".."); print(getLabel(handler.getEndLocation().getLocation())); print(") catch ("); if (handler.getCatchType() == null) { print("..."); } else { disassemble(handler.getCatchType()); } println(")"); } } }
mDecoders = decoders = new IntHashMap(); Decoder<S> decoder = (Decoder<S>) decoders.get(generation); if (decoder == null) { synchronized (cCodecDecoders) {
mDecoders = decoders = new IntHashMap(); Decoder<S> decoder = (Decoder<S>) decoders.get(generation); if (decoder == null) { synchronized (cCodecDecoders) {
int labelKey = handler.getCatchLocation().getLocation(); createLabel(labelKey); List<ExceptionHandler> list = mCatchLocations.get(labelKey); if (list == null) { list = new ArrayList<ExceptionHandler>(2);
mLabels.put(labelKey, (Object) labelKey); labelKey = handler.getCatchLocation().getLocation(); List<ExceptionHandler> list = mCatchLocations.get(labelKey); if (list == null) { list = new ArrayList<ExceptionHandler>(2);