Mercurial > hg > truffle
comparison src/share/vm/opto/parse3.cpp @ 1252:f516d5d7a019
6910605: C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
Summary: Set the reexecute bit for runtime calls _new_array_Java when they used for _multianewarray bytecode.
Reviewed-by: never
author | kvn |
---|---|
date | Mon, 08 Feb 2010 12:20:09 -0800 |
parents | dd57230ba8fe |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1251:576e77447e3c | 1252:f516d5d7a019 |
---|---|
1 /* | 1 /* |
2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1998-2010 Sun Microsystems, Inc. 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. |
437 } | 437 } |
438 } | 438 } |
439 | 439 |
440 // Can use multianewarray instead of [a]newarray if only one dimension, | 440 // Can use multianewarray instead of [a]newarray if only one dimension, |
441 // or if all non-final dimensions are small constants. | 441 // or if all non-final dimensions are small constants. |
442 if (expand_count == 1 || (1 <= expand_count && expand_count <= expand_limit)) { | 442 if (ndimensions == 1 || (1 <= expand_count && expand_count <= expand_limit)) { |
443 Node* obj = expand_multianewarray(array_klass, &length[0], ndimensions, ndimensions); | 443 Node* obj = NULL; |
444 // Set the original stack and the reexecute bit for the interpreter | |
445 // to reexecute the multianewarray bytecode if deoptimization happens. | |
446 // Do it unconditionally even for one dimension multianewarray. | |
447 // Note: the reexecute bit will be set in GraphKit::add_safepoint_edges() | |
448 // when AllocateArray node for newarray is created. | |
449 { PreserveReexecuteState preexecs(this); | |
450 _sp += ndimensions; | |
451 // Pass 0 as nargs since uncommon trap code does not need to restore stack. | |
452 obj = expand_multianewarray(array_klass, &length[0], ndimensions, 0); | |
453 } //original reexecute and sp are set back here | |
444 push(obj); | 454 push(obj); |
445 return; | 455 return; |
446 } | 456 } |
447 | 457 |
448 address fun = NULL; | 458 address fun = NULL; |