[mips] Adjust some functions and macro's position.
Macro 'USE_SIMULATOR' should wrap the whole v8::internal namespace. Change-Id: I2b0102e563b6cb976e5a450363bc770f8d5628e2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1916439 Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#65069}
This commit is contained in:
parent
e34c42db27
commit
e614ca2c5d
@ -15,6 +15,23 @@
|
||||
// globals.h defines USE_SIMULATOR.
|
||||
#include "src/common/globals.h"
|
||||
|
||||
template <typename T>
|
||||
int Compare(const T& a, const T& b) {
|
||||
if (a == b)
|
||||
return 0;
|
||||
else if (a < b)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Returns the negative absolute value of its argument.
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_signed<T>::value>::type>
|
||||
T Nabs(T a) {
|
||||
return a < 0 ? a : -a;
|
||||
}
|
||||
|
||||
#if defined(USE_SIMULATOR)
|
||||
// Running with a simulator.
|
||||
|
||||
@ -693,26 +710,9 @@ class Simulator : public SimulatorBase {
|
||||
LocalMonitor local_monitor_;
|
||||
GlobalMonitor::LinkedAddress global_monitor_thread_;
|
||||
};
|
||||
#endif // defined(USE_SIMULATOR)
|
||||
|
||||
template <typename T>
|
||||
int Compare(const T& a, const T& b) {
|
||||
if (a == b)
|
||||
return 0;
|
||||
else if (a < b)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Returns the negative absolute value of its argument.
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_signed<T>::value>::type>
|
||||
T Nabs(T a) {
|
||||
return a < 0 ? a : -a;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // defined(USE_SIMULATOR)
|
||||
#endif // V8_EXECUTION_MIPS_SIMULATOR_MIPS_H_
|
||||
|
@ -15,6 +15,23 @@
|
||||
// globals.h defines USE_SIMULATOR.
|
||||
#include "src/common/globals.h"
|
||||
|
||||
template <typename T>
|
||||
int Compare(const T& a, const T& b) {
|
||||
if (a == b)
|
||||
return 0;
|
||||
else if (a < b)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Returns the negative absolute value of its argument.
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_signed<T>::value>::type>
|
||||
T Nabs(T a) {
|
||||
return a < 0 ? a : -a;
|
||||
}
|
||||
|
||||
#if defined(USE_SIMULATOR)
|
||||
// Running with a simulator.
|
||||
|
||||
@ -716,26 +733,9 @@ class Simulator : public SimulatorBase {
|
||||
LocalMonitor local_monitor_;
|
||||
GlobalMonitor::LinkedAddress global_monitor_thread_;
|
||||
};
|
||||
#endif // defined(USE_SIMULATOR)
|
||||
|
||||
template <typename T>
|
||||
int Compare(const T& a, const T& b) {
|
||||
if (a == b)
|
||||
return 0;
|
||||
else if (a < b)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Returns the negative absolute value of its argument.
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_signed<T>::value>::type>
|
||||
T Nabs(T a) {
|
||||
return a < 0 ? a : -a;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // defined(USE_SIMULATOR)
|
||||
#endif // V8_EXECUTION_MIPS64_SIMULATOR_MIPS64_H_
|
||||
|
Loading…
Reference in New Issue
Block a user