[arm64] Fix compile error in Simulator
Some compilers complain that ConvertReturn is private in SimulatorBase, but used in the arm64 Simulator. This CL fixes this by making ConvertReturn protected. R=ulan@chromium.org Bug: v8:7541 Change-Id: I9326b2c746829e9c37c58c14561811b32929c615 Reviewed-on: https://chromium-review.googlesource.com/955689 Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#51834}
This commit is contained in:
parent
43d8696639
commit
b3f4a377a0
@ -45,6 +45,26 @@ class SimulatorBase {
|
||||
return ConvertReturn<Return>(ret);
|
||||
}
|
||||
|
||||
// Convert back integral return types. This is always a narrowing conversion.
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_integral<T>::value, T>::type
|
||||
ConvertReturn(intptr_t ret) {
|
||||
static_assert(sizeof(T) <= sizeof(intptr_t), "type bigger than ptrsize");
|
||||
return static_cast<T>(ret);
|
||||
}
|
||||
|
||||
// Convert back pointer-typed return types.
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_pointer<T>::value, T>::type
|
||||
ConvertReturn(intptr_t ret) {
|
||||
return reinterpret_cast<T>(ret);
|
||||
}
|
||||
|
||||
// Convert back void return type (i.e. no return).
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_void<T>::value, T>::type ConvertReturn(
|
||||
intptr_t ret) {}
|
||||
|
||||
private:
|
||||
// Runtime call support.
|
||||
static void* RedirectExternalReference(void* external_function,
|
||||
@ -82,26 +102,6 @@ class SimulatorBase {
|
||||
ConvertArg(T arg) {
|
||||
return reinterpret_cast<intptr_t>(arg);
|
||||
}
|
||||
|
||||
// Convert back integral return types. This is always a narrowing conversion.
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_integral<T>::value, T>::type
|
||||
ConvertReturn(intptr_t ret) {
|
||||
static_assert(sizeof(T) <= sizeof(intptr_t), "type bigger than ptrsize");
|
||||
return static_cast<T>(ret);
|
||||
}
|
||||
|
||||
// Convert back pointer-typed return types.
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_pointer<T>::value, T>::type
|
||||
ConvertReturn(intptr_t ret) {
|
||||
return reinterpret_cast<T>(ret);
|
||||
}
|
||||
|
||||
// Convert back void return type (i.e. no return).
|
||||
template <typename T>
|
||||
static typename std::enable_if<std::is_void<T>::value, T>::type ConvertReturn(
|
||||
intptr_t ret) {}
|
||||
};
|
||||
|
||||
// When the generated code calls an external reference we need to catch that in
|
||||
|
Loading…
Reference in New Issue
Block a user