diff options
-rw-r--r-- | gnu/packages/patches/node-12-riscv64-support.patch | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/gnu/packages/patches/node-12-riscv64-support.patch b/gnu/packages/patches/node-12-riscv64-support.patch index 1229fa9f39..167275286b 100644 --- a/gnu/packages/patches/node-12-riscv64-support.patch +++ b/gnu/packages/patches/node-12-riscv64-support.patch @@ -482,10 +482,10 @@ index 8ae89187ecb..aa74f6d4aac 100644 } // namespace internal diff --git a/deps/v8/src/builtins/riscv64/builtins-riscv64.cc b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc new file mode 100644 -index 00000000000..5b777640fd0 +index 00000000000..e389b211000 --- /dev/null +++ b/deps/v8/src/builtins/riscv64/builtins-riscv64.cc -@@ -0,0 +1,3386 @@ +@@ -0,0 +1,3332 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. @@ -2853,60 +2853,6 @@ index 00000000000..5b777640fd0 + RelocInfo::CODE_TARGET); +} + -+// YOLO copy from mips -+// static -+void Builtins::Generate_Construct(MacroAssembler* masm) { -+ // ----------- S t a t e ------------- -+ // -- a0 : the number of arguments (not including the receiver) -+ // -- a1 : the constructor to call (can be any Object) -+ // -- a3 : the new target (either the same as the constructor or -+ // the JSFunction on which new was invoked initially) -+ // ----------------------------------- -+ -+ // Check if target is a Smi. -+ Label non_constructor, non_proxy; -+ __ JumpIfSmi(a1, &non_constructor); -+ -+ // Check if target has a [[Construct]] internal method. -+ __ lw(t1, FieldMemOperand(a1, HeapObject::kMapOffset)); -+ __ lbu(t3, FieldMemOperand(t1, Map::kBitFieldOffset)); -+ __ And(t3, t3, Operand(Map::IsConstructorBit::kMask)); -+ __ Branch(&non_constructor, eq, t3, Operand(zero_reg)); -+ -+ // Dispatch based on instance type. -+ __ lhu(t2, FieldMemOperand(t1, Map::kInstanceTypeOffset)); -+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructFunction), -+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_FUNCTION_TYPE)); -+ -+ // Only dispatch to bound functions after checking whether they are -+ // constructors. -+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructBoundFunction), -+ RelocInfo::CODE_TARGET, eq, t2, Operand(JS_BOUND_FUNCTION_TYPE)); -+ -+ // Only dispatch to proxies after checking whether they are constructors. -+ __ Branch(&non_proxy, ne, t2, Operand(JS_PROXY_TYPE)); -+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructProxy), -+ RelocInfo::CODE_TARGET); -+ -+ // Called Construct on an exotic Object with a [[Construct]] internal method. -+ __ bind(&non_proxy); -+ { -+ // Overwrite the original receiver with the (original) target. -+ __ Lsa(kScratchReg, sp, a0, kPointerSizeLog2); -+ __ sw(a1, MemOperand(kScratchReg)); -+ // Let the "call_as_constructor_delegate" take care of the rest. -+ __ LoadNativeContextSlot(Context::CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, a1); -+ __ Jump(masm->isolate()->builtins()->CallFunction(), -+ RelocInfo::CODE_TARGET); -+ } -+ -+ // Called Construct on an Object that doesn't have a [[Construct]] internal -+ // method. -+ __ bind(&non_constructor); -+ __ Jump(BUILTIN_CODE(masm->isolate(), ConstructedNonConstructable), -+ RelocInfo::CODE_TARGET); -+} -+ +void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { + // The function index was put in t0 by the jump table trampoline. + // Convert to Smi for the runtime call |