@@ -23,7 +23,9 @@ void JSDispatchEntry::MakeJSDispatchEntry(Address object, Address entrypoint,
23
23
uint16_t parameter_count,
24
24
bool mark_as_alive) {
25
25
DCHECK_EQ (object & kHeapObjectTag , 0 );
26
+ #if !defined(__illumos__) || !defined(V8_TARGET_ARCH_64_BIT)
26
27
DCHECK_EQ ((object << kObjectPointerShift ) >> kObjectPointerShift , object);
28
+ #endif /* __illumos__ */
27
29
28
30
Address payload =
29
31
(object << kObjectPointerShift ) | (parameter_count & kParameterCountMask );
@@ -49,7 +51,14 @@ Address JSDispatchEntry::GetCodePointer() const {
49
51
// and so may be 0 or 1 here. As the return value is a tagged pointer, the
50
52
// bit must be 1 when returned, so we need to set it here.
51
53
Address payload = encoded_word_.load (std::memory_order_relaxed);
54
+ #if defined(__illumos__) && defined(V8_TARGET_ARCH_64_BIT)
55
+ // Unsigned types won't sign-extend on shift-right, but we need to do
56
+ // this with illumos VA48 addressing.
57
+ return (Address)((intptr_t )payload >> (int )kObjectPointerShift ) |
58
+ kHeapObjectTag ;
59
+ #else
52
60
return (payload >> kObjectPointerShift ) | kHeapObjectTag ;
61
+ #endif /* __illumos__ */
53
62
}
54
63
55
64
Tagged<Code> JSDispatchEntry::GetCode () const {
@@ -205,7 +214,12 @@ void JSDispatchEntry::MakeFreelistEntry(uint32_t next_entry_index) {
205
214
bool JSDispatchEntry::IsFreelistEntry () const {
206
215
#ifdef V8_TARGET_ARCH_64_BIT
207
216
auto entrypoint = entrypoint_.load (std::memory_order_relaxed);
217
+ #ifdef __illumos__
218
+ // See the illumos definition of kFreeEntryTag for why we have to do this.
219
+ return (entrypoint & 0xffff000000000000ull ) == kFreeEntryTag ;
220
+ #else
208
221
return (entrypoint & kFreeEntryTag ) == kFreeEntryTag ;
222
+ #endif /* __illumos__ */
209
223
#else
210
224
return next_free_entry_.load (std::memory_order_relaxed) != 0 ;
211
225
#endif
0 commit comments