src/share/vm/shark/sharkNativeWrapper.cpp

changeset 4314
2cd5e15048e6
parent 2708
1d1603768966
child 6876
710a3c8b516e
child 9669
32bc598624bd
     1.1 --- a/src/share/vm/shark/sharkNativeWrapper.cpp	Mon Nov 26 17:25:11 2012 -0800
     1.2 +++ b/src/share/vm/shark/sharkNativeWrapper.cpp	Tue Nov 27 12:48:52 2012 -0800
     1.3 @@ -59,7 +59,6 @@
     1.4    OopMap *oopmap = new OopMap(
     1.5      SharkStack::oopmap_slot_munge(stack()->oopmap_frame_size()),
     1.6      SharkStack::oopmap_slot_munge(arg_size()));
     1.7 -  oopmap->set_oop(SharkStack::slot2reg(stack()->method_slot_offset()));
     1.8  
     1.9    // Set up the oop_tmp slot if required:
    1.10    //  - For static methods we use it to handlize the class argument
    1.11 @@ -83,9 +82,9 @@
    1.12    }
    1.13  
    1.14    // Start building the argument list
    1.15 -  std::vector<const Type*> param_types;
    1.16 +  std::vector<Type*> param_types;
    1.17    std::vector<Value*> param_values;
    1.18 -  const PointerType *box_type = PointerType::getUnqual(SharkType::oop_type());
    1.19 +  PointerType *box_type = PointerType::getUnqual(SharkType::oop_type());
    1.20  
    1.21    // First argument is the JNIEnv
    1.22    param_types.push_back(SharkType::jniEnv_type());
    1.23 @@ -149,7 +148,7 @@
    1.24        builder()->CreateBr(merge);
    1.25  
    1.26        builder()->SetInsertPoint(merge);
    1.27 -      phi = builder()->CreatePHI(box_type, "boxed_object");
    1.28 +      phi = builder()->CreatePHI(box_type, 0, "boxed_object");
    1.29        phi->addIncoming(ConstantPointerNull::get(box_type), null);
    1.30        phi->addIncoming(box, not_null);
    1.31        box = phi;
    1.32 @@ -170,7 +169,7 @@
    1.33        // fall through
    1.34  
    1.35      default:
    1.36 -      const Type *param_type = SharkType::to_stackType(arg_type(i));
    1.37 +      Type *param_type = SharkType::to_stackType(arg_type(i));
    1.38  
    1.39        param_types.push_back(param_type);
    1.40        param_values.push_back(
    1.41 @@ -201,7 +200,7 @@
    1.42  
    1.43    // Make the call
    1.44    BasicType result_type = target()->result_type();
    1.45 -  const Type* return_type;
    1.46 +  Type* return_type;
    1.47    if (result_type == T_VOID)
    1.48      return_type = SharkType::void_type();
    1.49    else if (is_returning_oop())
    1.50 @@ -213,7 +212,7 @@
    1.51       PointerType::getUnqual(
    1.52         FunctionType::get(return_type, param_types, false)));
    1.53    Value *result = builder()->CreateCall(
    1.54 -    native_function, param_values.begin(), param_values.end());
    1.55 +    native_function, llvm::makeArrayRef(param_values));
    1.56  
    1.57    // Start the transition back to _thread_in_Java
    1.58    CreateSetThreadState(_thread_in_native_trans);
    1.59 @@ -221,7 +220,7 @@
    1.60    // Make sure new state is visible in the GC thread
    1.61    if (os::is_MP()) {
    1.62      if (UseMembar)
    1.63 -      builder()->CreateMemoryBarrier(SharkBuilder::BARRIER_STORELOAD);
    1.64 +      builder()->CreateFence(llvm::SequentiallyConsistent, llvm::CrossThread);
    1.65      else
    1.66        CreateWriteMemorySerializePage();
    1.67    }
    1.68 @@ -305,7 +304,7 @@
    1.69      builder()->CreateBr(merge);
    1.70  
    1.71      builder()->SetInsertPoint(merge);
    1.72 -    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "result");
    1.73 +    PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), 0, "result");
    1.74      phi->addIncoming(LLVMValue::null(), null);
    1.75      phi->addIncoming(unboxed_result, not_null);
    1.76      result = phi;

mercurial