diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc index e61933b05a..dfb8ba2bf2 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc @@ -14440,6 +14440,19 @@ TNode CodeStubAssembler::GetSharedFunctionInfoCode( return sfi_code.value(); } +TNode CodeStubAssembler::GetCodeEntry(TNode code) { +#ifdef V8_EXTERNAL_CODE_SPACE + TNode cdc = CodeDataContainerFromCodeT(code); + return LoadExternalPointerFromObject( + cdc, IntPtrConstant(CodeDataContainer::kCodeEntryPointOffset), + kCodeEntryPointTag); +#else + TNode object = BitcastTaggedToWord(code); + return ReinterpretCast( + IntPtrAdd(object, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag))); +#endif +} + TNode CodeStubAssembler::AllocateFunctionWithMapAndContext( TNode map, TNode shared_info, TNode context) { diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h index 1cb0b4cf6e..b5d32791db 100644 --- a/src/codegen/code-stub-assembler.h +++ b/src/codegen/code-stub-assembler.h @@ -837,6 +837,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler #endif } + TNode GetCodeEntry(TNode code); + // The following Call wrappers call an object according to the semantics that // one finds in the EcmaScript spec, operating on an Callable (e.g. a // JSFunction or proxy) rather than a Code object.