Commit b1de7837 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[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/+/3205893Reviewed-by: 's avatarIgor 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}
parent b1b5cdda
......@@ -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) {
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment