summaryrefslogtreecommitdiffstats
path: root/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-01-14 13:16:06 -0800
committerJesse Wilson <jessewilson@google.com>2011-01-14 13:16:06 -0800
commitdfc5e8e159e7df3efa47d553b7725be22839665d (patch)
treedf9c019f0157158c9e304fd5a852abd0a8909f64 /dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
parent5a31bab5cef310b202efae550366ee3cb96a8b82 (diff)
downloadandroid_dalvik-dfc5e8e159e7df3efa47d553b7725be22839665d.tar.gz
android_dalvik-dfc5e8e159e7df3efa47d553b7725be22839665d.tar.bz2
android_dalvik-dfc5e8e159e7df3efa47d553b7725be22839665d.zip
Read Dex files from a byte[] rather than a RandomAccessFile.
This improves time to merge a trivial file with core.dex from 3.8 seconds to 0.8 seconds. Also fixing read method names to be consistent with the spec. Change-Id: I9033bcb497afe7a0d73e00cca14fa046b53a62bf
Diffstat (limited to 'dx/src/com/android/dx/dex/file/DebugInfoEncoder.java')
-rw-r--r--dx/src/com/android/dx/dex/file/DebugInfoEncoder.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java b/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
index 08b663793..d9d4ebcdc 100644
--- a/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
+++ b/dx/src/com/android/dx/dex/file/DebugInfoEncoder.java
@@ -376,7 +376,7 @@ public final class DebugInfoEncoder {
PositionList.Entry entry = sortedPositions.get(0);
line = entry.getPosition().getLine();
}
- output.writeUnsignedLeb128(line);
+ output.writeUleb128(line);
if (annotate) {
annotate(output.getCursor() - mark, "line_start: " + line);
@@ -403,7 +403,7 @@ public final class DebugInfoEncoder {
// Write out the number of parameter entries that will follow.
mark = output.getCursor();
- output.writeUnsignedLeb128(szParamTypes);
+ output.writeUleb128(szParamTypes);
if (annotate) {
annotate(output.getCursor() - mark,
@@ -638,10 +638,10 @@ public final class DebugInfoEncoder {
*/
private void emitStringIndex(CstUtf8 string) throws IOException {
if ((string == null) || (file == null)) {
- output.writeUnsignedLeb128(0);
+ output.writeUleb128(0);
} else {
- output.writeUnsignedLeb128(
- 1 + file.getStringIds().indexOf(string));
+ output.writeUleb128(
+ 1 + file.getStringIds().indexOf(string));
}
if (DEBUG) {
@@ -659,10 +659,10 @@ public final class DebugInfoEncoder {
*/
private void emitTypeIndex(CstType type) throws IOException {
if ((type == null) || (file == null)) {
- output.writeUnsignedLeb128(0);
+ output.writeUleb128(0);
} else {
- output.writeUnsignedLeb128(
- 1 + file.getTypeIds().indexOf(type));
+ output.writeUleb128(
+ 1 + file.getTypeIds().indexOf(type));
}
if (DEBUG) {
@@ -748,7 +748,7 @@ public final class DebugInfoEncoder {
int mark = output.getCursor();
output.writeByte(DBG_END_LOCAL);
- output.writeUnsignedLeb128(entry.getRegister());
+ output.writeUleb128(entry.getRegister());
if (annotateTo != null || debugPrint != null) {
annotate(output.getCursor() - mark,
@@ -851,7 +851,7 @@ public final class DebugInfoEncoder {
int mark = output.getCursor();
output.writeByte(DBG_ADVANCE_LINE);
- output.writeSignedLeb128(deltaLines);
+ output.writeSleb128(deltaLines);
line += deltaLines;
if (annotateTo != null || debugPrint != null) {
@@ -875,7 +875,7 @@ public final class DebugInfoEncoder {
int mark = output.getCursor();
output.writeByte(DBG_ADVANCE_PC);
- output.writeUnsignedLeb128(deltaAddress);
+ output.writeUleb128(deltaAddress);
address += deltaAddress;
if (annotateTo != null || debugPrint != null) {
@@ -903,7 +903,7 @@ public final class DebugInfoEncoder {
"Signed value where unsigned required: " + n);
}
- output.writeUnsignedLeb128(n);
+ output.writeUleb128(n);
}
/**