comparison src/share/vm/jvmci/jvmciCodeInstaller.cpp @ 23674:09a536b9233c

8158850: [JVMCI] be more precise when enforcing OopMapValue encoding limitations
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 09 Jun 2016 18:45:12 -0700
parents 9ed5b586018b
children eb166b568645
comparison
equal deleted inserted replaced
23673:7ef84c807bfe 23674:09a536b9233c
83 JVMCI_ERROR_NULL("unaligned subregister offset %d in oop map", offset); 83 JVMCI_ERROR_NULL("unaligned subregister offset %d in oop map", offset);
84 } 84 }
85 } else { 85 } else {
86 // stack slot 86 // stack slot
87 if (offset % 4 == 0) { 87 if (offset % 4 == 0) {
88 return VMRegImpl::stack2reg(offset / 4); 88 VMReg vmReg = VMRegImpl::stack2reg(offset / 4);
89 if (!OopMapValue::legal_vm_reg_name(vmReg)) {
90 // This restriction only applies to VMRegs that are used in OopMap but
91 // since that's the only use of VMRegs it's simplest to put this test
92 // here. This test should also be equivalent legal_vm_reg_name but JVMCI
93 // clients can use max_oop_map_stack_stack_offset to detect this problem
94 // directly. The asserts just ensure that the tests are in agreement.
95 assert(offset > JVMCIRuntime::max_oop_map_stack_offset, "illegal VMReg");
96 JVMCI_ERROR_NULL("stack offset %d is too large to be encoded in OopMap (max %d)",
97 offset, JVMCIRuntime::max_oop_map_stack_offset);
98 }
99 assert(OopMapValue::legal_vm_reg_name(vmReg), "illegal VMReg");
100 return vmReg;
89 } else { 101 } else {
90 JVMCI_ERROR_NULL("unaligned stack offset %d in oop map", offset); 102 JVMCI_ERROR_NULL("unaligned stack offset %d in oop map", offset);
91 } 103 }
92 } 104 }
93 } 105 }