Commits on Dec 21, 2010
  1. fix race condition leading to deadlock on exit

    dicej committed Dec 21, 2010
    There is a delay between when we tell the OS to start a thread and
    when it actually starts, and during that time a thread might
    mistakenly think it was the last to exit, try to shut down the VM, and
    then block in joinAll when it finds it wasn't the last one after all.
    The solution is to increment Machine::liveCount and add the new thread
    to the process tree before starting it -- all while holding
    Machine::stateLock for atomicity.  This helps guarantee that when
    liveCount is one, we can be sure there's really only one thread
    running or staged to run.
Commits on Dec 20, 2010
  1. set Thread::exception to null before creating ExceptionInInitializerE…

    dicej committed Dec 20, 2010
    If we don't do this, the VM will crash when it tries to create a stack
    trace for the error because makeObjectArray will return null
    immediately when it sees there is a pending exception.
  2. use "no-underscore" naming convention for 64-bit Windows

    dicej committed Dec 20, 2010
    GCC 4.5.1 and later use a naming convention where functions are not
    prefixed with an underscore, whereas previous versions added the
    underscore.  This change was made to ensure compatibility with
    Microsoft's compiler.  Since GCC 4.5.0 has a serious code generation
    bug, we now only support later versions, so it makes sense to assume
    the newer convention.
Commits on Dec 16, 2010
  1. fix race condition in monitorRelease

    dicej committed Dec 16, 2010
    There was an unlikely but dangerous race condition in monitorRelease
    such that when a thread released a monitor and then tried to notify
    the next thread in line, the latter thread might exit before it can be
    notified.  This potentially led to a crash as the former thread tried
    to acquire and notify the latter thread's private lock after it had
    been disposed.
    The solution is to do as we do in the interrupt and join cases: call
    acquireSystem first and thereby either block the target thread from
    exiting until we're done or find that it has already exited, in which
    case nothing needs to be done.
    I also looked at monitorNotify to see if we have a similar bug there,
    but in that case the target thread can't exit without first acquiring
    and releasing the monitor, and since we ensure that no thread can
    execute monitorNotify without holding the monitor, there's no
    potential for a race.
Commits on Dec 15, 2010
Commits on Dec 10, 2010
  1. update gprIndex when switching to stack-based argument passing

    dicej committed Dec 10, 2010
    This is necessary when passing a 64-bit value on 32-bit ARM since
    otherwise we risk using a register for the following argument instead
    of the stack.
  2. fix GC safety bugs

    dicej committed Dec 10, 2010
  3. fix assertion abort when generating boot image

    dicej committed Dec 10, 2010
    In makeCodeImage, we were passing zero to Promise::Listener::resolve,
    which would lead to an assertion error if the address of the code
    image was further from the base of the address space (i.e. zero) than
    could be spanned by a jump on the target architecture.  Since, in this
    context, we immediately overwrite the value stored, we may pass
    whatever we want to this function (we're only calling it so we can
    retrieve the location of the value in the image), and the code image
    pointer is a better choice for the above reason.
  4. avoid inifinite recursion if java.lang.Object is missing; refactoring

    dicej committed Dec 10, 2010
    When trying to create an array class, we try to resolve
    java.lang.Object so we can use its vtable in the array class.
    However, if Object is missing, we'll try to create and throw a
    ClassNotFoundException, which requires creating an array to store the
    stack trace, which requires creating an array class, which requires
    resolving Object, etc..  This commit short-circuits this process by
    telling resolveClass not to create and throw an exception if it can't
    find Object.
    While doing the above work, I noticed that the implementations of
    Classpath::makeThrowable in classpath-avian.cpp and
    classpath-openjdk.cpp were identical, so I made makeThrowable a
    top-level function.
    Finally, I discovered that Thread.setDaemon can only be called before
    the target thread has been started, which allowed me to simplify the
    code to track daemon threads in the VM.
Commits on Dec 9, 2010
Commits on Dec 8, 2010
Commits on Dec 7, 2010
  1. fix return address code offset calculation on ARM

    dicej committed Dec 7, 2010
    We have to be careful about how we calculate return addresses on ARM
    due to padding introduced by constant pools interspersed with code.
    When calculating the offset of code where we're inserting a constant
    pool, we want the offset of the end of the pool for jump targets, but
    we want the offset just prior to the beginning of the pool (i.e. the
    offset of the instruction responsible for jumping past the pool) when
    calculating a return address.
Commits on Dec 6, 2010
  1. update copyright years

    dicej committed Dec 6, 2010
  2. add boot-javahome.cpp

    dicej committed Dec 6, 2010
    This should have been included in an earlier commit.
  3. fix misspelling in

    dicej committed Dec 6, 2010
Commits on Dec 4, 2010
Commits on Dec 3, 2010
  1. fix PowerPC build

    dicej committed Dec 3, 2010
Commits on Dec 2, 2010
  1. fix posix openjdk-src build

    dicej committed Dec 2, 2010
  2. revert part of earlier comment involving setDaemon and runJavaThread

    dicej committed Dec 2, 2010
    The code added to runJavaThread was unecessary and harmful since it
    allowed the global daemon thread count to become permanently
    out-of-sync with the actual number of daemon threads.
  3. fix windows cross openjdk-src build

    dicej committed Dec 2, 2010
    This mainly involves some makefile ugliness to work around bugs in the
    native Windows OpenJDK code involving conflicting static and
    not-static declarations which GCC 4.0 and later justifiably reject but
    MSVC tolerates.
Commits on Dec 1, 2010
  1. fix windows cross build

    dicej committed Dec 1, 2010