Print this page
rev 1081 : imported patch indy-cleanup-6893081.patch
rev 1082 : imported patch indy.compiler.patch
rev 1083 : [mq]: indy.compiler.inline.patch

Split Close
Expand all
Collapse all
          --- old/src/share/vm/ci/ciStreams.cpp
          +++ new/src/share/vm/ci/ciStreams.cpp
↓ open down ↓ 178 lines elided ↑ open up ↑
 179  179      return 0;
 180  180    }
 181  181  }
 182  182  
 183  183  // ------------------------------------------------------------------
 184  184  // ciBytecodeStream::get_klass
 185  185  //
 186  186  // If this bytecode is a new, newarray, multianewarray, instanceof,
 187  187  // or checkcast, get the referenced klass.
 188  188  ciKlass* ciBytecodeStream::get_klass(bool& will_link) {
 189      -  return CURRENT_ENV->get_klass_by_index(_holder, get_klass_index(),
 190      -                                         will_link);
      189 +  VM_ENTRY_MARK;
      190 +  constantPoolHandle cpool(_method->get_methodOop()->constants());
      191 +  return CURRENT_ENV->get_klass_by_index(cpool, get_klass_index(), will_link, _holder);
 191  192  }
 192  193  
 193  194  // ------------------------------------------------------------------
 194  195  // ciBytecodeStream::get_constant_index
 195  196  //
 196  197  // If this bytecode is one of the ldc variants, get the index of the
 197  198  // referenced constant.
 198  199  int ciBytecodeStream::get_constant_index() const {
 199  200    switch(cur_bc()) {
 200  201    case Bytecodes::_ldc:
↓ open down ↓ 5 lines elided ↑ open up ↑
 206  207      ShouldNotReachHere();
 207  208      return 0;
 208  209    }
 209  210  }
 210  211  // ------------------------------------------------------------------
 211  212  // ciBytecodeStream::get_constant
 212  213  //
 213  214  // If this bytecode is one of the ldc variants, get the referenced
 214  215  // constant.
 215  216  ciConstant ciBytecodeStream::get_constant() {
 216      -  return CURRENT_ENV->get_constant_by_index(_holder, get_constant_index());
      217 +  VM_ENTRY_MARK;
      218 +  constantPoolHandle cpool(_method->get_methodOop()->constants());
      219 +  return CURRENT_ENV->get_constant_by_index(cpool, get_constant_index(), _holder);
 217  220  }
 218  221  
 219  222  // ------------------------------------------------------------------
 220  223  bool ciBytecodeStream::is_unresolved_string() const {
 221  224    return CURRENT_ENV->is_unresolved_string(_holder, get_constant_index());
 222  225  }
 223  226  
 224  227  // ------------------------------------------------------------------
 225  228  bool ciBytecodeStream::is_unresolved_klass() const {
 226  229    return CURRENT_ENV->is_unresolved_klass(_holder, get_klass_index());
↓ open down ↓ 30 lines elided ↑ open up ↑
 257  260  //
 258  261  // Get the declared holder of the currently referenced field.
 259  262  //
 260  263  // Usage note: the holder() of a ciField class returns the canonical
 261  264  // holder of the field, rather than the holder declared in the
 262  265  // bytecodes.
 263  266  //
 264  267  // There is no "will_link" result passed back.  The user is responsible
 265  268  // for checking linkability when retrieving the associated field.
 266  269  ciInstanceKlass* ciBytecodeStream::get_declared_field_holder() {
      270 +  VM_ENTRY_MARK;
      271 +  constantPoolHandle cpool(_method->get_methodOop()->constants());
 267  272    int holder_index = get_field_holder_index();
 268  273    bool ignore;
 269      -  return CURRENT_ENV->get_klass_by_index(_holder, holder_index, ignore)
      274 +  return CURRENT_ENV->get_klass_by_index(cpool, holder_index, ignore, _holder)
 270  275        ->as_instance_klass();
 271  276  }
 272  277  
 273  278  // ------------------------------------------------------------------
 274  279  // ciBytecodeStream::get_field_holder_index
 275  280  //
 276  281  // Get the constant pool index of the declared holder of the field
 277  282  // referenced by the current bytecode.  Used for generating
 278  283  // deoptimization information.
 279  284  int ciBytecodeStream::get_field_holder_index() {
 280      -  VM_ENTRY_MARK;
 281      -  constantPoolOop cpool = _holder->get_instanceKlass()->constants();
 282      -  return cpool->klass_ref_index_at(get_field_index());
      285 +  GUARDED_VM_ENTRY(
      286 +    constantPoolOop cpool = _holder->get_instanceKlass()->constants();
      287 +    return cpool->klass_ref_index_at(get_field_index());
      288 +  )
 283  289  }
 284  290  
 285  291  // ------------------------------------------------------------------
 286  292  // ciBytecodeStream::get_field_signature_index
 287  293  //
 288  294  // Get the constant pool index of the signature of the field
 289  295  // referenced by the current bytecode.  Used for generating
 290  296  // deoptimization information.
 291  297  int ciBytecodeStream::get_field_signature_index() {
 292  298    VM_ENTRY_MARK;
↓ open down ↓ 21 lines elided ↑ open up ↑
 314  320    }
 315  321  #endif
 316  322    return get_index_int();
 317  323  }
 318  324  
 319  325  // ------------------------------------------------------------------
 320  326  // ciBytecodeStream::get_method
 321  327  //
 322  328  // If this is a method invocation bytecode, get the invoked method.
 323  329  ciMethod* ciBytecodeStream::get_method(bool& will_link) {
 324      -  ciMethod* m = CURRENT_ENV->get_method_by_index(_holder, get_method_index(), cur_bc());
      330 +  VM_ENTRY_MARK;
      331 +  constantPoolHandle cpool(_method->get_methodOop()->constants());
      332 +  ciMethod* m = CURRENT_ENV->get_method_by_index(cpool, get_method_index(), cur_bc(), _holder);
 325  333    will_link = m->is_loaded();
 326  334    return m;
 327  335  }
 328  336  
 329  337  // ------------------------------------------------------------------
 330  338  // ciBytecodeStream::get_declared_method_holder
 331  339  //
 332  340  // Get the declared holder of the currently referenced method.
 333  341  //
 334  342  // Usage note: the holder() of a ciMethod class returns the canonical
 335  343  // holder of the method, rather than the holder declared in the
 336  344  // bytecodes.
 337  345  //
 338  346  // There is no "will_link" result passed back.  The user is responsible
 339  347  // for checking linkability when retrieving the associated method.
 340  348  ciKlass* ciBytecodeStream::get_declared_method_holder() {
      349 +  VM_ENTRY_MARK;
      350 +  constantPoolHandle cpool(_method->get_methodOop()->constants());
 341  351    bool ignore;
 342  352    // report as InvokeDynamic for invokedynamic, which is syntactically classless
 343  353    if (cur_bc() == Bytecodes::_invokedynamic)
 344  354      return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_InvokeDynamic(), false);
 345      -  return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore);
      355 +  return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder);
 346  356  }
 347  357  
 348  358  // ------------------------------------------------------------------
 349  359  // ciBytecodeStream::get_method_holder_index
 350  360  //
 351  361  // Get the constant pool index of the declared holder of the method
 352  362  // referenced by the current bytecode.  Used for generating
 353  363  // deoptimization information.
 354  364  int ciBytecodeStream::get_method_holder_index() {
 355      -  VM_ENTRY_MARK;
 356      -  constantPoolOop cpool = _holder->get_instanceKlass()->constants();
      365 +  constantPoolOop cpool = _method->get_methodOop()->constants();
 357  366    return cpool->klass_ref_index_at(get_method_index());
 358  367  }
 359  368  
 360  369  // ------------------------------------------------------------------
 361  370  // ciBytecodeStream::get_method_signature_index
 362  371  //
 363  372  // Get the constant pool index of the signature of the method
 364  373  // referenced by the current bytecode.  Used for generating
 365  374  // deoptimization information.
 366  375  int ciBytecodeStream::get_method_signature_index() {
↓ open down ↓ 7 lines elided ↑ open up ↑
 374  383  // ------------------------------------------------------------------
 375  384  // ciBytecodeStream::get_cpcache
 376  385  ciCPCache* ciBytecodeStream::get_cpcache() {
 377  386    VM_ENTRY_MARK;
 378  387    // Get the constant pool.
 379  388    constantPoolOop      cpool   = _holder->get_instanceKlass()->constants();
 380  389    constantPoolCacheOop cpcache = cpool->cache();
 381  390  
 382  391    return CURRENT_ENV->get_object(cpcache)->as_cpcache();
 383  392  }
      393 +
      394 +// ------------------------------------------------------------------
      395 +// ciBytecodeStream::get_call_site
      396 +ciCallSite* ciBytecodeStream::get_call_site() {
      397 +  VM_ENTRY_MARK;
      398 +  // Get the constant pool.
      399 +  constantPoolOop      cpool   = _holder->get_instanceKlass()->constants();
      400 +  constantPoolCacheOop cpcache = cpool->cache();
      401 +
      402 +  // Get the CallSite from the constant pool cache.
      403 +  int method_index = get_method_index();
      404 +  ConstantPoolCacheEntry* cpcache_entry = cpcache->secondary_entry_at(method_index);
      405 +  oop call_site_oop = cpcache_entry->f1();
      406 +
      407 +  // Create a CallSite object and return it.
      408 +  return CURRENT_ENV->get_object(call_site_oop)->as_call_site();
      409 +}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX