@@ -23,7 +23,9 @@ void JSDispatchEntry::MakeJSDispatchEntry(Address object, Address entrypoint,
2323                                          uint16_t  parameter_count,
2424                                          bool  mark_as_alive) {
2525  DCHECK_EQ (object & kHeapObjectTag , 0 );
26+ #if  !defined(__illumos__) || !defined(V8_TARGET_ARCH_64_BIT)
2627  DCHECK_EQ ((object << kObjectPointerShift ) >> kObjectPointerShift , object);
28+ #endif  /*  __illumos__ */ 
2729
2830  Address payload =
2931      (object << kObjectPointerShift ) | (parameter_count & kParameterCountMask );
@@ -49,7 +51,14 @@ Address JSDispatchEntry::GetCodePointer() const {
4951  //  and so may be 0 or 1 here. As the return value is a tagged pointer, the
5052  //  bit must be 1 when returned, so we need to set it here.
5153  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 
5260  return  (payload >> kObjectPointerShift ) | kHeapObjectTag ;
61+ #endif  /*  __illumos__ */ 
5362}
5463
5564Tagged<Code> JSDispatchEntry::GetCode () const  {
@@ -205,7 +214,12 @@ void JSDispatchEntry::MakeFreelistEntry(uint32_t next_entry_index) {
205214bool  JSDispatchEntry::IsFreelistEntry () const  {
206215#ifdef  V8_TARGET_ARCH_64_BIT
207216  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 
208221  return  (entrypoint & kFreeEntryTag ) == kFreeEntryTag ;
222+ #endif  /*  __illumos__ */ 
209223#else 
210224  return  next_free_entry_.load (std::memory_order_relaxed) != 0 ;
211225#endif 
0 commit comments