add calculate stack and locals