From 67f46bce5bfe5ac558b4b9f6476b77f922ad4d44 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Mon, 8 Dec 2014 22:33:30 -0500 Subject: [PATCH] Bug 454502: make dwarf use valueof instead of number constructor This may improve both memory and cpu performance. (SLIGHTLY) Change-Id: I05c06b017b9d8e4505a17e99cde6c024bca21dd4 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/37783 Tested-by: Hudson CI Reviewed-by: Elena Laskavaia --- .../eclipse/cdt/utils/debug/dwarf/Dwarf.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java index e2c23dab516..9cc4439756c 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java @@ -534,7 +534,7 @@ public class Dwarf { } Map parseDebugAbbreviation(CompilationUnitHeader header) throws IOException { - Integer key = new Integer(header.abbreviationOffset); + Integer key = Integer.valueOf(header.abbreviationOffset); Map abbrevs = abbreviationMaps.get(key); if (abbrevs == null) { abbrevs = new HashMap(); @@ -644,27 +644,27 @@ public class Dwarf { break; case DwarfConstants.DW_FORM_data1 : - obj = new Byte(in.get()); + obj = Byte.valueOf(in.get()); break; case DwarfConstants.DW_FORM_data2 : - obj = new Short(read_2_bytes(in)); + obj = Short.valueOf(read_2_bytes(in)); break; case DwarfConstants.DW_FORM_data4 : - obj = new Integer(read_4_bytes(in)); + obj = Integer.valueOf(read_4_bytes(in)); break; case DwarfConstants.DW_FORM_data8 : - obj = new Long(read_8_bytes(in)); + obj = Long.valueOf(read_8_bytes(in)); break; case DwarfConstants.DW_FORM_sdata : - obj = new Long(read_signed_leb128(in)); + obj = Long.valueOf(read_signed_leb128(in)); break; case DwarfConstants.DW_FORM_udata : - obj = new Long(read_unsigned_leb128(in)); + obj = Long.valueOf(read_unsigned_leb128(in)); break; case DwarfConstants.DW_FORM_string : @@ -682,7 +682,7 @@ public class Dwarf { break; case DwarfConstants.DW_FORM_flag : - obj = new Byte(in.get()); + obj = Byte.valueOf(in.get()); break; case DwarfConstants.DW_FORM_strp : @@ -742,23 +742,23 @@ public class Dwarf { break; case DwarfConstants.DW_FORM_ref1 : - obj = new Byte(in.get()); + obj = Byte.valueOf(in.get()); break; case DwarfConstants.DW_FORM_ref2 : - obj = new Short(read_2_bytes(in)); + obj = Short.valueOf(read_2_bytes(in)); break; case DwarfConstants.DW_FORM_ref4 : - obj = new Integer(read_4_bytes(in)); + obj = Integer.valueOf(read_4_bytes(in)); break; case DwarfConstants.DW_FORM_ref8 : - obj = new Long(read_8_bytes(in)); + obj = Long.valueOf(read_8_bytes(in)); break; case DwarfConstants.DW_FORM_ref_udata : - obj = new Long(read_unsigned_leb128(in)); + obj = Long.valueOf(read_unsigned_leb128(in)); break; case DwarfConstants.DW_FORM_indirect :