History log of /dalvik/libdex/SysUtil.h
Revision Date Author Comments
bbe8cb53ab16b5c3ff2520ba2af4f2a4a5947a9d 17-Dec-2012 Elliott Hughes <enh@google.com> Remove dead code.

Change-Id: I56c27c510c8fc0ba2d8e691c788b433dce250f7a
356839bd278d7c7f2675b56755d4a2f0e4a5d88c 31-Jan-2012 Chris Dearman <chris@mips.com> Set SYSTEM_PAGE_SIZE from PAGE_SHIFT

Hardwiring the expected page size is not portable

Signed-off-by: Chris Dearman <chris@mips.com>
375fb116bcb817b37509ab579dbd55cdbb765cbf 15-Jun-2011 Carl Shapiro <cshapiro@google.com> Normalize the include guard style.

An leading underscore followed by a capital letter is a reserved
name space in C and C++.

This change also moves any #include directives within the include
guard in some of the compiler/codegen/arm header files.

Change-Id: I9715e2c5301699d31886e61d0fe6e29483555a2a
bfc9799b1a53fd6f6136d07e6278d4538cf70f13 27-Apr-2011 Carl Shapiro <cshapiro@google.com> Make libdex structures tool friendly.

Previously, the struct name and its typedef name were identical. This
confuses emacs and etags. This change eliminates the typedef names and
removes the extern "C" wrapping the libdex header files. To support
this change the transitive C dependencies have been made to compile as
C++ instead.

Change-Id: I7065f32d61d776f9b09c7b461adf2502268d852f
ae188c676c681e47a93ade7fdf0144099b470e03 08-Apr-2011 Carl Shapiro <cshapiro@google.com> Compile the garbage collector and heap profiler as C++.

Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589
650177ee24fbe07cdd9ad9d8913fbf44cf44be13 16-Dec-2010 Dan Bornstein <danfuzz@android.com> Expose sysCopyFileToFile() and use it.

Moved from ZipArchive.c, with tweaks to for argument order and name. Also
tweaked a related function in ZipArchive to match.

Change-Id: I4d2e3c8b44386d87c5aa1c4565f72da87357fce8
fbdcfb9ea9e2a78f295834424c3f24986ea45dac 29-May-2010 Brian Carlstrom <bdc@google.com> Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

Change-Id: I0c0edb3ebf0d5e040d6bbbf60269fab0deb70ef9
80a4e2497c3b5ef24fe1408c678053fbc6cd4b25 24-Apr-2010 Andy McFadden <fadden@android.com> Dalvik Zip rewrite.

Change the way zip archives are handled. This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory magic
on a buffer of data read from the file, instead of a memory-mapped section.
We use what we find to create a map that covers the Central Directory only.
For most uses in the VM this is all we really need, since we just want
to check file attributes vs. the optimized DEX to see if we're out of date.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it. We also now do a file-to-file extraction
using read() calls instead of a buffer-to-file extraction on mmap()ed data.
No difference in performance (as measured by first-boot dexopt).

