|
| 1 | +From dda5cdb15cfe5c7437f471054f5bd79a82b6eda2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: kxxt <rsworktech@outlook.com> |
| 3 | +Date: Wed, 17 Jan 2024 09:16:34 +0800 |
| 4 | +Subject: [PATCH] Revert "deps: V8: cherry-pick 13192d6e10fa" |
| 5 | + |
| 6 | +This reverts commit bc2ebb972b34f54e042de9636e7451d2526436a9, which |
| 7 | +shouldn't be applied to v20.x. |
| 8 | + |
| 9 | +Fix https://github.com/nodejs/unofficial-builds/issues/106 |
| 10 | +--- |
| 11 | + common.gypi | 2 +- |
| 12 | + deps/v8/src/builtins/riscv/builtins-riscv.cc | 2 +- |
| 13 | + deps/v8/src/codegen/riscv/assembler-riscv-inl.h | 16 ++++++++-------- |
| 14 | + deps/v8/src/codegen/riscv/assembler-riscv.h | 2 +- |
| 15 | + deps/v8/src/execution/riscv/simulator-riscv.cc | 8 ++++---- |
| 16 | + .../regexp/riscv/regexp-macro-assembler-riscv.cc | 2 +- |
| 17 | + 6 files changed, 16 insertions(+), 16 deletions(-) |
| 18 | + |
| 19 | +diff --git a/common.gypi b/common.gypi |
| 20 | +index db09a8a33df06..fa0729ffe45e8 100644 |
| 21 | +--- a/common.gypi |
| 22 | ++++ b/common.gypi |
| 23 | +@@ -36,7 +36,7 @@ |
| 24 | + |
| 25 | + # Reset this number to 0 on major V8 upgrades. |
| 26 | + # Increment by one for each non-official patch applied to deps/v8. |
| 27 | +- 'v8_embedder_string': '-node.17', |
| 28 | ++ 'v8_embedder_string': '-node.18', |
| 29 | + |
| 30 | + ##### V8 defaults for Node.js ##### |
| 31 | + |
| 32 | +diff --git a/deps/v8/src/builtins/riscv/builtins-riscv.cc b/deps/v8/src/builtins/riscv/builtins-riscv.cc |
| 33 | +index d6091434b9b0a..3404562785991 100644 |
| 34 | +--- a/deps/v8/src/builtins/riscv/builtins-riscv.cc |
| 35 | ++++ b/deps/v8/src/builtins/riscv/builtins-riscv.cc |
| 36 | +@@ -1512,7 +1512,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
| 37 | + // Set the return address to the correct point in the interpreter entry |
| 38 | + // trampoline. |
| 39 | + Label builtin_trampoline, trampoline_loaded; |
| 40 | +- Tagged<Smi> interpreter_entry_return_pc_offset( |
| 41 | ++ Smi interpreter_entry_return_pc_offset( |
| 42 | + masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 43 | + DCHECK_NE(interpreter_entry_return_pc_offset, Smi::zero()); |
| 44 | + |
| 45 | +diff --git a/deps/v8/src/codegen/riscv/assembler-riscv-inl.h b/deps/v8/src/codegen/riscv/assembler-riscv-inl.h |
| 46 | +index ca6d641e2c94e..55f191e6afe76 100644 |
| 47 | +--- a/deps/v8/src/codegen/riscv/assembler-riscv-inl.h |
| 48 | ++++ b/deps/v8/src/codegen/riscv/assembler-riscv-inl.h |
| 49 | +@@ -128,9 +128,9 @@ Handle<HeapObject> Assembler::compressed_embedded_object_handle_at( |
| 50 | + } |
| 51 | + |
| 52 | + void Assembler::deserialization_set_special_target_at( |
| 53 | +- Address instruction_payload, Tagged<Code> code, Address target) { |
| 54 | ++ Address instruction_payload, Code code, Address target) { |
| 55 | + set_target_address_at(instruction_payload, |
| 56 | +- !code.is_null() ? code->constant_pool() : kNullAddress, |
| 57 | ++ !code.is_null() ? code.constant_pool() : kNullAddress, |
| 58 | + target); |
| 59 | + } |
| 60 | + |
| 61 | +@@ -159,13 +159,12 @@ void Assembler::deserialization_set_target_internal_reference_at( |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | +-Tagged<HeapObject> RelocInfo::target_object(PtrComprCageBase cage_base) { |
| 66 | ++HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) { |
| 67 | + DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_)); |
| 68 | + if (IsCompressedEmbeddedObject(rmode_)) { |
| 69 | +- return HeapObject::cast( |
| 70 | +- Tagged<Object>(V8HeapCompressionScheme::DecompressTagged( |
| 71 | +- cage_base, |
| 72 | +- Assembler::target_compressed_address_at(pc_, constant_pool_)))); |
| 73 | ++ return HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTagged( |
| 74 | ++ cage_base, |
| 75 | ++ Assembler::target_compressed_address_at(pc_, constant_pool_)))); |
| 76 | + } else { |
| 77 | + return HeapObject::cast( |
| 78 | + Object(Assembler::target_address_at(pc_, constant_pool_))); |
| 79 | +@@ -187,7 +186,8 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { |
| 80 | + } |
| 81 | + } |
| 82 | + |
| 83 | +-void RelocInfo::set_target_object(Tagged<HeapObject> target, |
| 84 | ++void RelocInfo::set_target_object(Heap* heap, HeapObject target, |
| 85 | ++ WriteBarrierMode write_barrier_mode, |
| 86 | + ICacheFlushMode icache_flush_mode) { |
| 87 | + DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_)); |
| 88 | + if (IsCompressedEmbeddedObject(rmode_)) { |
| 89 | +diff --git a/deps/v8/src/codegen/riscv/assembler-riscv.h b/deps/v8/src/codegen/riscv/assembler-riscv.h |
| 90 | +index bcd5a62d324ee..ed222b52d6927 100644 |
| 91 | +--- a/deps/v8/src/codegen/riscv/assembler-riscv.h |
| 92 | ++++ b/deps/v8/src/codegen/riscv/assembler-riscv.h |
| 93 | +@@ -286,7 +286,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase, |
| 94 | + // This is for calls and branches within generated code. The serializer |
| 95 | + // has already deserialized the lui/ori instructions etc. |
| 96 | + inline static void deserialization_set_special_target_at(Address location, |
| 97 | +- Tagged<Code> code, |
| 98 | ++ Code code, |
| 99 | + Address target); |
| 100 | + |
| 101 | + // Get the size of the special target encoded at 'instruction_payload'. |
| 102 | +diff --git a/deps/v8/src/execution/riscv/simulator-riscv.cc b/deps/v8/src/execution/riscv/simulator-riscv.cc |
| 103 | +index 052a2d67dd7e4..9582db489638a 100644 |
| 104 | +--- a/deps/v8/src/execution/riscv/simulator-riscv.cc |
| 105 | ++++ b/deps/v8/src/execution/riscv/simulator-riscv.cc |
| 106 | +@@ -1781,7 +1781,7 @@ void RiscvDebugger::Debug() { |
| 107 | + sreg_t value; |
| 108 | + StdoutStream os; |
| 109 | + if (GetValue(arg1, &value)) { |
| 110 | +- Tagged<Object> obj(value); |
| 111 | ++ Object obj(value); |
| 112 | + os << arg1 << ": \n"; |
| 113 | + #ifdef DEBUG |
| 114 | + obj.Print(os); |
| 115 | +@@ -1830,7 +1830,7 @@ void RiscvDebugger::Debug() { |
| 116 | + PrintF(" 0x%012" PRIxPTR " : 0x%016" REGIx_FORMAT |
| 117 | + " %14" REGId_FORMAT " ", |
| 118 | + reinterpret_cast<intptr_t>(cur), *cur, *cur); |
| 119 | +- Tagged<Object> obj(*cur); |
| 120 | ++ Object obj(*cur); |
| 121 | + Heap* current_heap = sim_->isolate_->heap(); |
| 122 | + if (obj.IsSmi() || |
| 123 | + IsValidHeapObject(current_heap, HeapObject::cast(obj))) { |
| 124 | +@@ -4692,7 +4692,7 @@ bool Simulator::DecodeRvvVS() { |
| 125 | + Builtin Simulator::LookUp(Address pc) { |
| 126 | + for (Builtin builtin = Builtins::kFirst; builtin <= Builtins::kLast; |
| 127 | + ++builtin) { |
| 128 | +- if (builtins_.code(builtin)->contains(isolate_, pc)) return builtin; |
| 129 | ++ if (builtins_.code(builtin).contains(isolate_, pc)) return builtin; |
| 130 | + } |
| 131 | + return Builtin::kNoBuiltinId; |
| 132 | + } |
| 133 | +@@ -4709,7 +4709,7 @@ void Simulator::DecodeRVIType() { |
| 134 | + if (builtin != Builtin::kNoBuiltinId) { |
| 135 | + auto code = builtins_.code(builtin); |
| 136 | + if ((rs1_reg() != ra || imm12() != 0)) { |
| 137 | +- if ((Address)get_pc() == code->instruction_start()) { |
| 138 | ++ if ((Address)get_pc() == code.InstructionStart()) { |
| 139 | + sreg_t arg0 = get_register(a0); |
| 140 | + sreg_t arg1 = get_register(a1); |
| 141 | + sreg_t arg2 = get_register(a2); |
| 142 | +diff --git a/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc b/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc |
| 143 | +index 72f89767eb348..4063b4b3d2194 100644 |
| 144 | +--- a/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc |
| 145 | ++++ b/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc |
| 146 | +@@ -1211,7 +1211,7 @@ static T* frame_entry_address(Address re_frame, int frame_offset) { |
| 147 | + int64_t RegExpMacroAssemblerRISCV::CheckStackGuardState(Address* return_address, |
| 148 | + Address raw_code, |
| 149 | + Address re_frame) { |
| 150 | +- Tagged<InstructionStream> re_code = InstructionStream::cast(Object(raw_code)); |
| 151 | ++ InstructionStream re_code = InstructionStream::cast(Object(raw_code)); |
| 152 | + return NativeRegExpMacroAssembler::CheckStackGuardState( |
| 153 | + frame_entry<Isolate*>(re_frame, kIsolateOffset), |
| 154 | + static_cast<int>(frame_entry<int64_t>(re_frame, kStartIndexOffset)), |
0 commit comments