src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

changeset 1636
24128c2ffa87
parent 1635
ba263cfb7611
child 1639
18a389214829
     1.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Jan 29 12:13:05 2010 +0100
     1.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Fri Jan 29 08:33:24 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 2000-2010 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -418,12 +418,13 @@
    1.11  }
    1.12  
    1.13  
    1.14 -int LIR_Assembler::emit_exception_handler() {
    1.15 +void LIR_Assembler::emit_exception_handler() {
    1.16    // if the last instruction is a call (typically to do a throw which
    1.17    // is coming at the end after block reordering) the return address
    1.18    // must still point into the code area in order to avoid assertion
    1.19    // failures when searching for the corresponding bci => add a nop
    1.20    // (was bug 5/14/1999 - gri)
    1.21 +
    1.22    __ nop();
    1.23  
    1.24    // generate code for exception handler
    1.25 @@ -431,10 +432,13 @@
    1.26    if (handler_base == NULL) {
    1.27      // not enough space left for the handler
    1.28      bailout("exception handler overflow");
    1.29 -    return -1;
    1.30 +    return;
    1.31    }
    1.32 -
    1.33 +#ifdef ASSERT
    1.34    int offset = code_offset();
    1.35 +#endif // ASSERT
    1.36 +
    1.37 +  compilation()->offsets()->set_value(CodeOffsets::Exceptions, code_offset());
    1.38  
    1.39    // if the method does not have an exception handler, then there is
    1.40    // no reason to search for one
    1.41 @@ -470,19 +474,19 @@
    1.42    // unwind activation and forward exception to caller
    1.43    // rax,: exception
    1.44    __ jump(RuntimeAddress(Runtime1::entry_for(Runtime1::unwind_exception_id)));
    1.45 +
    1.46    assert(code_offset() - offset <= exception_handler_size, "overflow");
    1.47 +
    1.48    __ end_a_stub();
    1.49 -
    1.50 -  return offset;
    1.51  }
    1.52  
    1.53 -
    1.54 -int LIR_Assembler::emit_deopt_handler() {
    1.55 +void LIR_Assembler::emit_deopt_handler() {
    1.56    // if the last instruction is a call (typically to do a throw which
    1.57    // is coming at the end after block reordering) the return address
    1.58    // must still point into the code area in order to avoid assertion
    1.59    // failures when searching for the corresponding bci => add a nop
    1.60    // (was bug 5/14/1999 - gri)
    1.61 +
    1.62    __ nop();
    1.63  
    1.64    // generate code for exception handler
    1.65 @@ -490,17 +494,23 @@
    1.66    if (handler_base == NULL) {
    1.67      // not enough space left for the handler
    1.68      bailout("deopt handler overflow");
    1.69 -    return -1;
    1.70 +    return;
    1.71    }
    1.72 -
    1.73 +#ifdef ASSERT
    1.74    int offset = code_offset();
    1.75 +#endif // ASSERT
    1.76 +
    1.77 +  compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset());
    1.78 +
    1.79    InternalAddress here(__ pc());
    1.80    __ pushptr(here.addr());
    1.81 +
    1.82    __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
    1.83 +
    1.84    assert(code_offset() - offset <= deopt_handler_size, "overflow");
    1.85 +
    1.86    __ end_a_stub();
    1.87  
    1.88 -  return offset;
    1.89  }
    1.90  
    1.91  

mercurial