Skip to content

Commit

Permalink
deps: patch V8 to run on older XCode versions
Browse files Browse the repository at this point in the history
Patch V8 (compiler/js-heap-broker.cc) to remove the use of an optional
property, which is a fairly new C++ feature, since that requires a newer
XCode version than the minimum requirement in BUILDING.md and thus
breaks CI.

PR-URL: nodejs#29694
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
  • Loading branch information
ryzokuken authored and mmarchini committed Mar 4, 2020
1 parent 60f3e5e commit 8ceed05
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.2',
'v8_embedder_string': '-node.7',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 2 additions & 0 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1760,9 +1760,11 @@ class V8_EXPORT ScriptCompiler {
public:
enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 };

#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
V8_DEPRECATE_SOON(
"This class takes ownership of source_stream, so use the constructor "
"taking a unique_ptr to make these semantics clearer")
#endif
StreamedSource(ExternalSourceStream* source_stream, Encoding encoding);
StreamedSource(std::unique_ptr<ExternalSourceStream> source_stream,
Encoding encoding);
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/codegen/arm64/register-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ using Simd128Register = VRegister;
// Lists of registers.
class V8_EXPORT_PRIVATE CPURegList {
public:
CPURegList() = default;

template <typename... CPURegisters>
explicit CPURegList(CPURegister reg0, CPURegisters... regs)
: list_(CPURegister::ListOf(reg0, regs...)),
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/compiler/js-heap-broker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4275,6 +4275,7 @@ GlobalAccessFeedback::GlobalAccessFeedback(PropertyCellRef cell,

GlobalAccessFeedback::GlobalAccessFeedback(FeedbackSlotKind slot_kind)
: ProcessedFeedback(kGlobalAccess, slot_kind),
cell_or_context_(base::nullopt),
index_and_immutable_(0 /* doesn't matter */) {
DCHECK(IsGlobalICKind(slot_kind));
}
Expand Down
31 changes: 31 additions & 0 deletions deps/v8/src/diagnostics/unwinding-info-win64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,37 @@
#error "Unsupported OS"
#endif // V8_OS_WIN_X64

// Forward declaration to keep this independent of Win8
NTSYSAPI
DWORD
NTAPI
RtlAddGrowableFunctionTable(
_Out_ PVOID* DynamicTable,
_In_reads_(MaximumEntryCount) PRUNTIME_FUNCTION FunctionTable,
_In_ DWORD EntryCount,
_In_ DWORD MaximumEntryCount,
_In_ ULONG_PTR RangeBase,
_In_ ULONG_PTR RangeEnd
);


NTSYSAPI
void
NTAPI
RtlGrowFunctionTable(
_Inout_ PVOID DynamicTable,
_In_ DWORD NewEntryCount
);


NTSYSAPI
void
NTAPI
RtlDeleteGrowableFunctionTable(
_In_ PVOID DynamicTable
);


namespace v8 {
namespace internal {
namespace win64_unwindinfo {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/interpreter/interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Interpreter::NewSourcePositionCollectionJob(
auto job = std::make_unique<InterpreterCompilationJob>(parse_info, literal,
allocator, nullptr);
job->compilation_info()->SetBytecodeArray(existing_bytecode);
return job;
return std::unique_ptr<UnoptimizedCompilationJob> { static_cast<UnoptimizedCompilationJob*>(job.release()) };
}

void Interpreter::ForEachBytecode(
Expand Down
1 change: 1 addition & 0 deletions deps/v8/tools/gen-postmortem-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
'ExternalString, resource, Object, kResourceOffset',
'SeqOneByteString, chars, char, kHeaderSize',
'SeqTwoByteString, chars, char, kHeaderSize',
'UncompiledData, inferred_name, String, kInferredNameOffset',
'UncompiledData, start_position, int32_t, kStartPositionOffset',
'UncompiledData, end_position, int32_t, kEndPositionOffset',
'SharedFunctionInfo, raw_function_token_offset, int16_t, kFunctionTokenOffsetOffset',
Expand Down

0 comments on commit 8ceed05

Please sign in to comment.