Reminded me of A nightmare on elm street (1984) (Possible spoilers)
I thought that the film had similarities to A nightmare on elm street.
It was most notable in the central storyline where Cody didn't want to fall asleep because a malevolent entity was manifested from his dreams.
Also when Cody was asleep there was a blurring of the lines between dreams and real life where you weren't sure what was real.