| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3522731 commit 838e233
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.4', | ||
| 41 | + 'v8_embedder_string': '-node.5', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1985,7 +1985,16 @@ TNode<Code> CodeStubAssembler::LoadCodeObjectFromJSDispatchTable( | |||
| 1985 | 1985 | // The LSB is used as marking bit by the js dispatch table, so here we have | |
| 1986 | 1986 | // to set it using a bitwise OR as it may or may not be set. | |
| 1987 | 1987 | value = UncheckedCast<UintPtrT>(WordOr( | |
| 1988 | + #if defined(__illumos__) && defined(V8_HOST_ARCH_64_BIT) | ||
| 1989 | + // Pointers in illumos span both the low 2^47 range and the high 2^47 range | ||
| 1990 | + // as well. Checking the high bit being set in illumos means all higher bits | ||
| 1991 | + // need to be set to 1 after shifting right. | ||
| 1992 | + // Try WordSar() so any high-bit check wouldn't be necessary. | ||
| 1993 | + WordSar(UncheckedCast<IntPtrT>(value), | ||
| 1994 | + IntPtrConstant(JSDispatchEntry::kObjectPointerShift)), | ||
| 1995 | + #else | ||
| 1988 | 1996 | WordShr(value, UintPtrConstant(JSDispatchEntry::kObjectPointerShift)), | |
| 1997 | + #endif /* __illumos__ */ | ||
| 1989 | 1998 | UintPtrConstant(kHeapObjectTag))); | |
| 1990 | 1999 | return CAST(BitcastWordToTagged(value)); | |
| 1991 | 2000 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,22 @@ struct JSDispatchEntry { | |||
| 78 | 78 | #if defined(V8_TARGET_ARCH_64_BIT) | |
| 79 | 79 | // Freelist entries contain the index of the next free entry in their lower 32 | |
| 80 | 80 | // bits and are tagged with this tag. | |
| 81 | + #ifdef __illumos__ | ||
| 82 | + // In illumos 64-bit apps, pointers are allocated both the bottom 2^47 range | ||
| 83 | + // AND the top 2^47 range in the 64-bit space. Instead of 47 bits of VA space | ||
| 84 | + // we have 48 bits. This means, however, the top 16-bits may be 0xffff. We | ||
| 85 | + // therefore pick a different value for the kFreeEntryTag. If/when we go to | ||
| 86 | + // VA57, aka 5-level paging, we'll need to revisit this again, as will node | ||
| 87 | + // by default, since the fixed-bits on the high end will shrink from top | ||
| 88 | + // 16-bits to top 8-bits. | ||
| 89 | + // | ||
| 90 | + // Unless illumos ships an Oracle-Solaris-like VA47 link-time options to | ||
| 91 | + // restrict pointers from allocating from above the Virtual Address hole, | ||
| 92 | + // we need to be mindful of this. | ||
| 93 | + static constexpr Address kFreeEntryTag = 0xfeed000000000000ull; | ||
| 94 | + #else | ||
| 81 | 95 | static constexpr Address kFreeEntryTag = 0xffff000000000000ull; | |
| 96 | + #endif /* __illumos__ */ | ||
| 82 | 97 | #ifdef V8_TARGET_BIG_ENDIAN | |
| 83 | 98 | // 2-byte parameter count is on the least significant side of encoded_word_. | |
| 84 | 99 | static constexpr int kBigEndianParamCountOffset = | |
| Back | FazBrowse Home | New Git URL |
0 commit comments