src/cpu/ppc/vm/sharedRuntime_ppc.cpp

changeset 6512
fd1b9f02cc91
parent 6511
31e80afe3fed
child 6517
a433eb716ce1
     1.1 --- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Thu Mar 06 10:55:28 2014 -0800
     1.2 +++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Mon Mar 10 12:58:02 2014 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  /*
     1.5   * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 - * Copyright 2012, 2013 SAP AG. All rights reserved.
     1.7 + * Copyright 2012, 2014 SAP AG. All rights reserved.
     1.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.9   *
    1.10   * This code is free software; you can redistribute it and/or modify it
    1.11 @@ -957,6 +957,9 @@
    1.12  
    1.13  #ifdef CC_INTERP
    1.14    const Register tos = R17_tos;
    1.15 +#else
    1.16 +  const Register tos = R15_esp;
    1.17 +  __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    1.18  #endif
    1.19  
    1.20    // load TOS
    1.21 @@ -975,7 +978,7 @@
    1.22                              const BasicType *sig_bt,
    1.23                              const VMRegPair *regs) {
    1.24  
    1.25 -  // Load method's entry-point from methodOop.
    1.26 +  // Load method's entry-point from method.
    1.27    __ ld(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method);
    1.28    __ mtctr(R12_scratch2);
    1.29  
    1.30 @@ -996,7 +999,10 @@
    1.31  
    1.32  #ifdef CC_INTERP
    1.33    const Register ld_ptr = R17_tos;
    1.34 +#else
    1.35 +  const Register ld_ptr = R15_esp;
    1.36  #endif
    1.37 +
    1.38    const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 };
    1.39    const int num_value_regs = sizeof(value_regs) / sizeof(Register);
    1.40    int value_regs_index = 0;
    1.41 @@ -1087,8 +1093,8 @@
    1.42      }
    1.43    }
    1.44  
    1.45 -  BLOCK_COMMENT("Store method oop");
    1.46 -  // Store method oop into thread->callee_target.
    1.47 +  BLOCK_COMMENT("Store method");
    1.48 +  // Store method into thread->callee_target.
    1.49    // We might end up in handle_wrong_method if the callee is
    1.50    // deoptimized as we race thru here. If that happens we don't want
    1.51    // to take a safepoint because the caller frame will look
    1.52 @@ -2617,8 +2623,12 @@
    1.53  #ifdef CC_INTERP
    1.54    __ std(R1_SP, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    1.55  #else
    1.56 -  Unimplemented();
    1.57 +#ifdef ASSERT
    1.58 +  __ load_const_optimized(pc_reg, 0x5afe);
    1.59 +  __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
    1.60  #endif
    1.61 +  __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
    1.62 +#endif // CC_INTERP
    1.63    __ addi(number_of_frames_reg, number_of_frames_reg, -1);
    1.64    __ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
    1.65    __ addi(pcs_reg, pcs_reg, wordSize);
    1.66 @@ -2690,7 +2700,15 @@
    1.67    __ std(R12_scratch2, _abi(lr), R1_SP);
    1.68  
    1.69    // Initialize initial_caller_sp.
    1.70 +#ifdef CC_INTERP
    1.71    __ std(frame_size_reg/*old_sp*/, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
    1.72 +#else
    1.73 +#ifdef ASSERT
    1.74 + __ load_const_optimized(pc_reg, 0x5afe);
    1.75 + __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
    1.76 +#endif
    1.77 + __ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP);
    1.78 +#endif // CC_INTERP
    1.79  
    1.80  #ifdef ASSERT
    1.81    // Make sure that there is at least one entry in the array.
    1.82 @@ -2911,10 +2929,16 @@
    1.83    // optional c2i, caller of deoptee, ...).
    1.84  
    1.85    // Initialize R14_state.
    1.86 +#ifdef CC_INTERP
    1.87    __ ld(R14_state, 0, R1_SP);
    1.88    __ addi(R14_state, R14_state, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
    1.89    // Also inititialize R15_prev_state.
    1.90    __ restore_prev_state();
    1.91 +#else
    1.92 +  __ restore_interpreter_state(R11_scratch1);
    1.93 +  __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
    1.94 +#endif // CC_INTERP
    1.95 +
    1.96  
    1.97    // Return to the interpreter entry point.
    1.98    __ blr();
    1.99 @@ -3033,11 +3057,17 @@
   1.100    // stack: (top interpreter frame, ..., optional interpreter frame,
   1.101    // optional c2i, caller of deoptee, ...).
   1.102  
   1.103 +#ifdef CC_INTERP
   1.104    // Initialize R14_state, ...
   1.105    __ ld(R11_scratch1, 0, R1_SP);
   1.106    __ addi(R14_state, R11_scratch1, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
   1.107    // also initialize R15_prev_state.
   1.108    __ restore_prev_state();
   1.109 +#else
   1.110 +  __ restore_interpreter_state(R11_scratch1);
   1.111 +  __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
   1.112 +#endif // CC_INTERP
   1.113 +
   1.114    // Return to the interpreter entry point.
   1.115    __ blr();
   1.116  
   1.117 @@ -3115,7 +3145,6 @@
   1.118                                                        frame_size_in_bytes,
   1.119                                                        /*restore_ctr=*/true);
   1.120  
   1.121 -
   1.122    BLOCK_COMMENT("  Jump to forward_exception_entry.");
   1.123    // Jump to forward_exception_entry, with the issuing PC in LR
   1.124    // so it looks like the original nmethod called forward_exception_entry.
   1.125 @@ -3200,7 +3229,7 @@
   1.126  
   1.127    RegisterSaver::restore_live_registers_and_pop_frame(masm, frame_size_in_bytes, /*restore_ctr*/ false);
   1.128  
   1.129 -  // Get the returned methodOop.
   1.130 +  // Get the returned method.
   1.131    __ get_vm_result_2(R19_method);
   1.132  
   1.133    __ bctr();

mercurial