#if V8_TARGET_ARCH_X64
#include "src/api/api-arguments.h"
#include "src/base/bits-iterator.h"
#include "src/base/iterator.h"
#include "src/builtins/builtins-descriptors.h"
#include "src/builtins/builtins-inl.h"
#include "src/codegen/code-factory.h"
#include "src/codegen/interface-descriptors-inl.h"
#include "src/codegen/macro-assembler-inl.h"
#include "src/codegen/register-configuration.h"
#include "src/codegen/x64/assembler-x64.h"
#include "src/common/globals.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/execution/frame-constants.h"
#include "src/execution/frames.h"
#include "src/heap/heap-inl.h"
#include "src/logging/counters.h"
#include "src/objects/cell.h"
#include "src/objects/code.h"
#include "src/objects/debug-objects.h"
#include "src/objects/foreign.h"
#include "src/objects/heap-number.h"
#include "src/objects/js-generator.h"
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/baseline/liftoff-assembler-defs.h"
#include "src/wasm/object-access.h"
#include "src/wasm/stacks.h"
#include "src/wasm/wasm-constants.h"
#include "src/wasm/wasm-linkage.h"
#include "src/wasm/wasm-objects.h"
#endif
namespace v8 {
namespace internal {
#define __ …
void Builtins::Generate_Adaptor(MacroAssembler* masm, Address address) { … }
namespace {
constexpr int kReceiverOnStackSize = …;
enum class ArgumentsElementType { … };
void Generate_PushArguments(MacroAssembler* masm, Register array, Register argc,
Register scratch,
ArgumentsElementType element_type) { … }
void Generate_JSBuiltinsConstructStubHelper(MacroAssembler* masm) { … }
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { … }
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { … }
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { … }
namespace {
void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Builtin entry_trampoline) { … }
}
void Builtins::Generate_JSEntry(MacroAssembler* masm) { … }
void Builtins::Generate_JSConstructEntry(MacroAssembler* masm) { … }
void Builtins::Generate_JSRunMicrotasksEntry(MacroAssembler* masm) { … }
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) { … }
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { … }
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { … }
void Builtins::Generate_RunMicrotasksTrampoline(MacroAssembler* masm) { … }
static void AssertCodeIsBaselineAllowClobber(MacroAssembler* masm,
Register code, Register scratch) { … }
static void AssertCodeIsBaseline(MacroAssembler* masm, Register code,
Register scratch) { … }
static void CheckSharedFunctionInfoBytecodeOrBaseline(MacroAssembler* masm,
Register data,
Register scratch,
Label* is_baseline,
Label* is_bytecode) { … }
static void GetSharedFunctionInfoBytecodeOrBaseline(
MacroAssembler* masm, Register sfi, Register bytecode, Register scratch1,
Label* is_baseline, Label* is_unavailable) { … }
void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { … }
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1,
Register scratch2) { … }
static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Register bytecode_array,
Register bytecode_offset,
Register bytecode, Register scratch1,
Register scratch2, Label* if_return) { … }
namespace {
void ResetSharedFunctionInfoAge(MacroAssembler* masm, Register sfi) { … }
void ResetJSFunctionAge(MacroAssembler* masm, Register js_function) { … }
void ResetFeedbackVectorOsrUrgency(MacroAssembler* masm,
Register feedback_vector, Register scratch) { … }
}
void Builtins::Generate_InterpreterEntryTrampoline(
MacroAssembler* masm, InterpreterEntryTrampolineMode mode) { … }
static void GenerateInterpreterPushArgs(MacroAssembler* masm, Register num_args,
Register start_address,
Register scratch) { … }
void Builtins::Generate_InterpreterPushArgsThenCallImpl(
MacroAssembler* masm, ConvertReceiverMode receiver_mode,
InterpreterPushArgsMode mode) { … }
void Builtins::Generate_InterpreterPushArgsThenConstructImpl(
MacroAssembler* masm, InterpreterPushArgsMode mode) { … }
void Builtins::Generate_ConstructForwardAllArgsImpl(
MacroAssembler* masm, ForwardWhichFrame which_frame) { … }
namespace {
void NewImplicitReceiver(MacroAssembler* masm) { … }
}
void Builtins::Generate_InterpreterPushArgsThenFastConstructFunction(
MacroAssembler* masm) { … }
static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { … }
void Builtins::Generate_InterpreterEnterAtNextBytecode(MacroAssembler* masm) { … }
void Builtins::Generate_InterpreterEnterAtBytecode(MacroAssembler* masm) { … }
void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { … }
void Builtins::Generate_BaselineOutOfLinePrologueDeopt(MacroAssembler* masm) { … }
namespace {
void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
bool java_script_builtin,
bool with_result) { … }
}
void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) { … }
void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
MacroAssembler* masm) { … }
void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) { … }
void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
MacroAssembler* masm) { … }
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { … }
void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { … }
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) { … }
void Builtins::Generate_ReflectApply(MacroAssembler* masm) { … }
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { … }
namespace {
void Generate_AllocateSpaceAndShiftExistingArguments(
MacroAssembler* masm, Register count, Register argc_in_out,
Register pointer_to_new_space_out, Register scratch1, Register scratch2) { … }
}
void Builtins::Generate_CallOrConstructVarargs(MacroAssembler* masm,
Builtin target_builtin) { … }
void Builtins::Generate_CallOrConstructForwardVarargs(MacroAssembler* masm,
CallOrConstructMode mode,
Builtin target_builtin) { … }
void Builtins::Generate_CallFunction(MacroAssembler* masm,
ConvertReceiverMode mode) { … }
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) { … }
}
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm) { … }
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode) { … }
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) { … }
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) { … }
void Builtins::Generate_Construct(MacroAssembler* masm) { … }
namespace {
void Generate_OSREntry(MacroAssembler* masm, Register entry_address) { … }
enum class OsrSourceTier { … };
void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source,
Register maybe_target_code) { … }
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { … }
void Builtins::Generate_BaselineOnStackReplacement(MacroAssembler* masm) { … }
void Builtins::Generate_MaglevOnStackReplacement(MacroAssembler* masm) { … }
#ifdef V8_ENABLE_MAGLEV
void Builtins::Generate_MaglevFunctionEntryStackCheck(MacroAssembler* masm,
bool save_new_target) { … }
#endif
#if V8_ENABLE_WEBASSEMBLY
int SaveWasmParams(MacroAssembler* masm) { … }
void RestoreWasmParams(MacroAssembler* masm, int offset) { … }
void Builtins::Generate_WasmLiftoffFrameSetup(MacroAssembler* masm) { … }
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { … }
void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) { … }
namespace {
void SwitchStackState(MacroAssembler* masm, Register jmpbuf,
wasm::JumpBuffer::StackState old_state,
wasm::JumpBuffer::StackState new_state) { … }
void FillJumpBuffer(MacroAssembler* masm, Register jmpbuf, Label* pc) { … }
void LoadJumpBuffer(MacroAssembler* masm, Register jmpbuf, bool load_pc) { … }
void SaveState(MacroAssembler* masm, Register active_continuation, Register tmp,
Label* suspend) { … }
void LoadTargetJumpBuffer(MacroAssembler* masm, Register target_continuation) { … }
void SwitchStacks(MacroAssembler* masm, Register finished_continuation,
const Register& keep1, const Register& keep2 = no_reg,
const Register& keep3 = no_reg) { … }
void ReloadParentContinuation(MacroAssembler* masm, Register promise,
Register return_value, Register context,
Register tmp1, Register tmp2) { … }
void GetContextFromImplicitArg(MacroAssembler* masm, Register data) { … }
void RestoreParentSuspender(MacroAssembler* masm, Register tmp1,
Register tmp2) { … }
void ResetStackSwitchFrameStackSlots(MacroAssembler* masm) { … }
void SwitchToAllocatedStack(MacroAssembler* masm, Register wasm_instance,
Register wrapper_buffer, Register original_fp,
Register new_wrapper_buffer, Register scratch,
Label* suspend) { … }
void SwitchBackAndReturnPromise(MacroAssembler* masm, Register tmp1,
Register tmp2, Label* return_promise) { … }
void GenerateExceptionHandlingLandingPad(MacroAssembler* masm,
Label* return_promise) { … }
void JSToWasmWrapperHelper(MacroAssembler* masm, bool stack_switch) { … }
}
void Builtins::Generate_JSToWasmWrapperAsm(MacroAssembler* masm) { … }
void Builtins::Generate_WasmReturnPromiseOnSuspendAsm(MacroAssembler* masm) { … }
void Builtins::Generate_WasmToJsWrapperAsm(MacroAssembler* masm) { … }
void Builtins::Generate_WasmTrapHandlerLandingPad(MacroAssembler* masm) { … }
void Builtins::Generate_WasmSuspend(MacroAssembler* masm) { … }
namespace {
void Generate_WasmResumeHelper(MacroAssembler* masm, wasm::OnResume on_resume) { … }
}
void Builtins::Generate_WasmResume(MacroAssembler* masm) { … }
void Builtins::Generate_WasmReject(MacroAssembler* masm) { … }
void Builtins::Generate_WasmOnStackReplace(MacroAssembler* masm) { … }
namespace {
static constexpr Register kOldSPRegister = …;
void SwitchToTheCentralStackIfNeeded(MacroAssembler* masm,
int r12_stack_slot_index) { … }
void SwitchFromTheCentralStackIfNeeded(MacroAssembler* masm,
int r12_stack_slot_index) { … }
}
void Builtins::Generate_WasmToOnHeapWasmToJsTrampoline(MacroAssembler* masm) { … }
#endif
void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
ArgvMode argv_mode, bool builtin_exit_frame,
bool switch_to_central_stack) { … }
#if V8_ENABLE_WEBASSEMBLY
void Builtins::Generate_WasmHandleStackOverflow(MacroAssembler* masm) { … }
#endif
void Builtins::Generate_DoubleToI(MacroAssembler* masm) { … }
void Builtins::Generate_CallApiCallbackImpl(MacroAssembler* masm,
CallApiCallbackMode mode) { … }
void Builtins::Generate_CallApiGetter(MacroAssembler* masm) { … }
void Builtins::Generate_DirectCEntry(MacroAssembler* masm) { … }
namespace {
void Generate_DeoptimizationEntry(MacroAssembler* masm,
DeoptimizeKind deopt_kind) { … }
}
void Builtins::Generate_DeoptimizationEntry_Eager(MacroAssembler* masm) { … }
void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) { … }
namespace {
void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
bool next_bytecode,
bool is_osr = false) { … }
}
void Builtins::Generate_BaselineOrInterpreterEnterAtBytecode(
MacroAssembler* masm) { … }
void Builtins::Generate_BaselineOrInterpreterEnterAtNextBytecode(
MacroAssembler* masm) { … }
void Builtins::Generate_InterpreterOnStackReplacement_ToBaseline(
MacroAssembler* masm) { … }
void Builtins::Generate_RestartFrameTrampoline(MacroAssembler* masm) { … }
#undef __
}
}
#endif