Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciCodeInstaller.cpp @ 22722:0229a2ca608b
Make kindToBasicType trapping.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 05 Nov 2015 10:59:29 +0100 |
parents | 510846133438 |
children | eb2091fcd682 |
comparison
equal
deleted
inserted
replaced
22721:510846133438 | 22722:0229a2ca608b |
---|---|
276 if (value->is_a(PrimitiveConstant::klass())) { | 276 if (value->is_a(PrimitiveConstant::klass())) { |
277 if (value->is_a(RawConstant::klass())) { | 277 if (value->is_a(RawConstant::klass())) { |
278 jlong prim = PrimitiveConstant::primitive(value); | 278 jlong prim = PrimitiveConstant::primitive(value); |
279 return new ConstantLongValue(prim); | 279 return new ConstantLongValue(prim); |
280 } else { | 280 } else { |
281 BasicType constantType = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(PrimitiveConstant::kind(value))); | 281 BasicType constantType = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(PrimitiveConstant::kind(value)), CHECK_NULL); |
282 if (type != constantType) { | 282 if (type != constantType) { |
283 JVMCI_ERROR_NULL("primitive constant type doesn't match, expected %s but got %s", basictype_to_str(type), basictype_to_str(constantType)); | 283 JVMCI_ERROR_NULL("primitive constant type doesn't match, expected %s but got %s", basictype_to_str(type), basictype_to_str(constantType)); |
284 } | 284 } |
285 if (type == T_INT || type == T_FLOAT) { | 285 if (type == T_INT || type == T_FLOAT) { |
286 jint prim = (jint)PrimitiveConstant::primitive(value); | 286 jint prim = (jint)PrimitiveConstant::primitive(value); |
344 objArrayHandle values = VirtualObject::values(value); | 344 objArrayHandle values = VirtualObject::values(value); |
345 objArrayHandle slotKinds = VirtualObject::slotKinds(value); | 345 objArrayHandle slotKinds = VirtualObject::slotKinds(value); |
346 for (jint i = 0; i < values->length(); i++) { | 346 for (jint i = 0; i < values->length(); i++) { |
347 ScopeValue* cur_second = NULL; | 347 ScopeValue* cur_second = NULL; |
348 Handle object = values->obj_at(i); | 348 Handle object = values->obj_at(i); |
349 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i))); | 349 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i)), CHECK); |
350 ScopeValue* value = get_scope_value(object, type, objects, cur_second, CHECK); | 350 ScopeValue* value = get_scope_value(object, type, objects, cur_second, CHECK); |
351 | 351 |
352 if (isLongArray && cur_second == NULL) { | 352 if (isLongArray && cur_second == NULL) { |
353 // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations. | 353 // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations. |
354 // add an int 0 constant | 354 // add an int 0 constant |
843 | 843 |
844 for (jint i = 0; i < values->length(); i++) { | 844 for (jint i = 0; i < values->length(); i++) { |
845 ScopeValue* second = NULL; | 845 ScopeValue* second = NULL; |
846 Handle value = values->obj_at(i); | 846 Handle value = values->obj_at(i); |
847 if (i < local_count) { | 847 if (i < local_count) { |
848 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i))); | 848 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i)), CHECK); |
849 ScopeValue* first = get_scope_value(value, type, objects, second, CHECK); | 849 ScopeValue* first = get_scope_value(value, type, objects, second, CHECK); |
850 if (second != NULL) { | 850 if (second != NULL) { |
851 locals->append(second); | 851 locals->append(second); |
852 } | 852 } |
853 locals->append(first); | 853 locals->append(first); |
854 } else if (i < local_count + expression_count) { | 854 } else if (i < local_count + expression_count) { |
855 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i))); | 855 BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(slotKinds->obj_at(i)), CHECK); |
856 ScopeValue* first = get_scope_value(value, type, objects, second, CHECK); | 856 ScopeValue* first = get_scope_value(value, type, objects, second, CHECK); |
857 if (second != NULL) { | 857 if (second != NULL) { |
858 expressions->append(second); | 858 expressions->append(second); |
859 } | 859 } |
860 expressions->append(first); | 860 expressions->append(first); |