summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2025-03-12 13:34:10 +0200
committerEfraim Flashner <efraim@flashner.co.il>2025-03-13 14:34:59 +0200
commit169142ee0e6858a35cc66fc790d4fa146e33d900 (patch)
tree51f9a69f5ac5deeac6710fc27e219e098dc9bc51
parent0bc4527a25e97f8a6fa03f1ba0187f53afe432b5 (diff)
fixup node-12 riscv64 support
Change-Id: I4a3c02868374de85a86787321d8df0b9bc9c04e7
-rw-r--r--gnu/packages/patches/node-12-riscv64-support.patch37
1 files changed, 23 insertions, 14 deletions
diff --git a/gnu/packages/patches/node-12-riscv64-support.patch b/gnu/packages/patches/node-12-riscv64-support.patch
index 493ce45f8ca..df53d289fae 100644
--- a/gnu/packages/patches/node-12-riscv64-support.patch
+++ b/gnu/packages/patches/node-12-riscv64-support.patch
@@ -483,10 +483,10 @@ index 8ae89187ecb..aa74f6d4aac 100644
483 } // namespace internal 483 } // namespace internal
484diff --git a/deps/v8/src/builtins/riscv64/builtins-riscv64.cc b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc 484diff --git a/deps/v8/src/builtins/riscv64/builtins-riscv64.cc b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc
485new file mode 100644 485new file mode 100644
486index 00000000000..ebdf1d46ba1 486index 00000000000..7633ef8e7c5
487--- /dev/null 487--- /dev/null
488+++ b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc 488+++ b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc
489@@ -0,0 +1,3320 @@ 489@@ -0,0 +1,3329 @@
490+// Copyright 2021 the V8 project authors. All rights reserved. 490+// Copyright 2021 the V8 project authors. All rights reserved.
491+// Use of this source code is governed by a BSD-style license that can be 491+// Use of this source code is governed by a BSD-style license that can be
492+// found in the LICENSE file. 492+// found in the LICENSE file.
@@ -1910,10 +1910,12 @@ index 00000000000..ebdf1d46ba1
1910+ MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); 1910+ MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
1911+ __ SmiUntag(kInterpreterBytecodeOffsetRegister); 1911+ __ SmiUntag(kInterpreterBytecodeOffsetRegister);
1912+ 1912+
1913+ /*
1913+ Label enter_bytecode, function_entry_bytecode; 1914+ Label enter_bytecode, function_entry_bytecode;
1914+ __ Branch(&function_entry_bytecode, eq, kInterpreterBytecodeOffsetRegister, 1915+ __ Branch(&function_entry_bytecode, eq, kInterpreterBytecodeOffsetRegister,
1915+ Operand(BytecodeArray::kHeaderSize - kHeapObjectTag + 1916+ Operand(BytecodeArray::kHeaderSize - kHeapObjectTag +
1916+ kFunctionEntryBytecodeOffset)); 1917+ kFunctionEntryBytecodeOffset));
1918+ */
1917+ 1919+
1918+ // Load the current bytecode. 1920+ // Load the current bytecode.
1919+ __ Add64(a1, kInterpreterBytecodeArrayRegister, 1921+ __ Add64(a1, kInterpreterBytecodeArrayRegister,
@@ -1926,7 +1928,7 @@ index 00000000000..ebdf1d46ba1
1926+ kInterpreterBytecodeOffsetRegister, a1, a2, a3, 1928+ kInterpreterBytecodeOffsetRegister, a1, a2, a3,
1927+ a4, &if_return); 1929+ a4, &if_return);
1928+ 1930+
1929+ __ bind(&enter_bytecode); 1931+ // __ bind(&enter_bytecode);
1930+ // Convert new bytecode offset to a Smi and save in the stackframe. 1932+ // Convert new bytecode offset to a Smi and save in the stackframe.
1931+ __ SmiTag(a2, kInterpreterBytecodeOffsetRegister); 1933+ __ SmiTag(a2, kInterpreterBytecodeOffsetRegister);
1932+ __ Sd(a2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); 1934+ __ Sd(a2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
@@ -2392,7 +2394,7 @@ index 00000000000..ebdf1d46ba1
2392+ __ JumpIfSmi(a3, &new_target_not_constructor); 2394+ __ JumpIfSmi(a3, &new_target_not_constructor);
2393+ __ Ld(t1, FieldMemOperand(a3, HeapObject::kMapOffset)); 2395+ __ Ld(t1, FieldMemOperand(a3, HeapObject::kMapOffset));
2394+ __ Lbu(t1, FieldMemOperand(t1, Map::kBitFieldOffset)); 2396+ __ Lbu(t1, FieldMemOperand(t1, Map::kBitFieldOffset));
2395+ __ And(t1, t1, Operand(Map::Bits1::IsConstructorBit::kMask)); 2397+ __ And(t1, t1, Operand(Map::IsConstructorBit::kMask));
2396+ __ Branch(&new_target_constructor, ne, t1, Operand(zero_reg)); 2398+ __ Branch(&new_target_constructor, ne, t1, Operand(zero_reg));
2397+ __ bind(&new_target_not_constructor); 2399+ __ bind(&new_target_not_constructor);
2398+ { 2400+ {
@@ -2407,7 +2409,7 @@ index 00000000000..ebdf1d46ba1
2407+ // TODO(victorgomes): Remove this copy when all the arguments adaptor frame 2409+ // TODO(victorgomes): Remove this copy when all the arguments adaptor frame
2408+ // code is erased. 2410+ // code is erased.
2409+ __ Move(a6, fp); 2411+ __ Move(a6, fp);
2410+ __ Ld(a7, MemOperand(fp, StandardFrameConstants::kArgCOffset)); 2412+ __ Ld(a7, MemOperand(fp, ConstructFrameConstants::kContextOffset));
2411+ 2413+
2412+ Label stack_done, stack_overflow; 2414+ Label stack_done, stack_overflow;
2413+ __ Sub32(a7, a7, a2); 2415+ __ Sub32(a7, a7, a2);
@@ -2655,17 +2657,19 @@ index 00000000000..ebdf1d46ba1
2655+ Label non_callable, non_smi; 2657+ Label non_callable, non_smi;
2656+ __ JumpIfSmi(a1, &non_callable); 2658+ __ JumpIfSmi(a1, &non_callable);
2657+ __ bind(&non_smi); 2659+ __ bind(&non_smi);
2658+ __ LoadMap(t1, a1); 2660+ //__ LoadMap(t1, a1);
2659+ __ GetInstanceTypeRange(t1, t2, FIRST_JS_FUNCTION_TYPE, t4); 2661+ //__ GetInstanceTypeRange(t1, t2, FIRST_JS_FUNCTION_TYPE, t4);
2662+ __ GetObjectType(a1, t1, t2)
2660+ __ Jump(masm->isolate()->builtins()->CallFunction(mode), 2663+ __ Jump(masm->isolate()->builtins()->CallFunction(mode),
2661+ RelocInfo::CODE_TARGET, Uless_equal, t4, 2664+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE));
2662+ Operand(LAST_JS_FUNCTION_TYPE - FIRST_JS_FUNCTION_TYPE)); 2665+ //RelocInfo::CODE_TARGET, Uless_equal, t4,
2666+ //Operand(LAST_JS_FUNCTION_TYPE - FIRST_JS_FUNCTION_TYPE));
2663+ __ Jump(BUILTIN_CODE(masm->isolate(), CallBoundFunction), 2667+ __ Jump(BUILTIN_CODE(masm->isolate(), CallBoundFunction),
2664+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_BOUND_FUNCTION_TYPE)); 2668+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_BOUND_FUNCTION_TYPE));
2665+ 2669+
2666+ // Check if target has a [[Call]] internal method. 2670+ // Check if target has a [[Call]] internal method.
2667+ __ Lbu(t1, FieldMemOperand(t1, Map::kBitFieldOffset)); 2671+ __ Lbu(t1, FieldMemOperand(t1, Map::kBitFieldOffset));
2668+ __ And(t1, t1, Operand(Map::Bits1::IsCallableBit::kMask)); 2672+ __ And(t1, t1, Operand(Map::IsCallableBit::kMask));
2669+ __ Branch(&non_callable, eq, t1, Operand(zero_reg)); 2673+ __ Branch(&non_callable, eq, t1, Operand(zero_reg));
2670+ 2674+
2671+ __ Jump(BUILTIN_CODE(masm->isolate(), CallProxy), RelocInfo::CODE_TARGET, eq, 2675+ __ Jump(BUILTIN_CODE(masm->isolate(), CallProxy), RelocInfo::CODE_TARGET, eq,
@@ -2810,14 +2814,17 @@ index 00000000000..ebdf1d46ba1
2810+ // Check if target has a [[Construct]] internal method. 2814+ // Check if target has a [[Construct]] internal method.
2811+ __ Ld(t1, FieldMemOperand(a1, HeapObject::kMapOffset)); 2815+ __ Ld(t1, FieldMemOperand(a1, HeapObject::kMapOffset));
2812+ __ Lbu(t4, FieldMemOperand(t1, Map::kBitFieldOffset)); 2816+ __ Lbu(t4, FieldMemOperand(t1, Map::kBitFieldOffset));
2813+ __ And(t4, t4, Operand(Map::Bits1::IsConstructorBit::kMask)); 2817+ __ And(t4, t4, Operand(Map::IsConstructorBit::kMask));
2814+ __ Branch(&non_constructor, eq, t4, Operand(zero_reg)); 2818+ __ Branch(&non_constructor, eq, t4, Operand(zero_reg));
2815+ 2819+
2816+ // Dispatch based on instance type. 2820+ // Dispatch based on instance type.
2817+ __ GetInstanceTypeRange(t1, t2, FIRST_JS_FUNCTION_TYPE, t0); 2821+ __ Lhu(t2, FieldMemOperand(t1, Map::kInstanceTypeOffset));
2822+ // __ GetInstanceTypeRange(t1, t2, FIRST_JS_FUNCTION_TYPE, t0);
2818+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructFunction), 2823+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructFunction),
2819+ RelocInfo::CODE_TARGET, Uless_equal, t0, 2824+ //RelocInfo::CODE_TARGET, eq);
2820+ Operand(LAST_JS_FUNCTION_TYPE - FIRST_JS_FUNCTION_TYPE)); 2825+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE));
2826+ //RelocInfo::CODE_TARGET, Uless_equal, t0,
2827+ //Operand(LAST_JS_FUNCTION_TYPE - FIRST_JS_FUNCTION_TYPE));
2821+ 2828+
2822+ // Only dispatch to bound functions after checking whether they are 2829+ // Only dispatch to bound functions after checking whether they are
2823+ // constructors. 2830+ // constructors.
@@ -2899,6 +2906,7 @@ index 00000000000..ebdf1d46ba1
2899+ __ Jump(s1); 2906+ __ Jump(s1);
2900+} 2907+}
2901+ 2908+
2909+/*
2902+void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) { 2910+void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
2903+ HardAbortScope hard_abort(masm); // Avoid calls to Abort. 2911+ HardAbortScope hard_abort(masm); // Avoid calls to Abort.
2904+ { 2912+ {
@@ -2920,6 +2928,7 @@ index 00000000000..ebdf1d46ba1
2920+ } 2928+ }
2921+ __ Ret(); 2929+ __ Ret();
2922+} 2930+}
2931+*/
2923+ 2932+
2924+void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, 2933+void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
2925+ SaveFPRegsMode save_doubles, ArgvMode argv_mode, 2934+ SaveFPRegsMode save_doubles, ArgvMode argv_mode,