Since this is more of a rewrite than an update, I also took the opportunity
to change buffer size variables from "long" to "size_t", and normalized
return values to int (some were using bool, which is common in the VM but
was mixed in the zip code). Failure messages are now all LOGW with the
word "Zip" up front (didn't want to change log tag away from "dalvikvm").

Also, removed a not-quite-right check in the "map part of a file" code,
and clarified that the file offset is absolute.

For bug 2620103.

Change-Id: I745fb15abb541376f467969ffe422222676f1e5f
64896a2543ee54e47c586f4cf26f54e7fdb366bd 05-May-2010 Andy McFadden <fadden@android.com> Write until we fall over.

Implement enh's idea about repeating write() until it fails. Use it
in the zip expander and dexopt, which have an above-average chance of
failing due to lack of disk space.

Replace a stray DEFAULT_PAGE_SIZE with SYSTEM_PAGE_SIZE. Apparently I
missed that during the Great Page Size Unification.

Change-Id: Id173cb7669330deebe2f24ae23ece4009a90e3bd
8911f7a2222124ba724a4a9281555b74d0e098e2 24-Apr-2010 Andy McFadden <fadden@android.com> Dalvik Zip rewrite.

Change the way zip archives are handled. This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory magic
on a buffer of data read from the file, instead of a memory-mapped section.
We use what we find to create a map that covers the Central Directory only.
For most uses in the VM this is all we really need, since we just want
to check file attributes vs. the optimized DEX to see if we're out of date.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it. We also now do a file-to-file extraction
using read() calls instead of a buffer-to-file extraction on mmap()ed data.
No difference in performance (as measured by first-boot dexopt).

Since this is more of a rewrite than an update, I also took the opportunity
to change buffer size variables from "long" to "size_t", and normalized
return values to int (some were using bool, which is common in the VM but
was mixed in the zip code). Failure messages are now all LOGW with the
word "Zip" up front (didn't want to change log tag away from "dalvikvm").

Also, removed a not-quite-right check in the "map part of a file" code,
and clarified that the file offset is absolute.

For bug 2620103.

Change-Id: I745fb15abb541376f467969ffe422222676f1e5f
b5ebe47515c9750c7347557075d3714ba7671aa9 17-Nov-2009 Andy McFadden <fadden@android.com> Restore support for DEX on FAT.

The recent change to mmap(read-write)+mprotect(read-only) doesn't seem
to work on FAT filesystems like /sdcard. This caused problems for the
code that opens Zip files and the code that opens DEX files.

This change splits the "map file" function into "read only" and
"writable read only" versions, using the former for Zip and the latter
for DEX. Further, failure to mprotect(read-only) is now considered a
soft failure and only causes a warning.

The only apps that will be affected by this are those using /sdcard to
hold optimized DEX data for "plugin" APKs.

Also: moved the non-HAVE_POSIX_FILEMAP implementation of file mapping
into a shared function. (Could probably go away entirely.)

Also: fixed the expected output for test 071.
96516932f1557d8f48a8b2dbbb885af01a11ef6e 29-Oct-2009 Andy McFadden <fadden@android.com> Change the way breakpoints work.

This replaces the breakpoint mechanism with a more efficient approach.
We now insert breakpoint instructions into the bytecode stream instead of
maintaining a table. This requires mapping DEX files as private instead
of shared, which allows copy-on-write to work. mprotect() is used to
guard the pages against inadvertent writes.

Unused opcode EC is now OP_BREAKPOINT. It's not recognized by dexdump or
any interpreter except portdbg, but it can be encountered by the bytecode
verifier (the debugger can request breakpoints in unverified code).
Breakpoint changes are blocked while the verifier runs to avoid races.

This eliminates method->debugBreakpointCount, which is no longer needed.
(Also, it clashed with LinearAlloc's read-only mode.)

The deferred verification error mechanism was using a code-copying
approach to modify the bytecode stream. That has been changed to use
the same copy-on-write modification mechanism.

Also, normalized all PAGE_SIZE/PAGESIZE references to a single
SYSTEM_PAGE_SIZE define.

Simple Fibonacci computation test times (opal-eng):
JIT, no debugger: 10.6ms
Fast interp, no debugger: 36ms
Portable interp, no debugger: 43.8ms

ORIG debug interp, no breakpoints set: 458ms
ORIG debug interp, breakpoint set nearby: 697ms

NEW debug interp, no breakpoints set: 341ms
NEW debug interp, breakpoints set nearby: 341ms

Where "nearby" means there's a breakpoint in the method doing the
computation that isn't actually hit -- the VM had an optimization where
it flagged methods with breakpoints and skipped some of the processing
when possible.

The bottom line is that code should run noticeably faster while a
debugger is attached.
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
99409883d9c4c0ffb49b070ce307bb33a9dfe9f1 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import //branches/master/...@140412
f6c387128427e121477c1b32ad35cdcaa5101ba3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
f72d5de56a522ac3be03873bdde26f23a5eeeb3c 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
2ad60cfc28e14ee8f0bb038720836a4696c478ad 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution