Changeset 268077 in webkit for trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp
- Timestamp:
- Oct 6, 2020, 3:04:36 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp
r267820 r268077 48 48 // and others LLIntEntrypoints. 49 49 50 static MacroAssemblerCodeRef<JITThunkPtrTag> generateThunkWithJumpTo(OpcodeID opcodeID, const char *thunkKind) 50 template<PtrTag tag> 51 static MacroAssemblerCodeRef<tag> generateThunkWithJumpTo(LLIntCode target, const char *thunkKind) 51 52 { 52 53 JSInterfaceJIT jit; 53 54 54 // FIXME: there's probably a better way to do it on X86, but I'm not sure I care.55 LLIntCode target = LLInt::getCodeFunctionPtr<JSEntryPtrTag>(opcodeID);56 55 assertIsTaggedWith(target, JSEntryPtrTag); 57 56 … … 65 64 66 65 LinkBuffer patchBuffer(jit, GLOBAL_THUNK_ID); 67 return FINALIZE_CODE(patchBuffer, JITThunkPtrTag, "LLInt %s prologue thunk", thunkKind); 68 } 69 70 MacroAssemblerCodeRef<JITThunkPtrTag> functionForCallEntryThunk() 71 { 72 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 73 static std::once_flag onceKey; 74 std::call_once(onceKey, [&] { 75 codeRef.construct(generateThunkWithJumpTo(llint_function_for_call_prologue, "function for call")); 76 }); 77 return codeRef; 78 } 79 80 MacroAssemblerCodeRef<JITThunkPtrTag> functionForConstructEntryThunk() 81 { 82 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 83 static std::once_flag onceKey; 84 std::call_once(onceKey, [&] { 85 codeRef.construct(generateThunkWithJumpTo(llint_function_for_construct_prologue, "function for construct")); 86 }); 87 return codeRef; 88 } 89 90 MacroAssemblerCodeRef<JITThunkPtrTag> functionForCallArityCheckThunk() 91 { 92 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 93 static std::once_flag onceKey; 94 std::call_once(onceKey, [&] { 95 codeRef.construct(generateThunkWithJumpTo(llint_function_for_call_arity_check, "function for call with arity check")); 96 }); 97 return codeRef; 98 } 99 100 MacroAssemblerCodeRef<JITThunkPtrTag> functionForConstructArityCheckThunk() 101 { 102 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 103 static std::once_flag onceKey; 104 std::call_once(onceKey, [&] { 105 codeRef.construct(generateThunkWithJumpTo(llint_function_for_construct_arity_check, "function for construct with arity check")); 106 }); 107 return codeRef; 108 } 109 110 MacroAssemblerCodeRef<JITThunkPtrTag> evalEntryThunk() 111 { 112 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 113 static std::once_flag onceKey; 114 std::call_once(onceKey, [&] { 115 codeRef.construct(generateThunkWithJumpTo(llint_eval_prologue, "eval")); 116 }); 117 return codeRef; 118 } 119 120 MacroAssemblerCodeRef<JITThunkPtrTag> programEntryThunk() 121 { 122 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 123 static std::once_flag onceKey; 124 std::call_once(onceKey, [&] { 125 codeRef.construct(generateThunkWithJumpTo(llint_program_prologue, "program")); 126 }); 127 return codeRef; 128 } 129 130 MacroAssemblerCodeRef<JITThunkPtrTag> moduleProgramEntryThunk() 131 { 132 static LazyNeverDestroyed<MacroAssemblerCodeRef<JITThunkPtrTag>> codeRef; 133 static std::once_flag onceKey; 134 std::call_once(onceKey, [&] { 135 codeRef.construct(generateThunkWithJumpTo(llint_module_program_prologue, "module_program")); 66 return FINALIZE_CODE(patchBuffer, tag, "LLInt %s prologue thunk", thunkKind); 67 } 68 69 template<PtrTag tag> 70 static MacroAssemblerCodeRef<tag> generateThunkWithJumpTo(OpcodeID opcodeID, const char *thunkKind) 71 { 72 return generateThunkWithJumpTo<tag>(LLInt::getCodeFunctionPtr<JSEntryPtrTag>(opcodeID), thunkKind); 73 } 74 75 MacroAssemblerCodeRef<JSEntryPtrTag> functionForCallEntryThunk() 76 { 77 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 78 static std::once_flag onceKey; 79 std::call_once(onceKey, [&] { 80 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_function_for_call_prologue, "function for call")); 81 }); 82 return codeRef; 83 } 84 85 MacroAssemblerCodeRef<JSEntryPtrTag> functionForConstructEntryThunk() 86 { 87 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 88 static std::once_flag onceKey; 89 std::call_once(onceKey, [&] { 90 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_function_for_construct_prologue, "function for construct")); 91 }); 92 return codeRef; 93 } 94 95 MacroAssemblerCodeRef<JSEntryPtrTag> functionForCallArityCheckThunk() 96 { 97 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 98 static std::once_flag onceKey; 99 std::call_once(onceKey, [&] { 100 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_function_for_call_arity_check, "function for call with arity check")); 101 }); 102 return codeRef; 103 } 104 105 MacroAssemblerCodeRef<JSEntryPtrTag> functionForConstructArityCheckThunk() 106 { 107 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 108 static std::once_flag onceKey; 109 std::call_once(onceKey, [&] { 110 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_function_for_construct_arity_check, "function for construct with arity check")); 111 }); 112 return codeRef; 113 } 114 115 MacroAssemblerCodeRef<JSEntryPtrTag> evalEntryThunk() 116 { 117 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 118 static std::once_flag onceKey; 119 std::call_once(onceKey, [&] { 120 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_eval_prologue, "eval")); 121 }); 122 return codeRef; 123 } 124 125 MacroAssemblerCodeRef<JSEntryPtrTag> programEntryThunk() 126 { 127 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 128 static std::once_flag onceKey; 129 std::call_once(onceKey, [&] { 130 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_program_prologue, "program")); 131 }); 132 return codeRef; 133 } 134 135 MacroAssemblerCodeRef<JSEntryPtrTag> moduleProgramEntryThunk() 136 { 137 static LazyNeverDestroyed<MacroAssemblerCodeRef<JSEntryPtrTag>> codeRef; 138 static std::once_flag onceKey; 139 std::call_once(onceKey, [&] { 140 codeRef.construct(generateThunkWithJumpTo<JSEntryPtrTag>(llint_module_program_prologue, "module_program")); 136 141 }); 137 142 return codeRef; … … 145 150 std::call_once(onceKey, [&] { 146 151 if (Wasm::Context::useFastTLS()) 147 codeRef.construct(generateThunkWithJumpTo (wasm_function_prologue, "function for call"));152 codeRef.construct(generateThunkWithJumpTo<JITThunkPtrTag>(wasm_function_prologue, "function for call")); 148 153 else 149 codeRef.construct(generateThunkWithJumpTo (wasm_function_prologue_no_tls, "function for call"));154 codeRef.construct(generateThunkWithJumpTo<JITThunkPtrTag>(wasm_function_prologue_no_tls, "function for call")); 150 155 }); 151 156 return codeRef; … … 186 191 } 187 192 193 MacroAssemblerCodeRef<ExceptionHandlerPtrTag> callToThrowThunk() 194 { 195 static LazyNeverDestroyed<MacroAssemblerCodeRef<ExceptionHandlerPtrTag>> codeRef; 196 static std::once_flag onceKey; 197 std::call_once(onceKey, [&] { 198 codeRef.construct(generateThunkWithJumpTo<ExceptionHandlerPtrTag>(llint_throw_during_call_trampoline, "LLInt::callToThrow thunk")); 199 }); 200 return codeRef; 201 } 202 203 MacroAssemblerCodeRef<ExceptionHandlerPtrTag> handleUncaughtExceptionThunk() 204 { 205 static LazyNeverDestroyed<MacroAssemblerCodeRef<ExceptionHandlerPtrTag>> codeRef; 206 static std::once_flag onceKey; 207 std::call_once(onceKey, [&] { 208 codeRef.construct(generateThunkWithJumpTo<ExceptionHandlerPtrTag>(llint_handle_uncaught_exception, "handle_uncaught_exception")); 209 }); 210 return codeRef; 211 } 212 213 MacroAssemblerCodeRef<ExceptionHandlerPtrTag> handleCatchThunk(OpcodeSize size) 214 { 215 switch (size) { 216 case OpcodeSize::Narrow: { 217 static LazyNeverDestroyed<MacroAssemblerCodeRef<ExceptionHandlerPtrTag>> codeRef; 218 static std::once_flag onceKey; 219 std::call_once(onceKey, [&] { 220 codeRef.construct(generateThunkWithJumpTo<ExceptionHandlerPtrTag>(LLInt::getCodeFunctionPtr<JSEntryPtrTag>(op_catch), "op_catch")); 221 }); 222 return codeRef; 223 } 224 case OpcodeSize::Wide16: { 225 static LazyNeverDestroyed<MacroAssemblerCodeRef<ExceptionHandlerPtrTag>> codeRef; 226 static std::once_flag onceKey; 227 std::call_once(onceKey, [&] { 228 codeRef.construct(generateThunkWithJumpTo<ExceptionHandlerPtrTag>(LLInt::getWide16CodeFunctionPtr<JSEntryPtrTag>(op_catch), "op_catch16")); 229 }); 230 return codeRef; 231 } 232 case OpcodeSize::Wide32: { 233 static LazyNeverDestroyed<MacroAssemblerCodeRef<ExceptionHandlerPtrTag>> codeRef; 234 static std::once_flag onceKey; 235 std::call_once(onceKey, [&] { 236 codeRef.construct(generateThunkWithJumpTo<ExceptionHandlerPtrTag>(LLInt::getWide32CodeFunctionPtr<JSEntryPtrTag>(op_catch), "op_catch32")); 237 }); 238 return codeRef; 239 } 240 } 241 RELEASE_ASSERT_NOT_REACHED(); 242 return { }; 243 } 244 188 245 } // namespace LLInt 189 246
Note:
See TracChangeset
for help on using the changeset viewer.