hotspot/src/cpu/s390/vm/interp_masm_s390.cpp
changeset 46427 54713555867e
parent 43420 a056d6465ef9
child 46461 7155d5ff2d07
equal deleted inserted replaced
46426:02a1fc064144 46427:54713555867e
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright (c) 2016 SAP SE. All rights reserved.
     3  * Copyright (c) 2016, 2017 SAP SE. All rights reserved.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     7  * under the terms of the GNU General Public License version 2 only, as
     8  * published by the Free Software Foundation.
     8  * published by the Free Software Foundation.
   369   //  - from word index to byte offset.
   369   //  - from word index to byte offset.
   370   // Since this is a java object, it is potentially compressed.
   370   // Since this is a java object, it is potentially compressed.
   371   Register tmp = index;  // reuse
   371   Register tmp = index;  // reuse
   372   z_sllg(index, index, LogBytesPerHeapOop); // Offset into resolved references array.
   372   z_sllg(index, index, LogBytesPerHeapOop); // Offset into resolved references array.
   373   // Load pointer for resolved_references[] objArray.
   373   // Load pointer for resolved_references[] objArray.
   374   z_lg(result, ConstantPool::resolved_references_offset_in_bytes(), result);
   374   z_lg(result, ConstantPool::cache_offset_in_bytes(), result);
       
   375   z_lg(result, ConstantPoolCache::resolved_references_offset_in_bytes(), result);
   375   // JNIHandles::resolve(result)
   376   // JNIHandles::resolve(result)
   376   z_lg(result, 0, result); // Load resolved references array itself.
   377   z_lg(result, 0, result); // Load resolved references array itself.
   377 #ifdef ASSERT
   378 #ifdef ASSERT
   378   NearLabel index_ok;
   379   NearLabel index_ok;
   379   z_lgf(Z_R0, Address(result, arrayOopDesc::length_offset_in_bytes()));
   380   z_lgf(Z_R0, Address(result, arrayOopDesc::length_offset_in_bytes()));
   382   stop("resolved reference index out of bounds", 0x09256);
   383   stop("resolved reference index out of bounds", 0x09256);
   383   bind(index_ok);
   384   bind(index_ok);
   384 #endif
   385 #endif
   385   z_agr(result, index);    // Address of indexed array element.
   386   z_agr(result, index);    // Address of indexed array element.
   386   load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result);
   387   load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result);
       
   388 }
       
   389 
       
   390 // load cpool->resolved_klass_at(index)
       
   391 void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register cpool, Register offset, Register iklass) {
       
   392   // int value = *(Rcpool->int_at_addr(which));
       
   393   // int resolved_klass_index = extract_low_short_from_int(value);
       
   394   z_llgh(offset, Address(cpool, offset, sizeof(ConstantPool) + 2)); // offset = resolved_klass_index (s390 is big-endian)
       
   395   z_sllg(offset, offset, LogBytesPerWord);                          // Convert 'index' to 'offset'
       
   396   z_lg(iklass, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes())); // iklass = cpool->_resolved_klasses
       
   397   z_lg(iklass, Address(iklass, offset, Array<Klass*>::base_offset_in_bytes()));
   387 }
   398 }
   388 
   399 
   389 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache,
   400 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache,
   390                                                                Register tmp,
   401                                                                Register tmp,
   391                                                                int bcp_offset,
   402                                                                int bcp_offset,