Anyways, tony makes a deal in the beginning that he's going to give up his heart or soul? He's drunk and depressed so he doesn't remember later. In exchange for jarvis living (i think??) It turns out the demon is tricky, it gives tony the code to create J.A.R.V.I.S. but does not save the real one.
Later on, the demon or witch is fighting the avengers and tries to take tony's heart but the arc reactor prevents it. Laaater on, it's post im3 and he no longer has the arc reactor. But then it turns out his "heart" is the arc reactor so they have to get it from the bottom of the ocean