Optimizations to avoid deopt in v8