method
play

method George Kastrinis , Yannis Smaragdakis ~ Efficient and - PowerPoint PPT Presentation

E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis ~ Yannis Smaragdakis University of Athens E XECUTIVE S UMMARY Huge amount of analysis time spent on exceptions They mainly affect


  1. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis ~ Yannis Smaragdakis University of Athens

  2. E XECUTIVE S UMMARY ● Huge amount of analysis time spent on exceptions ● They mainly affect control-flow ● Significant speedup from coarsening exceptions ● Type-based merging as an effective coarsening ● No trade-off in precision (in “normal” code) ● Datalog formalism makes changes clear ● Also excellent implementation platform George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  3. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  4. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS What objects may a variable point to? (statically, object = allocation site) George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  5. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  6. R EFRESHER ON E XCEPTIONS void foo (...) throws AnException { try { ... throw new MyException(); ... } catch (OtherException e) { ... } } George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  7. S IGNIFICANCE OF E XCEPTIONS ● Exceptions are non-local control flow ● They are also regular objects with data fields ● How significant is the data-flow of exceptions? ● Our research indirectly answers this George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  8. F LOW O F O BJECTS method George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  9. N ORMAL F LOW O F O BJECTS arguments method return George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  10. E XCEPTIONAL F LOW O F O BJECTS arguments method return throw George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  11. Normal Flow arguments method VS return throw Exceptional Flow George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  12. Normal Flow Exceptional Flow VS Which one do you think dominates? ● i.e., for the average method are there more objects that may be thrown out of it or that may be passed into/out of it as args/returns? George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  13. Normal Flow Exceptional Flow VS Which one do you think dominates? normal flow exceptional flow George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  14. N EED P RECISE E XCEPTIONS ? George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  15. N EED P RECISE E XCEPTIONS ? Not per se George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  16. N EED P RECISE E XCEPTIONS ? Not per se Overall analysis effect George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  17. C OARSEN E XCEPTIONS A. Context Insensitive George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  18. C OARSEN E XCEPTIONS A. Context Insensitive B. Type-based Merging George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  19. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  20. E FFICIENT AND E FFECTIVE H ANDLING OF E XCEPTIONS IN J AVA P OINTS- T O A NALYSIS George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  21. I NPUT George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  22. J AVA C ODE v = new A(); to = from; to = base.fld; base.fld = from; void meth(..., A arg, ...) { ... return ret; } base.sig(...); George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  23. J AVA C ODE AS T ABLES A LLOC ( var, obj, meth ) v = new A(); O BJ T YPE ( obj, type ) to = from; M OVE ( to, from ) to = base.fld; L OAD ( to, base, fld ) base.fld = from; S TORE ( base, fld, from ) void meth(..., A arg, ...) { F ORMAL A RG ( meth, i, arg ) ... F ORMAL R ETURN ( meth, ret ) return ret; } VC ALL ( base, sig, invo ) base.sig(...); George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  24. J AVA C ODE AS T ABLES A LLOC ( var, obj, meth ) v = new A(); O BJ T YPE ( obj, type ) to = from; M OVE ( to, from ) to = base.fld; L OAD ( to, base, fld ) base.fld = from; S TORE ( base, fld, from ) void meth(..., A arg, ...) { F ORMAL A RG ( meth, i, arg ) ... F ORMAL R ETURN ( meth, ret ) return ret; } VC ALL ( base, sig, invo ) base.sig(...); George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  25. J AVA C ODE AS T ABLES A LLOC ( var, obj, meth ) v = new A(); O BJ T YPE ( obj, type ) to = from; M OVE ( to, from ) to = base.fld; L OAD ( to, base, fld ) base.fld = from; S TORE ( base, fld, from ) void meth(..., A arg, ...) { F ORMAL A RG ( meth, i, arg ) ... F ORMAL R ETURN ( meth, ret ) return ret; } VC ALL ( base, sig, invo ) base.sig(...); and many more... George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  26. J AVA C ODE AS T ABLES A LLOC ( var, obj, meth ) v = new A(); O BJ T YPE ( obj, type ) Blue is Input to = from; M OVE ( to, from ) to = base.fld; L OAD ( to, base, fld ) base.fld = from; S TORE ( base, fld, from ) void meth(..., A arg, ...) { F ORMAL A RG ( meth, i, arg ) ... F ORMAL R ETURN ( meth, ret ) return ret; } VC ALL ( base, sig, invo ) base.sig(...); and many more... George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  27. O UTPUT George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  28. O UTPUT most important... V AR P OINTS T O ( var, ctx, obj, objCtx ) George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  29. O UTPUT most important... V AR P OINTS T O ( var, ctx, obj, objCtx ) R EACHABLE ( meth, ctx ) C ALL G RAPH ( invo, callerCtx, meth, calleeCtx ) “On the fly” construction George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  30. O UTPUT most important... V AR P OINTS T O ( var, ctx, obj, objCtx ) R EACHABLE ( meth, ctx ) Orange is Output C ALL G RAPH ( invo, callerCtx, meth, calleeCtx ) “On the fly” construction George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  31. C ONTEXTS : B LACK B OX V AR P OINTS T O ( var, ctx, obj, objCtx ) R EACHABLE ( meth, ctx ) C ALL G RAPH ( invo, callerCtx, meth, calleeCtx ) George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  32. C ONTEXTS C ONSTRUCTORS V AR P OINTS T O ( var, ctx, obj, objCtx ) R EACHABLE ( meth, ctx ) C ALL G RAPH ( invo, callerCtx, meth, calleeCtx ) R ECORD ( ... ) = newObjCtx Pick Your Contexts Well: Understanding Object-Sensitivity M ERGE ( ... ) = newCtx Smaragdakis – Bravenboer – Lhotak POPL'11 George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  33. R ULES George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  34. E XAMPLE R ULE ← R ( x, y, w ), S ( y, z ). P ( x ), Q ( x, z ) George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  35. E XAMPLE R ULE P ( x ), Q ( x, z ) ← R ( x, y, w ), S ( y, z ). If... “Body” George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  36. E XAMPLE R ULE “Head” Then... ← R ( x, y, w ), S ( y, z ). P ( x ), Q ( x, z ) If... “Body” George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  37. O BJECT A LLOCATION var = new ... R EACHABLE ( meth, ctx ), A LLOC ( var, obj, meth ). George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

  38. O BJECT A LLOCATION var = new ... V AR P OINTS T O ( var, obj ) ← R EACHABLE ( meth, ctx ), A LLOC ( var, obj, meth ). George Kastrinis , Yannis Smaragdakis ~ Efficient and Effective Handling of Exceptions in Java Points-To Analysis

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend