41 } |
41 } |
42 #else |
42 #else |
43 #define TRACE_BCEA(level, code) |
43 #define TRACE_BCEA(level, code) |
44 #endif |
44 #endif |
45 |
45 |
46 // Maintain a map of which aguments a local variable or |
46 // Maintain a map of which arguments a local variable or |
47 // stack slot may contain. In addition to tracking |
47 // stack slot may contain. In addition to tracking |
48 // arguments, it tracks two special values, "allocated" |
48 // arguments, it tracks two special values, "allocated" |
49 // which represents any object allocated in the current |
49 // which represents any object allocated in the current |
50 // method, and "unknown" which is any other object. |
50 // method, and "unknown" which is any other object. |
51 // Up to 30 arguments are handled, with the last one |
51 // Up to 30 arguments are handled, with the last one |
317 |
317 |
318 // adjust escape state of actual parameters |
318 // adjust escape state of actual parameters |
319 bool must_record_dependencies = false; |
319 bool must_record_dependencies = false; |
320 for (i = arg_size - 1; i >= 0; i--) { |
320 for (i = arg_size - 1; i >= 0; i--) { |
321 ArgumentMap arg = state.raw_pop(); |
321 ArgumentMap arg = state.raw_pop(); |
322 if (!is_argument(arg)) |
322 // Check if callee arg is a caller arg or an allocated object |
|
323 bool allocated = arg.contains_allocated(); |
|
324 if (!(is_argument(arg) || allocated)) |
323 continue; |
325 continue; |
324 for (int j = 0; j < _arg_size; j++) { |
326 for (int j = 0; j < _arg_size; j++) { |
325 if (arg.contains(j)) { |
327 if (arg.contains(j)) { |
326 _arg_modified[j] |= analyzer._arg_modified[i]; |
328 _arg_modified[j] |= analyzer._arg_modified[i]; |
327 } |
329 } |
328 } |
330 } |
329 if (!is_arg_stack(arg)) { |
331 if (!(is_arg_stack(arg) || allocated)) { |
330 // arguments have already been recognized as escaping |
332 // arguments have already been recognized as escaping |
331 } else if (analyzer.is_arg_stack(i) && !analyzer.is_arg_returned(i)) { |
333 } else if (analyzer.is_arg_stack(i) && !analyzer.is_arg_returned(i)) { |
332 set_method_escape(arg); |
334 set_method_escape(arg); |
333 must_record_dependencies = true; |
335 must_record_dependencies = true; |
334 } else { |
336 } else { |