[csa] Add GetCodeEntry function

Mirroring Code::entry and CodeDataContainer::code_entry_point.
Unused for now; will be used very soon.

Change-Id: I93b86f0c601a044bb4e6afea642d5d3f721ef73a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3205893
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77249}
This commit is contained in:
Jakob Kummerow 2021-10-06 01:10:51 +02:00 committed by V8 LUCI CQ
parent b1b5cddab9
commit b1de783724
2 changed files with 15 additions and 0 deletions

View File

@ -14440,6 +14440,19 @@ TNode<Code> CodeStubAssembler::GetSharedFunctionInfoCode(
return sfi_code.value();
}
TNode<RawPtrT> CodeStubAssembler::GetCodeEntry(TNode<CodeT> code) {
#ifdef V8_EXTERNAL_CODE_SPACE
TNode<CodeDataContainer> cdc = CodeDataContainerFromCodeT(code);
return LoadExternalPointerFromObject(
cdc, IntPtrConstant(CodeDataContainer::kCodeEntryPointOffset),
kCodeEntryPointTag);
#else
TNode<IntPtrT> object = BitcastTaggedToWord(code);
return ReinterpretCast<RawPtrT>(
IntPtrAdd(object, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag)));
#endif
}
TNode<JSFunction> CodeStubAssembler::AllocateFunctionWithMapAndContext(
TNode<Map> map, TNode<SharedFunctionInfo> shared_info,
TNode<Context> context) {

View File

@ -837,6 +837,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
#endif
}
TNode<RawPtrT> GetCodeEntry(TNode<CodeT> 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.