Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:42:16+00:00 2026-06-07T04:42:16+00:00

I am working on an optimizer for Java bytecode and decided to use SSA.

  • 0

I am working on an optimizer for Java bytecode and decided to use SSA. However, most optimizations require all operations to be purely functional, so in order to handle side effects, I decided to add an extra opaque state parameter and return value for every operation which could potentially have side effects. This will prevent optimizing away or reordering operations with side effects. For example, ignoring exception handling, you’d get something like this pseudocode.

function arguments: x1, e1
if x1 != 0
    x2 = add(x1, 3)
    x3, e2 = invoke(foo, x2, e1)
x4 = phi(x1, x3)
e3 = phi(e1, e2)
return x4, e3

Is there a name for what I’m doing? Is it a good approach? I have heard that functional languages have a concept called Monads, which sounds similar but is not the same. Is using monads a better approach? If so, how can I modify this to use monads?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:42:18+00:00Added an answer on June 7, 2026 at 4:42 am

    This was too long to fit in a comment, but it’s not really meant to be an answer..

    Firm calls it “memory edges”, there may be more names. I’ve heard it being called “explicit state passing”, but google appears to disagree.

    But I disagree with your premises – most SSA optimizations work just fine (at times a little kludgy perhaps) in the presence of side effects. What doesn’t work is using a graph representation without making side effects explicit (obviously the order would disappear). But you only need something to make that order explicit – SSA also works as a “list of operations”, where the order is simply fixed (except perhaps in an explicit reordering phase), but in that case it can still be easier to make side effects explicit (leads to fewer special cases in optimizations etc).

    It’s a fine approach. I don’t know how it relates to Monads though, I don’t understand them and I probably never will.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no working knowledge of Java script and am trying to get into
I'm working on a large website project that makes heavy use of in-page graphing
I'm working on a Java application which should allow users to optimize their daily
I am working on a spring project. I use ant to deploy application and
I have gotten my basic L-System working and I decided to try and optimize
I'm working on a puzzle that involves analyzing all size k subsets and figuring
Currently I am working on a project that would use genetic algorithms to optimize
I'm implementing a java SAX parser in my Android app. I've got everything working,
I'm currently working with a specialized, interpreted, programming language implemented in Java. As a
I am working on an application and one design approach involves extremely heavy use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.