Heterogeneous multicore system could provide high flexibility for applications through integrating different types of cores. As the number of cores increases, more and more transistors are integrated which could lead to the rise of chip temperature, thus have a negative impact on the system performance. At present, the typical method to tackle this problem is dynamic voltage and frequency scaling (DVFS) which reduces the voltage and frequency to achieve cooling. However, DVFS will make the heterogeneous multicore system unable to take full advantage of its performance. This paper proposes a dynamic mapping method called TspDM which maximizes the system performance target under the premise of satisfying the temperature safety power. TspDM exploits the runtime performance counters of running threads to dynamically adjust thread mapping. Specifically, a lightweight Artificial Neural Network (ANN) model is proposed to obtain the thread-to-core type mapping when a remapping process is activated. Subsequently, TspDM determines the specific core locations of threads according to the number of threads mapped to a certain core type and the thermal safety power computation. The experimental results show that the proposed method is 21% better than that of PCMig while ensuring the thermal safety of heterogeneous platform. In addition, TspDM outperforms recent performance constrained and power constrained literature in terms of system throughput.