Use array copy to avoid v8 deoptimization