diff options
Diffstat (limited to 'deps/v8/src/runtime/runtime-utils.h')
-rw-r--r-- | deps/v8/src/runtime/runtime-utils.h | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/deps/v8/src/runtime/runtime-utils.h b/deps/v8/src/runtime/runtime-utils.h index e58934ba33..7d35010435 100644 --- a/deps/v8/src/runtime/runtime-utils.h +++ b/deps/v8/src/runtime/runtime-utils.h @@ -7,6 +7,7 @@ #include "src/base/logging.h" #include "src/globals.h" +#include "src/objects.h" #include "src/runtime/runtime.h" namespace v8 { @@ -17,7 +18,7 @@ namespace internal { // expected type we crash safely. #define CONVERT_ARG_CHECKED(Type, name, index) \ CHECK(args[index]->Is##Type()); \ - Type* name = Type::cast(args[index]); + Type name = Type::cast(args[index]); #define CONVERT_ARG_HANDLE_CHECKED(Type, name, index) \ CHECK(args[index]->Is##Type()); \ @@ -109,43 +110,23 @@ namespace internal { // allocated by the caller, and passed as a pointer in a hidden first parameter. #ifdef V8_HOST_ARCH_64_BIT struct ObjectPair { - Object* x; - Object* y; + Address x; + Address y; }; - -static inline ObjectPair MakePair(Object* x, Object* y) { - ObjectPair result = {x, y}; +static inline ObjectPair MakePair(Object x, Object y) { + ObjectPair result = {x->ptr(), y->ptr()}; // Pointers x and y returned in rax and rdx, in AMD-x64-abi. // In Win64 they are assigned to a hidden first argument. return result; } -#elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT -// For x32 a 128-bit struct return is done as rax and rdx from the ObjectPair -// are used in generated code. An alternative is using uint64_t and modifying -// generated code. -struct ObjectPair { - Object* x; - uint32_t x_upper; - Object* y; - uint32_t y_upper; -}; - - -static inline ObjectPair MakePair(Object* x, Object* y) { - ObjectPair result = {x, 0, y, 0}; - // Pointers x and y returned in rax and rdx, in x32-abi. - return result; -} #else typedef uint64_t ObjectPair; -static inline ObjectPair MakePair(Object* x, Object* y) { +static inline ObjectPair MakePair(Object x, Object y) { #if defined(V8_TARGET_LITTLE_ENDIAN) - return reinterpret_cast<uint32_t>(x) | - (reinterpret_cast<ObjectPair>(y) << 32); + return x->ptr() | (static_cast<ObjectPair>(y->ptr()) << 32); #elif defined(V8_TARGET_BIG_ENDIAN) - return reinterpret_cast<uint32_t>(y) | - (reinterpret_cast<ObjectPair>(x) << 32); + return y->ptr() | (static_cast<ObjectPair>(x->ptr()) << 32); #else #error Unknown endianness #endif |