387 int ndimensions = iter().get_dimensions();
388
389 // the m-dimensional array
390 bool will_link;
391 ciArrayKlass* array_klass = iter().get_klass(will_link)->as_array_klass();
392 assert(will_link, "multianewarray: typeflow responsibility");
393
394 // Note: Array classes are always initialized; no is_initialized check.
395
396 kill_dead_locals();
397
398 // get the lengths from the stack (first dimension is on top)
399 Node** length = NEW_RESOURCE_ARRAY(Node*, ndimensions + 1);
400 length[ndimensions] = NULL; // terminating null for make_runtime_call
401 int j;
402 for (j = ndimensions-1; j >= 0 ; j--) length[j] = pop();
403
404 // The original expression was of this form: new T[length0][length1]...
405 // It is often the case that the lengths are small (except the last).
406 // If that happens, use the fast 1-d creator a constant number of times.
407 const jint expand_limit = MIN2((juint)MultiArrayExpandLimit, (juint)100);
408 jint expand_count = 1; // count of allocations in the expansion
409 jint expand_fanout = 1; // running total fanout
410 for (j = 0; j < ndimensions-1; j++) {
411 jint dim_con = find_int_con(length[j], -1);
412 expand_fanout *= dim_con;
413 expand_count += expand_fanout; // count the level-J sub-arrays
414 if (dim_con <= 0
415 || dim_con > expand_limit
416 || expand_count > expand_limit) {
417 expand_count = 0;
418 break;
419 }
420 }
421
422 // Can use multianewarray instead of [a]newarray if only one dimension,
423 // or if all non-final dimensions are small constants.
424 if (ndimensions == 1 || (1 <= expand_count && expand_count <= expand_limit)) {
425 Node* obj = NULL;
426 // Set the original stack and the reexecute bit for the interpreter
427 // to reexecute the multianewarray bytecode if deoptimization happens.
|
387 int ndimensions = iter().get_dimensions();
388
389 // the m-dimensional array
390 bool will_link;
391 ciArrayKlass* array_klass = iter().get_klass(will_link)->as_array_klass();
392 assert(will_link, "multianewarray: typeflow responsibility");
393
394 // Note: Array classes are always initialized; no is_initialized check.
395
396 kill_dead_locals();
397
398 // get the lengths from the stack (first dimension is on top)
399 Node** length = NEW_RESOURCE_ARRAY(Node*, ndimensions + 1);
400 length[ndimensions] = NULL; // terminating null for make_runtime_call
401 int j;
402 for (j = ndimensions-1; j >= 0 ; j--) length[j] = pop();
403
404 // The original expression was of this form: new T[length0][length1]...
405 // It is often the case that the lengths are small (except the last).
406 // If that happens, use the fast 1-d creator a constant number of times.
407 const jint expand_limit = MIN2((jint)MultiArrayExpandLimit, 100);
408 jint expand_count = 1; // count of allocations in the expansion
409 jint expand_fanout = 1; // running total fanout
410 for (j = 0; j < ndimensions-1; j++) {
411 jint dim_con = find_int_con(length[j], -1);
412 expand_fanout *= dim_con;
413 expand_count += expand_fanout; // count the level-J sub-arrays
414 if (dim_con <= 0
415 || dim_con > expand_limit
416 || expand_count > expand_limit) {
417 expand_count = 0;
418 break;
419 }
420 }
421
422 // Can use multianewarray instead of [a]newarray if only one dimension,
423 // or if all non-final dimensions are small constants.
424 if (ndimensions == 1 || (1 <= expand_count && expand_count <= expand_limit)) {
425 Node* obj = NULL;
426 // Set the original stack and the reexecute bit for the interpreter
427 // to reexecute the multianewarray bytecode if deoptimization happens.
|