18 Register size_in_bytes) {
19 __ sub(
object,
object, size_in_bytes,
LeaveCC);
29void AllocateRaw(MaglevAssembler* masm, Isolate* isolate,
30 RegisterSnapshot register_snapshot, Register
object,
35 DCHECK(masm->allow_allocate());
42 ZoneLabelRef done(masm);
43 MaglevAssembler::TemporaryRegisterScope temps(masm);
44 Register scratch = temps.AcquireScratch();
50 Register new_top = object;
52 __ ldr(
object,
__ ExternalReferenceAsOperand(top, scratch));
53 __ add(new_top,
object, Operand(size_in_bytes),
LeaveCC);
54 __ ldr(scratch,
__ ExternalReferenceAsOperand(limit, scratch));
55 __ cmp(new_top, scratch);
61 __ Move(
__ ExternalReferenceAsOperand(top, scratch), new_top);
72 alloc_type, alignment);
80 alloc_type, alignment);
88 CHECK(!graph->has_recursive_calls());
90 uint32_t source_frame_size =
91 graph->min_maglev_stackslots_for_unoptimized_frame_size();
98 Assert(
eq, AbortReason::kOsrUnexpectedStackSize);
101 uint32_t target_frame_size =
102 graph->tagged_stack_slots() + graph->untagged_stack_slots();
103 CHECK_LE(source_frame_size, target_frame_size);
105 if (source_frame_size < target_frame_size) {
107 uint32_t additional_tagged =
108 source_frame_size < graph->tagged_stack_slots()
109 ? graph->tagged_stack_slots() - source_frame_size
111 if (additional_tagged) {
114 for (
size_t i = 0;
i < additional_tagged; ++
i) {
117 uint32_t size_so_far = source_frame_size + additional_tagged;
118 CHECK_LE(size_so_far, target_frame_size);
119 if (size_so_far < target_frame_size) {
134 if (graph->has_recursive_calls()) {
138#ifndef V8_ENABLE_LEAPTIERING
142 Register flags = D::GetRegisterParameter(D::kFlags);
143 Register feedback_vector = D::GetRegisterParameter(D::kFeedbackVector);
149 Move(feedback_vector,
158 Builtin::kMaglevOptimizeCodeOrTailCallOptimizedCodeSlot);
172 if (graph->tagged_stack_slots() > 0) {
180 const int kLoopUnrollSize = 8;
191 for (
int i = 0;
i < first_slots; ++
i) {
201 for (
int i = 0;
i < kLoopUnrollSize; ++
i) {
208 if (graph->untagged_stack_slots() > 0) {
216 Label* eager_deopt_entry,
217 size_t lazy_deopt_count,
218 Label* lazy_deopt_entry) {
231 LoadRoot(table, RootIndex::kSingleCharacterStringTable);
237 Label* char_code_fits_one_byte,
258 if (char_code ==
result) {
259 __ Move(scratch, char_code);
270 register_snapshot, done,
result, char_code, scratch);
271 if (char_code_fits_one_byte !=
nullptr) {
272 bind(char_code_fits_one_byte);
282 Label* result_fits_one_byte) {
326 AbortReason::kUnexpectedValue);
331 Check(
lo, AbortReason::kUnexpectedValue);
348 b(
eq, &sliced_string);
350 b(
ne, deferred_runtime_call);
360 bind(&sliced_string);
376 Register second_string = instance_type;
378 CompareRoot(second_string, RootIndex::kempty_string);
379 b(
ne, deferred_runtime_call);
386 Label two_byte_string;
388 b(
eq, &two_byte_string);
395 b(result_fits_one_byte);
397 bind(&two_byte_string);
401 add(scratch, scratch,
411 string_backup = scratch2;
412 Move(string_backup,
string);
416 Register first_code_point = scratch;
427 Register second_code_point = scratch;
435 and_(scratch2, second_code_point,
Operand(0xfc00));
439 int surrogate_offset = 0x10000 - (0xd800 << 10) - 0xdc00;
440 add(second_code_point, second_code_point,
Operand(surrogate_offset));
454 Move(
string, 0xdeadbeef);
457 Move(index, 0xdeadbeef);
492 vmov(dst, temp_vfps);
509 VmovHigh(high_word32_of_input, src);
528 vmov(dst, temp_vfps);
545 VmovHigh(high_word32_of_input, src);
#define Assert(condition)
void vcvt_u32_f64(const SwVfpRegister dst, const DwVfpRegister src, VFPConversionMode mode=kDefaultRoundToZero, const Condition cond=al)
void and_(Register dst, Register src1, const Operand &src2, SBit s=LeaveCC, Condition cond=al)
void b(int branch_offset, Condition cond=al, RelocInfo::Mode rmode=RelocInfo::NO_INFO)
void add(Register dst, Register src1, const Operand &src2, SBit s=LeaveCC, Condition cond=al)
void CheckConstPool(bool force_emit, bool require_jump)
void vmov(const SwVfpRegister dst, Float32 imm)
void vcvt_f64_s32(const DwVfpRegister dst, const SwVfpRegister src, VFPConversionMode mode=kDefaultRoundToZero, const Condition cond=al)
void cmp(Register src1, const Operand &src2, Condition cond=al)
void ldrh(Register dst, const MemOperand &src, Condition cond=al)
void sub(Register dst, Register src1, const Operand &src2, SBit s=LeaveCC, Condition cond=al)
void lsl(Register dst, Register src1, const Operand &src2, SBit s=LeaveCC, Condition cond=al)
void ldrb(Register dst, const MemOperand &src, Condition cond=al)
void strh(Register src, const MemOperand &dst, Condition cond=al)
void vcvt_f64_u32(const DwVfpRegister dst, const SwVfpRegister src, VFPConversionMode mode=kDefaultRoundToZero, const Condition cond=al)
void vcvt_s32_f64(const SwVfpRegister dst, const DwVfpRegister src, VFPConversionMode mode=kDefaultRoundToZero, const Condition cond=al)
void vstr(const DwVfpRegister src, const Register base, int offset, const Condition cond=al)
void tst(Register src1, const Operand &src2, Condition cond=al)
void ldr(Register dst, const MemOperand &src, Condition cond=al)
SwVfpRegister low() const
void SmiUntag(Register reg, SBit s=LeaveCC)
void CompareRoot(Register obj, RootIndex index)
void VFPCompareAndSetFlags(const SwVfpRegister src1, const SwVfpRegister src2, const Condition cond=al)
void BailoutIfDeoptimized()
void SmiTag(Register reg, SBit s=LeaveCC)
void LoadRoot(Register destination, RootIndex index) final
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg=false)
void VmovHigh(Register dst, DwVfpRegister src)
Condition LoadFeedbackVectorFlagsAndCheckIfNeedsProcessing(Register flags, Register feedback_vector, CodeKind current_code_kind)
void Check(Condition cond, AbortReason reason)
void AllocateStackSpace(Register bytes)
void AssertZeroExtended(Register int32_register)
void TryInlineTruncateDoubleToI(Register result, DwVfpRegister input, Label *done)
void TailCallBuiltin(Builtin builtin, Condition cond=al)
constexpr void set(RegisterT reg)
constexpr bool has(RegisterT reg) const
static constexpr int kFixedFrameSizeFromFp
static const int32_t kMaxOneByteCharCode
LowDwVfpRegister AcquireLowD()
IndirectHandle< NativeContext > object() const
void Include(const RegList list)
Register AcquireScratch()
compiler::NativeContextRef native_context() const
void LoadSingleCharacterString(Register result, int char_code)
void LoadAndUntagTaggedSignedField(Register result, Register object, int offset)
void AssertObjectTypeInRange(Register heap_object, InstanceType lower_limit, InstanceType higher_limit, AbortReason reason)
void StringFromCharCode(RegisterSnapshot register_snapshot, Label *char_code_fits_one_byte, Register result, Register char_code, Register scratch, CharCodeMaskMode mask_mode)
void Jump(Label *target, Label::Distance distance=Label::kFar)
void CallRuntime(Runtime::FunctionId fid)
void LoadInstanceType(Register instance_type, Register heap_object)
void Allocate(RegisterSnapshot register_snapshot, Register result, int size_in_bytes, AllocationType alloc_type=AllocationType::kYoung, AllocationAlignment alignment=kTaggedAligned)
void TryTruncateDoubleToUint32(Register dst, DoubleRegister src, Label *fail)
void StringCharCodeOrCodePointAt(BuiltinStringPrototypeCharCodeOrCodePointAt::Mode mode, RegisterSnapshot ®ister_snapshot, Register result, Register string, Register index, Register scratch1, Register scratch2, Label *result_fits_one_byte)
void AllocateTwoByteString(RegisterSnapshot register_snapshot, Register result, int length)
void Move(StackSlot dst, Register src)
void CallBuiltin(Builtin builtin)
void TryTruncateDoubleToInt32(Register dst, DoubleRegister src, Label *fail)
Label * MakeDeferredCode(Function &&deferred_code_gen, Args &&... args)
void JumpToDeferredIf(Condition cond, Function &&deferred_code_gen, Args &&... args)
void TruncateDoubleToInt32(Register dst, DoubleRegister src)
void MaybeEmitDeoptBuiltinsCall(size_t eager_deopt_count, Label *eager_deopt_entry, size_t lazy_deopt_count, Label *lazy_deopt_entry)
MaglevCompilationInfo * compilation_info() const
MaglevCodeGenState * code_gen_state() const
void OSRPrologue(Graph *graph)
void TryChangeFloat64ToIndex(Register result, DoubleRegister value, Label *success, Label *fail)
void JumpIf(Condition cond, Label *target, Label::Distance distance=Label::kFar)
void LoadTaggedField(Register result, MemOperand operand)
#define ASM_CODE_COMMENT_STRING(asm,...)
ZoneVector< RpoNumber > & result
void AllocateSlow(MaglevAssembler *masm, RegisterSnapshot register_snapshot, Register object, Builtin builtin, T size_in_bytes, ZoneLabelRef done)
Builtin AllocateBuiltin(AllocationType alloc_type)
ExternalReference SpaceAllocationTopAddress(Isolate *isolate, AllocationType alloc_type)
void SubSizeAndTagObject(MaglevAssembler *masm, Register object, Register size_in_bytes)
void AllocateRaw(MaglevAssembler *masm, Isolate *isolate, RegisterSnapshot register_snapshot, Register object, T size_in_bytes, AllocationType alloc_type, AllocationAlignment alignment)
ExternalReference SpaceAllocationLimitAddress(Isolate *isolate, AllocationType alloc_type)
@ kUnsignedGreaterThanEqual
constexpr InstanceType LAST_STRING_TYPE
constexpr Register kJavaScriptCallArgCountRegister
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
const uint32_t kOneByteStringTag
MemOperand FieldMemOperand(Register object, int offset)
constexpr int kSystemPointerSize
constexpr int kTaggedSizeLog2
constexpr Register kReturnRegister0
const uint32_t kStringRepresentationMask
constexpr Register kContextRegister
V8_EXPORT_PRIVATE bool AreAliased(const CPURegister ®1, const CPURegister ®2, const CPURegister ®3=NoReg, const CPURegister ®4=NoReg, const CPURegister ®5=NoReg, const CPURegister ®6=NoReg, const CPURegister ®7=NoReg, const CPURegister ®8=NoReg)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr int kDoubleSize
constexpr Register kJavaScriptCallNewTargetRegister
constexpr Register kJSFunctionRegister
template const char * string
BytecodeSequenceNode * parent_
#define CHECK_LE(lhs, rhs)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
RegList live_tagged_registers
#define OFFSET_OF_DATA_START(Type)