hotspot/src/cpu/x86/vm/interp_masm_x86.cpp
changeset 46427 54713555867e
parent 41082 a0ed7f3b6205
child 46449 7b2416f0f524
equal deleted inserted replaced
46426:02a1fc064144 46427:54713555867e
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   507   Register tmp = index;  // reuse
   507   Register tmp = index;  // reuse
   508   shll(tmp, LogBytesPerHeapOop);
   508   shll(tmp, LogBytesPerHeapOop);
   509 
   509 
   510   get_constant_pool(result);
   510   get_constant_pool(result);
   511   // load pointer for resolved_references[] objArray
   511   // load pointer for resolved_references[] objArray
   512   movptr(result, Address(result, ConstantPool::resolved_references_offset_in_bytes()));
   512   movptr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
       
   513   movptr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
   513   // JNIHandles::resolve(obj);
   514   // JNIHandles::resolve(obj);
   514   movptr(result, Address(result, 0));
   515   movptr(result, Address(result, 0));
   515   // Add in the index
   516   // Add in the index
   516   addptr(result, tmp);
   517   addptr(result, tmp);
   517   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
   518   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
   518 }
   519 }
   519 
   520 
       
   521 // load cpool->resolved_klass_at(index)
       
   522 void InterpreterMacroAssembler::load_resolved_klass_at_index(Register cpool,
       
   523                                            Register index, Register klass) {
       
   524   movw(index, Address(cpool, index, Address::times_ptr, sizeof(ConstantPool)));
       
   525   Register resolved_klasses = cpool;
       
   526   movptr(resolved_klasses, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes()));
       
   527   movptr(klass, Address(resolved_klasses, index, Address::times_ptr, Array<Klass*>::base_offset_in_bytes()));
       
   528 }
   520 
   529 
   521 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
   530 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
   522 // subtype of super_klass.
   531 // subtype of super_klass.
   523 //
   532 //
   524 // Args:
   533 // Args: