Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consumedTypes/producedTypes in TypeFlowAnalysis and ICodeCheckers #6234

Closed
scabug opened this issue Aug 14, 2012 · 7 comments
Closed

Use consumedTypes/producedTypes in TypeFlowAnalysis and ICodeCheckers #6234

scabug opened this issue Aug 14, 2012 · 7 comments

Comments

@scabug
Copy link

scabug commented Aug 14, 2012

The consumedTypes/producedTypes for icode instructions are redundantly defined in 3 separate places:

  • Opcodes.scala (consumedTypes/producedTypes)
  • ICodeCheckers.scala (for checking icode)
  • TypeFlowAnalysis.scala (for computing types on the stack at each
    program point)

Since the Opcodes types are the only ones visible outside, I suggest
we use them in ICodeCheckers.scala and TypeFlowAnalysis.scala too. But
we should make such changes after the release, after chilling out
by the lake with a glass of good wine for a couple of days.

A relevant discussion on this can be found at:
https://groups.google.com/forum/?fromgroups#!topic/scala-internals/qcyTjk8euUI[1-25]

@scabug
Copy link
Author

scabug commented Aug 14, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6234?orig=1
Reporter: @VladUreche

@scabug
Copy link
Author

scabug commented Aug 15, 2012

@magarciaEPFL said:
TypeFlowAnalysis does not define any consumedTypes or producedTypes for ICode instructions. The closest it does is using one of them, in just one place, as shown next:

        case cm @ CALL_METHOD(_, _) =>
          stack pop cm.consumed
          cm.producedTypes foreach (stack push _)

I don't see why TypeFlowAnalysis should be touched at all.

@scabug
Copy link
Author

scabug commented Aug 15, 2012

@VladUreche said:
I guess it would make sense to have it do something like:

  stack popAndCheck cm.consumedTypes
  cm.producedTypes foreach (stack push _)

And the same for all instructions. WDTY?

@scabug
Copy link
Author

scabug commented Aug 15, 2012

@magarciaEPFL said:
There's no need to replace current functionality in TypeFlowAnalysis, which is working fine as we all know.

Instead, further assertions can be added. In the example, before popping from the stack, an assert can be added to cross-check with cm.consumedTypes.

@scabug
Copy link
Author

scabug commented Aug 16, 2012

@VladUreche said:
Also related: #5819

@scabug
Copy link
Author

scabug commented Jul 10, 2013

@adriaanm said:
Unassigning and rescheduling to M6 as previous deadline was missed.

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue
Copy link
Member

likely no longer applicable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants