| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5131bbe commit fe99841
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ | |||
| 39 | 39 | ||
| 40 | 40 | # Reset this number to 0 on major V8 upgrades. | |
| 41 | 41 | # Increment by one for each non-official patch applied to deps/v8. | |
| 42 | - 'v8_embedder_string': '-node.15', | ||
| 42 | + 'v8_embedder_string': '-node.16', | ||
| 43 | 43 | ||
| 44 | 44 | ##### V8 defaults for Node.js ##### | |
| 45 | 45 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -605,13 +605,18 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal( | |||
| 605 | 605 | ||
| 606 | 606 | TNode<RawPtrT> code_entry = LoadCodeObjectEntry(code); | |
| 607 | 607 | ||
| 608 | - TNode<Int32T> result = UncheckedCast<Int32T>(CallCFunction( | ||
| 609 | - code_entry, retval_type, std::make_pair(arg0_type, arg0), | ||
| 610 | - std::make_pair(arg1_type, arg1), std::make_pair(arg2_type, arg2), | ||
| 611 | - std::make_pair(arg3_type, arg3), std::make_pair(arg4_type, arg4), | ||
| 612 | - std::make_pair(arg5_type, arg5), std::make_pair(arg6_type, arg6), | ||
| 613 | - std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8), | ||
| 614 | - std::make_pair(arg9_type, arg9))); | ||
| 608 | + // AIX uses function descriptors on CFunction calls. code_entry in this case | ||
| 609 | + // may also point to a Regex interpreter entry trampoline which does not | ||
| 610 | + // have a function descriptor. This method is ineffective on other platforms | ||
| 611 | + // and is equivalent to CallCFunction. | ||
| 612 | + TNode<Int32T> result = | ||
| 613 | + UncheckedCast<Int32T>(CallCFunctionWithoutFunctionDescriptor( | ||
| 614 | + code_entry, retval_type, std::make_pair(arg0_type, arg0), | ||
| 615 | + std::make_pair(arg1_type, arg1), std::make_pair(arg2_type, arg2), | ||
| 616 | + std::make_pair(arg3_type, arg3), std::make_pair(arg4_type, arg4), | ||
| 617 | + std::make_pair(arg5_type, arg5), std::make_pair(arg6_type, arg6), | ||
| 618 | + std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8), | ||
| 619 | + std::make_pair(arg9_type, arg9))); | ||
| 615 | 620 | ||
| 616 | 621 | // Check the result. | |
| 617 | 622 | // We expect exactly one result since we force the called regexp to behave | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1121,20 +1121,6 @@ void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o, | |||
| 1121 | 1121 | } | |
| 1122 | 1122 | #endif | |
| 1123 | 1123 | ||
| 1124 | - // Function descriptor for AIX. | ||
| 1125 | - // Code address skips the function descriptor "header". | ||
| 1126 | - // TOC and static chain are ignored and set to 0. | ||
| 1127 | - void Assembler::function_descriptor() { | ||
| 1128 | - if (ABI_USES_FUNCTION_DESCRIPTORS) { | ||
| 1129 | - Label instructions; | ||
| 1130 | - DCHECK_EQ(pc_offset(), 0); | ||
| 1131 | - emit_label_addr(&instructions); | ||
| 1132 | - dp(0); | ||
| 1133 | - dp(0); | ||
| 1134 | - bind(&instructions); | ||
| 1135 | - } | ||
| 1136 | - } | ||
| 1137 | - | ||
| 1138 | 1124 | int Assembler::instructions_required_for_mov(Register dst, | |
| 1139 | 1125 | const Operand& src) const { | |
| 1140 | 1126 | bool canOptimize = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -840,8 +840,6 @@ class Assembler : public AssemblerBase { | |||
| 840 | 840 | void mtfprwa(DoubleRegister dst, Register src); | |
| 841 | 841 | #endif | |
| 842 | 842 | ||
| 843 | - void function_descriptor(); | ||
| 844 | - | ||
| 845 | 843 | // Exception-generating instructions and debugging support | |
| 846 | 844 | void stop(Condition cond = al, int32_t code = kDefaultStopCode, | |
| 847 | 845 | CRegister cr = cr7); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,12 @@ namespace internal { | |||
| 60 | 60 | // TODO(sigurds): Change this value once we use relative jumps. | |
| 61 | 61 | constexpr size_t kMaxPCRelativeCodeRangeInMB = 0; | |
| 62 | 62 | ||
| 63 | + // Used to encode a boolean value when emitting 32 bit | ||
| 64 | + // opcodes which will indicate the presence of function descriptors | ||
| 65 | + constexpr int kHasFunctionDescriptorBitShift = 9; | ||
| 66 | + constexpr int kHasFunctionDescriptorBitMask = 1 | ||
| 67 | + << kHasFunctionDescriptorBitShift; | ||
| 68 | + | ||
| 63 | 69 | // Number of registers | |
| 64 | 70 | const int kNumRegisters = 32; | |
| 65 | 71 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -209,6 +209,12 @@ void TurboAssembler::Jump(const ExternalReference& reference) { | |||
| 209 | 209 | UseScratchRegisterScope temps(this); | |
| 210 | 210 | Register scratch = temps.Acquire(); | |
| 211 | 211 | Move(scratch, reference); | |
| 212 | + if (ABI_USES_FUNCTION_DESCRIPTORS) { | ||
| 213 | + // AIX uses a function descriptor. When calling C code be | ||
| 214 | + // aware of this descriptor and pick up values from it. | ||
| 215 | + LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(scratch, kPointerSize)); | ||
| 216 | + LoadP(scratch, MemOperand(scratch, 0)); | ||
| 217 | + } | ||
| 212 | 218 | Jump(scratch); | |
| 213 | 219 | } | |
| 214 | 220 | ||
@@ -1930,28 +1936,35 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1, | |||
| 1930 | 1936 | ||
| 1931 | 1937 | void TurboAssembler::CallCFunction(ExternalReference function, | |
| 1932 | 1938 | int num_reg_arguments, | |
| 1933 | - int num_double_arguments) { | ||
| 1939 | + int num_double_arguments, | ||
| 1940 | + bool has_function_descriptor) { | ||
| 1934 | 1941 | Move(ip, function); | |
| 1935 | - CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments); | ||
| 1942 | + CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments, | ||
| 1943 | + has_function_descriptor); | ||
| 1936 | 1944 | } | |
| 1937 | 1945 | ||
| 1938 | 1946 | void TurboAssembler::CallCFunction(Register function, int num_reg_arguments, | |
| 1939 | - int num_double_arguments) { | ||
| 1940 | - CallCFunctionHelper(function, num_reg_arguments, num_double_arguments); | ||
| 1947 | + int num_double_arguments, | ||
| 1948 | + bool has_function_descriptor) { | ||
| 1949 | + CallCFunctionHelper(function, num_reg_arguments, num_double_arguments, | ||
| 1950 | + has_function_descriptor); | ||
| 1941 | 1951 | } | |
| 1942 | 1952 | ||
| 1943 | 1953 | void TurboAssembler::CallCFunction(ExternalReference function, | |
| 1944 | - int num_arguments) { | ||
| 1945 | - CallCFunction(function, num_arguments, 0); | ||
| 1954 | + int num_arguments, | ||
| 1955 | + bool has_function_descriptor) { | ||
| 1956 | + CallCFunction(function, num_arguments, 0, has_function_descriptor); | ||
| 1946 | 1957 | } | |
| 1947 | 1958 | ||
| 1948 | - void TurboAssembler::CallCFunction(Register function, int num_arguments) { | ||
| 1949 | - CallCFunction(function, num_arguments, 0); | ||
| 1959 | + void TurboAssembler::CallCFunction(Register function, int num_arguments, | ||
| 1960 | + bool has_function_descriptor) { | ||
| 1961 | + CallCFunction(function, num_arguments, 0, has_function_descriptor); | ||
| 1950 | 1962 | } | |
| 1951 | 1963 | ||
| 1952 | 1964 | void TurboAssembler::CallCFunctionHelper(Register function, | |
| 1953 | 1965 | int num_reg_arguments, | |
| 1954 | - int num_double_arguments) { | ||
| 1966 | + int num_double_arguments, | ||
| 1967 | + bool has_function_descriptor) { | ||
| 1955 | 1968 | DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters); | |
| 1956 | 1969 | DCHECK(has_frame()); | |
| 1957 | 1970 | ||
@@ -1976,7 +1989,7 @@ void TurboAssembler::CallCFunctionHelper(Register function, | |||
| 1976 | 1989 | // allow preemption, so the return address in the link register | |
| 1977 | 1990 | // stays correct. | |
| 1978 | 1991 | Register dest = function; | |
| 1979 | - if (ABI_USES_FUNCTION_DESCRIPTORS) { | ||
| 1992 | + if (ABI_USES_FUNCTION_DESCRIPTORS && has_function_descriptor) { | ||
| 1980 | 1993 | // AIX/PPC64BE Linux uses a function descriptor. When calling C code be | |
| 1981 | 1994 | // aware of this descriptor and pick up values from it | |
| 1982 | 1995 | LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(function, kPointerSize)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -350,12 +350,16 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { | |||
| 350 | 350 | // garbage collection, since that might move the code and invalidate the | |
| 351 | 351 | // return address (unless this is somehow accounted for by the called | |
| 352 | 352 | // function). | |
| 353 | - void CallCFunction(ExternalReference function, int num_arguments); | ||
| 354 | - void CallCFunction(Register function, int num_arguments); | ||
| 353 | + void CallCFunction(ExternalReference function, int num_arguments, | ||
| 354 | + bool has_function_descriptor = kHasFunctionDescriptor); | ||
| 355 | + void CallCFunction(Register function, int num_arguments, | ||
| 356 | + bool has_function_descriptor = kHasFunctionDescriptor); | ||
| 355 | 357 | void CallCFunction(ExternalReference function, int num_reg_arguments, | |
| 356 | - int num_double_arguments); | ||
| 358 | + int num_double_arguments, | ||
| 359 | + bool has_function_descriptor = kHasFunctionDescriptor); | ||
| 357 | 360 | void CallCFunction(Register function, int num_reg_arguments, | |
| 358 | - int num_double_arguments); | ||
| 361 | + int num_double_arguments, | ||
| 362 | + bool has_function_descriptor = kHasFunctionDescriptor); | ||
| 359 | 363 | ||
| 360 | 364 | // Call a runtime routine. This expects {centry} to contain a fitting CEntry | |
| 361 | 365 | // builtin for the target runtime function and uses an indirect call. | |
@@ -642,7 +646,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { | |||
| 642 | 646 | int CalculateStackPassedWords(int num_reg_arguments, | |
| 643 | 647 | int num_double_arguments); | |
| 644 | 648 | void CallCFunctionHelper(Register function, int num_reg_arguments, | |
| 645 | - int num_double_arguments); | ||
| 649 | + int num_double_arguments, | ||
| 650 | + bool has_function_descriptor); | ||
| 646 | 651 | void CallRecordWriteStub(Register object, Register address, | |
| 647 | 652 | RememberedSetAction remembered_set_action, | |
| 648 | 653 | SaveFPRegsMode fp_mode, Handle<Code> code_target, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -400,6 +400,7 @@ enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | |||
| 400 | 400 | // Enums used by CEntry. | |
| 401 | 401 | enum SaveFPRegsMode { kDontSaveFPRegs, kSaveFPRegs }; | |
| 402 | 402 | enum ArgvMode { kArgvOnStack, kArgvInRegister }; | |
| 403 | + enum FunctionDescriptorMode { kNoFunctionDescriptor, kHasFunctionDescriptor }; | ||
| 403 | 404 | ||
| 404 | 405 | // This constant is used as an undefined value when passing source positions. | |
| 405 | 406 | constexpr int kNoSourcePosition = -1; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2810,10 +2810,17 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { | |||
| 2810 | 2810 | // Select the appropriate opcode based on the call type. | |
| 2811 | 2811 | InstructionCode opcode = kArchNop; | |
| 2812 | 2812 | switch (call_descriptor->kind()) { | |
| 2813 | - case CallDescriptor::kCallAddress: | ||
| 2814 | - opcode = kArchCallCFunction | MiscField::encode(static_cast<int>( | ||
| 2815 | - call_descriptor->ParameterCount())); | ||
| 2813 | + case CallDescriptor::kCallAddress: { | ||
| 2814 | + int misc_field = static_cast<int>(call_descriptor->ParameterCount()); | ||
| 2815 | + #if defined(_AIX) | ||
| 2816 | + // Highest misc_field bit is used on AIX to indicate if a CFunction call | ||
| 2817 | + // has function descriptor or not. | ||
| 2818 | + misc_field |= call_descriptor->HasFunctionDescriptor() | ||
| 2819 | + << kHasFunctionDescriptorBitShift; | ||
| 2820 | + #endif | ||
| 2821 | + opcode = kArchCallCFunction | MiscField::encode(misc_field); | ||
| 2816 | 2822 | break; | |
| 2823 | + } | ||
| 2817 | 2824 | case CallDescriptor::kCallCodeObject: | |
| 2818 | 2825 | opcode = kArchCallCodeObject | MiscField::encode(flags); | |
| 2819 | 2826 | break; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -807,7 +807,8 @@ class V8_EXPORT_PRIVATE Instruction final { | |||
| 807 | 807 | size_t output_count, InstructionOperand* outputs, | |
| 808 | 808 | size_t input_count, InstructionOperand* inputs, | |
| 809 | 809 | size_t temp_count, InstructionOperand* temps) { | |
| 810 | - DCHECK_LE(0, opcode); | ||
| 810 | + // TODO(9872) | ||
| 811 | + // DCHECK_LE(0, opcode); | ||
| 811 | 812 | DCHECK(output_count == 0 || outputs != nullptr); | |
| 812 | 813 | DCHECK(input_count == 0 || inputs != nullptr); | |
| 813 | 814 | DCHECK(temp_count == 0 || temps != nullptr); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments