v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
macro-assembler-ia32.h
Go to the documentation of this file.
1// Copyright 2012 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_IA32_MACRO_ASSEMBLER_IA32_H_
6#define V8_CODEGEN_IA32_MACRO_ASSEMBLER_IA32_H_
7
8#ifndef INCLUDED_FROM_MACRO_ASSEMBLER_H
9#error This header must be included via macro-assembler.h
10#endif
11
12#include <stdint.h>
13
14#include "include/v8-internal.h"
15#include "src/base/logging.h"
16#include "src/base/macros.h"
23#include "src/codegen/label.h"
25#include "src/codegen/reglist.h"
28#include "src/common/globals.h"
31#include "src/handles/handles.h"
33#include "src/objects/smi.h"
34#include "src/roots/roots.h"
35#include "src/runtime/runtime.h"
36
37namespace v8 {
38namespace internal {
39
40class InstructionStream;
41class ExternalReference;
42class StatsCounter;
43
44// Convenience for platform-independent signatures. We do not normally
45// distinguish memory operands from other operands on ia32.
47
48// TODO(victorgomes): Move definition to macro-assembler.h, once all other
49// platforms are updated.
51
52// Convenient class to access arguments below the stack pointer.
53class StackArgumentsAccessor {
54 public:
55 // argc = the number of arguments not including the receiver.
56 explicit StackArgumentsAccessor(Register argc) : argc_(argc) {
58 }
59
60 // Argument 0 is the receiver (despite argc not including the receiver).
61 Operand operator[](int index) const { return GetArgumentOperand(index); }
62
63 Operand GetArgumentOperand(int index) const;
65
66 private:
68
70};
71
73 : public SharedMacroAssembler<MacroAssembler> {
74 public:
75 using SharedMacroAssembler<MacroAssembler>::SharedMacroAssembler;
76
78 void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
79 Label* condition_met,
80 Label::Distance condition_met_distance = Label::kFar);
81
82 // Activation support.
84 void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg) {
85 // Out-of-line constant pool not implemented on ia32.
87 }
89
90// Allocate stack space of given size (i.e. decrement {esp} by the value
91// stored in the given register, or by a constant). If you need to perform a
92// stack check, do it before calling this function because this function may
93// write into the newly allocated space. It may also overwrite the given
94// register's value, in the version that takes a register.
95#ifdef V8_OS_WIN
96 void AllocateStackSpace(Register bytes_scratch);
97 void AllocateStackSpace(int bytes);
98#else
99 void AllocateStackSpace(Register bytes) { sub(esp, bytes); }
100 void AllocateStackSpace(int bytes) {
101 DCHECK_GE(bytes, 0);
102 if (bytes == 0) return;
103 sub(esp, Immediate(bytes));
104 }
105#endif
106
107 // Print a message to stdout and abort execution.
108 void Abort(AbortReason reason);
109
110 // Calls Abort(msg) if the condition cc is not satisfied.
111 // Use --debug_code to enable.
113
114 // Like Assert(), but without condition.
115 // Use --debug_code to enable.
117
118 // Like Assert(), but always enabled.
119 void Check(Condition cc, AbortReason reason);
120
121 // Check that the stack is aligned.
123
124 // Align to natural boundary
126
127 // Move a constant into a destination using the most efficient encoding.
128 void Move(Register dst, int32_t x) {
129 if (x == 0) {
130 xor_(dst, dst);
131 } else {
132 mov(dst, Immediate(x));
133 }
134 }
135 void Move(Register dst, const Immediate& src);
136 void Move(Register dst, Tagged<Smi> src) { Move(dst, Immediate(src)); }
138 void Move(Register dst, Register src);
139 void Move(Register dst, Operand src);
140 void Move(Operand dst, const Immediate& src);
141
142 // Move an immediate into an XMM register.
143 void Move(XMMRegister dst, uint32_t src);
144 void Move(XMMRegister dst, uint64_t src);
145 void Move(XMMRegister dst, float src) {
146 Move(dst, base::bit_cast<uint32_t>(src));
147 }
148 void Move(XMMRegister dst, double src) {
149 Move(dst, base::bit_cast<uint64_t>(src));
150 }
151
153
154 void Call(Register reg) { call(reg); }
155 void Call(Operand op) { call(op); }
156 void Call(Label* target) { call(target); }
157 void Call(Handle<Code> code_object, RelocInfo::Mode rmode);
158
159 // Load the builtin given by the Smi in |builtin_index| into |target|.
160 void LoadEntryFromBuiltinIndex(Register builtin_index, Register target);
161 void CallBuiltinByIndex(Register builtin_index, Register target);
162 void CallBuiltin(Builtin builtin);
163 void TailCallBuiltin(Builtin builtin);
164
165#ifdef V8_ENABLE_LEAPTIERING
166 void LoadEntrypointFromJSDispatchTable(Register destination,
167 Register dispatch_handle);
168#endif // V8_ENABLE_LEAPTIERING
169
170 // Load the code entry point from the Code object.
172 CodeEntrypointTag = kDefaultCodeEntrypointTag);
173 void CallCodeObject(Register code_object);
174 void JumpCodeObject(Register code_object,
175 JumpMode jump_mode = JumpMode::kJump);
176
177 // Convenience functions to call/jmp to the code of a JSFunction object.
178 void CallJSFunction(Register function_object, uint16_t argument_count);
179 void JumpJSFunction(Register function_object,
180 JumpMode jump_mode = JumpMode::kJump);
181#ifdef V8_ENABLE_WEBASSEMBLY
182 void ResolveWasmCodePointer(Register target);
183 void CallWasmCodePointer(Register target,
184 CallJumpMode call_jump_mode = CallJumpMode::kCall);
185#endif
186
187 void Jump(const ExternalReference& reference);
188 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode);
189
191
193
194 void LoadFeedbackVector(Register dst, Register closure, Register scratch,
195 Label* fbv_undef, Label::Distance distance);
196
197 void Trap();
199
200 void CallForDeoptimization(Builtin target, int deopt_id, Label* exit,
202 Label* jump_deoptimization_entry_label);
203
204 // Jump the register contains a smi.
205 inline void JumpIfSmi(Register value, Label* smi_label,
206 Label::Distance distance = Label::kFar) {
207 test(value, Immediate(kSmiTagMask));
208 j(zero, smi_label, distance);
209 }
210 // Jump if the operand is a smi.
211 inline void JumpIfSmi(Operand value, Label* smi_label,
212 Label::Distance distance = Label::kFar) {
213 test(value, Immediate(kSmiTagMask));
214 j(zero, smi_label, distance);
215 }
216
217 void JumpIfEqual(Register a, int32_t b, Label* dest) {
218 cmp(a, Immediate(b));
219 j(equal, dest);
220 }
221
222 void JumpIfLessThan(Register a, int32_t b, Label* dest) {
223 cmp(a, Immediate(b));
224 j(less, dest);
225 }
226
228 void SmiUntag(Register output, Register value) {
229 mov(output, value);
230 SmiUntag(output);
231 }
232
233 void SmiToInt32(Register reg) { SmiUntag(reg); }
234
235 // Before calling a C-function from generated code, align arguments on stack.
236 // After aligning the frame, arguments must be stored in esp[0], esp[4],
237 // etc., not pushed. The argument count assumes all arguments are word sized.
238 // Some compilers/platforms require the stack to be aligned when calling
239 // C++ code.
240 // Needs a scratch register to do some arithmetic. This register will be
241 // trashed.
242 void PrepareCallCFunction(int num_arguments, Register scratch);
243
244 // Calls a C function and cleans up the space for arguments allocated
245 // by PrepareCallCFunction. The called function is not allowed to trigger a
246 // garbage collection, since that might move the code and invalidate the
247 // return address (unless this is somehow accounted for by the called
248 // function).
250 ExternalReference function, int num_arguments,
251 SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes,
252 Label* return_location = nullptr);
254 Register function, int num_arguments,
255 SetIsolateDataSlots set_isolate_data_slots = SetIsolateDataSlots::kYes,
256 Label* return_location = nullptr);
257
258 void ShlPair(Register high, Register low, uint8_t imm8);
259 void ShlPair_cl(Register high, Register low);
260 void ShrPair(Register high, Register low, uint8_t imm8);
261 void ShrPair_cl(Register high, Register low);
262 void SarPair(Register high, Register low, uint8_t imm8);
263 void SarPair_cl(Register high, Register low);
264
265 // Generates function and stub prologue code.
267 void Prologue();
268
269 // Helpers for argument handling
272 Register scratch);
274 Register scratch);
275
276 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); }
277 void Lzcnt(Register dst, Operand src);
278
279 void Tzcnt(Register dst, Register src) { Tzcnt(dst, Operand(src)); }
280 void Tzcnt(Register dst, Operand src);
281
282 void Popcnt(Register dst, Register src) { Popcnt(dst, Operand(src)); }
283 void Popcnt(Register dst, Operand src);
284
285 void PushReturnAddressFrom(Register src) { push(src); }
286 void PopReturnAddressTo(Register dst) { pop(dst); }
287
289 Push(src, scratch);
290 }
292 Pop(dst, scratch);
293 }
294
295 void Ret();
296
297 // Root register utility functions.
298
300
303
304 // Indirect root-relative loads.
305 void LoadFromConstantsTable(Register destination, int constant_index) final;
308 void StoreRootRelative(int32_t offset, Register value) final;
309
310 void PushPC();
311
312 enum class PushArrayOrder { kNormal, kReverse };
313 // `array` points to the first element (the lowest address).
314 // `array` and `size` are not modified.
315 void PushArray(Register array, Register size, Register scratch,
316 PushArrayOrder order = PushArrayOrder::kNormal);
317
318 // Operand pointing to an external reference.
319 // May emit code to set up the scratch register. The operand is
320 // only guaranteed to be correct as long as the scratch register
321 // isn't changed.
322 // If the operand is used more than once, use a scratch register
323 // that is guaranteed not to be clobbered.
325 Register scratch);
327 return ExternalReferenceAsOperand(ExternalReference::Create(id), no_reg);
328 }
331
333
334 void CompareRoot(Register with, RootIndex index);
335 void CompareRoot(Register with, Register scratch, RootIndex index);
336
337 // Return and drop arguments from stack, where the number of arguments
338 // may be bigger than 2^16 - 1. Requires a scratch register.
339 void Ret(int bytes_dropped, Register scratch);
340
341 void PextrdPreSse41(Register dst, XMMRegister src, uint8_t imm8);
342 void PinsrdPreSse41(XMMRegister dst, Register src, uint8_t imm8,
343 uint32_t* load_pc_offset) {
344 PinsrdPreSse41(dst, Operand(src), imm8, load_pc_offset);
345 }
346 void PinsrdPreSse41(XMMRegister dst, Operand src, uint8_t imm8,
347 uint32_t* load_pc_offset);
348
349 // Expression support
350 // cvtsi2sd instruction only writes to the low 64-bit of dst register, which
351 // hinders register renaming and makes dependence chains longer. So we use
352 // xorps to clear the dst register before cvtsi2sd to solve this issue.
353 void Cvtsi2ss(XMMRegister dst, Register src) { Cvtsi2ss(dst, Operand(src)); }
355 void Cvtsi2sd(XMMRegister dst, Register src) { Cvtsi2sd(dst, Operand(src)); }
357
358 void Cvtui2ss(XMMRegister dst, Register src, Register tmp) {
359 Cvtui2ss(dst, Operand(src), tmp);
360 }
363 Cvttss2ui(dst, Operand(src), tmp);
364 }
366 void Cvtui2sd(XMMRegister dst, Register src, Register scratch) {
367 Cvtui2sd(dst, Operand(src), scratch);
368 }
369 void Cvtui2sd(XMMRegister dst, Operand src, Register scratch);
371 Cvttsd2ui(dst, Operand(src), tmp);
372 }
374
375 void Push(Register src) { push(src); }
376 void Push(Operand src) { push(src); }
377 void Push(Immediate value);
378 void Push(Handle<HeapObject> handle) { push(Immediate(handle)); }
379 void Push(Tagged<Smi> smi) { Push(Immediate(smi)); }
380 void Push(XMMRegister src, Register scratch) {
381 movd(scratch, src);
382 push(scratch);
383 }
384
385 void Pop(Register dst) { pop(dst); }
386 void Pop(Operand dst) { pop(dst); }
387 void Pop(XMMRegister dst, Register scratch) {
388 pop(scratch);
389 movd(dst, scratch);
390 }
391
394
395 void CallEphemeronKeyBarrier(Register object, Register slot_address,
396 SaveFPRegsMode fp_mode);
397
399 Register object, Register slot_address, SaveFPRegsMode fp_mode,
400 StubCallMode mode = StubCallMode::kCallBuiltinPointer);
402 Register object, Register slot_address, SaveFPRegsMode fp_mode,
403 StubCallMode mode = StubCallMode::kCallBuiltinPointer);
404
405 // Calculate how much stack space (in bytes) are required to store caller
406 // registers excluding those specified in the arguments.
408 Register exclusion = no_reg) const;
409
410 // PushCallerSaved and PopCallerSaved do not arrange the registers in any
411 // particular order so they are not useful for calls that can cause a GC.
412 // The caller can exclude a register that does not need to be saved and
413 // restored.
414
415 // Push caller saved registers on the stack, and return the number of bytes
416 // stack pointer is adjusted.
417 int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion = no_reg);
418 // Restore caller saved registers from the stack, and return the number of
419 // bytes stack pointer is adjusted.
420 int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion = no_reg);
421
422 // Compute the start of the generated instruction stream from the current PC.
423 // This is an alternative to embedding the {CodeObject} handle as a reference.
425
426 // Control-flow integrity:
427
428 // Define a function entrypoint. This doesn't emit any code for this
429 // architecture, as control-flow integrity is not supported for it.
430 void CodeEntry() {}
431 // Define an exception handler.
433 // Define an exception handler and bind a label.
435
436 void PushRoot(RootIndex index);
437
438 // Compare the object in a register to a value and jump if they are equal.
439 void JumpIfRoot(Register with, RootIndex index, Label* if_equal,
440 Label::Distance if_equal_distance = Label::kFar) {
441 CompareRoot(with, index);
442 j(equal, if_equal, if_equal_distance);
443 }
444
445 // Compare the object in a register to a value and jump if they are not equal.
446 void JumpIfNotRoot(Register with, RootIndex index, Label* if_not_equal,
447 Label::Distance if_not_equal_distance = Label::kFar) {
448 CompareRoot(with, index);
449 j(not_equal, if_not_equal, if_not_equal_distance);
450 }
451
452 // Checks if value is in range [lower_limit, higher_limit] using a single
453 // comparison. Flags CF=1 or ZF=1 indicate the value is in the range
454 // (condition below_equal). It is valid, that |value| == |scratch| as far as
455 // this function is concerned.
456 void CompareRange(Register value, unsigned lower_limit, unsigned higher_limit,
457 Register scratch);
458 void JumpIfIsInRange(Register value, unsigned lower_limit,
459 unsigned higher_limit, Register scratch,
460 Label* on_in_range,
461 Label::Distance near_jump = Label::kFar);
462
463 // ---------------------------------------------------------------------------
464 // GC Support
465 // Notify the garbage collector that we wrote a pointer into an object.
466 // |object| is the object being stored into, |value| is the object being
467 // stored. value and scratch registers are clobbered by the operation.
468 // The offset is the offset from the start of the object, not the offset from
469 // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
470 void RecordWriteField(Register object, int offset, Register value,
471 Register scratch, SaveFPRegsMode save_fp,
472 SmiCheck smi_check = SmiCheck::kInline);
473
474 // For page containing |object| mark region covering |address|
475 // dirty. |object| is the object being stored into, |value| is the
476 // object being stored. The address and value registers are clobbered by the
477 // operation. RecordWrite filters out smis so it does not update the
478 // write barrier if the value is a smi.
479 void RecordWrite(Register object, Register address, Register value,
480 SaveFPRegsMode save_fp,
481 SmiCheck smi_check = SmiCheck::kInline);
482
483 // Allocates an EXIT/BUILTIN_EXIT/API_CALLBACK_EXIT frame with given number
484 // of slots in non-GCed area.
485 void EnterExitFrame(int extra_slots, StackFrame::Type frame_type,
486 Register c_function);
488
489 // Load the global proxy from the current context.
491
492 // Load a value from the native context with a given index.
493 void LoadNativeContextSlot(Register dst, int index);
494
495 // ---------------------------------------------------------------------------
496 // JavaScript invokes
497
498 // Invoke the JavaScript function code by either calling or jumping.
499
501 Register expected_parameter_count,
502 Register actual_parameter_count, InvokeType type);
503
504 // On function call, call into the debugger.
505 // This may clobber ecx.
507 Register expected_parameter_count,
508 Register actual_parameter_count);
509
510 // Invoke the JavaScript function in the given register. Changes the
511 // current context to the context in the function before invoking.
513 Register actual_parameter_count, InvokeType type);
514
515 // Compare object type for heap object.
516 // Incoming register is heap_object and outgoing register is map.
517 void CmpObjectType(Register heap_object, InstanceType type, Register map);
518
519 // Compare instance type for map.
521
522 // Compare instance type ranges for a map (lower_limit and higher_limit
523 // inclusive).
524 //
525 // Always use unsigned comparisons: below_equal for a positive
526 // result.
527 void CmpInstanceTypeRange(Register map, Register instance_type_out,
528 Register scratch, InstanceType lower_limit,
529 InstanceType higher_limit);
530
531 // Smi tagging support.
533 static_assert(kSmiTag == 0);
534 static_assert(kSmiTagSize == 1);
535 add(reg, reg);
536 }
537
538 // Simple comparison of smis. Both sides must be known smis to use these,
539 // otherwise use Cmp.
540 void SmiCompare(Register smi1, Register smi2);
544 void SmiCompare(Operand dst, Smi src);
545
546 // Jump if register contain a non-smi.
547 inline void JumpIfNotSmi(Register value, Label* not_smi_label,
548 Label::Distance distance = Label::kFar) {
549 test(value, Immediate(kSmiTagMask));
550 j(not_zero, not_smi_label, distance);
551 }
552 // Jump if the operand is not a smi.
553 inline void JumpIfNotSmi(Operand value, Label* smi_label,
554 Label::Distance distance = Label::kFar) {
555 test(value, Immediate(kSmiTagMask));
556 j(not_zero, smi_label, distance);
557 }
558
559 template <typename Field>
561 static const int shift = Field::kShift;
562 static const int mask = Field::kMask >> Field::kShift;
563 if (shift != 0) {
564 sar(reg, shift);
565 }
566 and_(reg, Immediate(mask));
567 }
568
571
572 // Tiering support.
578 Register closure, Register scratch1,
579 Register slot_address);
582 Register flags, XMMRegister saved_feedback_vector,
583 CodeKind current_code_kind, Label* flags_need_processing);
585 Register flags, XMMRegister saved_feedback_vector);
586
587 // Abort execution if argument is not a smi, enabled via --debug-code.
590
591 // Abort execution if argument is a smi, enabled via --debug-code.
593
594 // Abort execution if argument is not a JSFunction, enabled via --debug-code.
596
597 // Abort execution if argument is not a callable JSFunction, enabled via
598 // --debug-code.
601
602 // Abort execution if argument is not a Constructor, enabled via --debug-code.
604
605 // Abort execution if argument is not a JSBoundFunction,
606 // enabled via --debug-code.
608
609 // Abort execution if argument is not a JSGeneratorObject (or subclass),
610 // enabled via --debug-code.
612
613 // Abort execution if argument is not undefined or an AllocationSite, enabled
614 // via --debug-code.
617
618 void AssertJSAny(Register object, Register map_tmp,
620
621 // ---------------------------------------------------------------------------
622 // Exception handling
623
624 // Push a new stack handler and link it into stack handler chain.
626
627 // Unlink the stack handler on top of the stack from the stack handler chain.
629
630 // ---------------------------------------------------------------------------
631 // Runtime calls
632
633 // Call a runtime routine.
634 void CallRuntime(const Runtime::Function* f, int num_arguments);
635
636 // Convenience function: Same as above, but takes the fid instead.
638 const Runtime::Function* function = Runtime::FunctionForId(fid);
639 CallRuntime(function, function->nargs);
640 }
641
642 // Convenience function: Same as above, but takes the fid instead.
643 void CallRuntime(Runtime::FunctionId fid, int num_arguments) {
644 CallRuntime(Runtime::FunctionForId(fid), num_arguments);
645 }
646
647 // Convenience function: tail call a runtime routine (jump).
649
650 // Jump to a runtime routine.
652 bool builtin_exit_frame = false);
653
654 // ---------------------------------------------------------------------------
655 // Utilities
656
657 // Emit code to discard a non-negative number of pointer-sized elements
658 // from the stack, clobbering only the esp register.
659 void Drop(int element_count);
660
661 // ---------------------------------------------------------------------------
662 // In-place weak references.
663 void LoadWeakValue(Register in_out, Label* target_if_cleared);
664
665 // ---------------------------------------------------------------------------
666 // StatsCounter support
667
668 void IncrementCounter(StatsCounter* counter, int value, Register scratch) {
669 if (!v8_flags.native_code_counters) return;
670 EmitIncrementCounter(counter, value, scratch);
671 }
672 void EmitIncrementCounter(StatsCounter* counter, int value, Register scratch);
673 void DecrementCounter(StatsCounter* counter, int value, Register scratch) {
674 if (!v8_flags.native_code_counters) return;
675 EmitDecrementCounter(counter, value, scratch);
676 }
677 void EmitDecrementCounter(StatsCounter* counter, int value, Register scratch);
678
679 // ---------------------------------------------------------------------------
680 // Stack limit utilities
683
684 void StackOverflowCheck(Register num_args, Register scratch,
685 Label* stack_overflow, bool include_receiver = false);
686
687 protected:
688 // Drops arguments assuming that the return address was already popped.
690
691 private:
692 // Helper functions for generating invokes.
693 void InvokePrologue(Register expected_parameter_count,
694 Register actual_parameter_count, InvokeType type);
695
697};
698
699// -----------------------------------------------------------------------------
700// Static helper functions.
701
702// Generate an Operand for loading a field from an object.
703inline Operand FieldOperand(Register object, int offset) {
704 return Operand(object, offset - kHeapObjectTag);
705}
706
707// Generate an Operand for loading an indexed field from an object.
709 int offset) {
710 return Operand(object, index, scale, offset - kHeapObjectTag);
711}
712
713// Provides access to exit frame stack space (not GC-ed).
714inline Operand ExitFrameStackSlotOperand(int offset) {
715 return Operand(esp, offset);
716}
717
718// Provides access to exit frame parameters (GC-ed).
719inline Operand ExitFrameCallerStackSlotOperand(int index) {
720 return Operand(ebp,
723}
724
725struct MoveCycleState {
726 // Whether a move in the cycle needs the double scratch register.
728};
729
730// Calls an API function. Allocates HandleScope, extracts returned value
731// from handle and propagates exceptions. Clobbers C argument registers
732// and C caller-saved registers. Restores context. On return removes
733// (*argc_operand + slots_to_drop_on_return) * kSystemPointerSize
734// (GCed, includes the call JS arguments space and the additional space
735// allocated for the fast call).
736void CallApiFunctionAndReturn(MacroAssembler* masm, bool with_profiling,
737 Register function_address,
738 ExternalReference thunk_ref, Register thunk_arg,
739 int slots_to_drop_on_return,
740 MemOperand* argc_operand,
741 MemOperand return_value_operand);
742
743#define ACCESS_MASM(masm) masm->
744
745} // namespace internal
746} // namespace v8
747
748#endif // V8_CODEGEN_IA32_MACRO_ASSEMBLER_IA32_H_
interpreter::OperandScale scale
Definition builtins.cc:44
Builtins::Kind kind
Definition builtins.cc:40
static constexpr int kFixedSlotCountAboveFp
void Move(XMMRegister dst, float src)
void PextrdPreSse41(Register dst, XMMRegister src, uint8_t imm8)
void Tzcnt(Register dst, Register src)
void Abort(AbortReason reason)
void LoadLabelAddress(Register dst, Label *lbl)
void Push(Immediate value)
void Move(XMMRegister dst, uint32_t src)
void CallJSFunction(Register function_object, uint16_t argument_count)
void CallDebugOnFunctionCall(Register fun, Register new_target, Register expected_parameter_count, Register actual_parameter_count)
void JumpIfRoot(Register with, RootIndex index, Label *if_equal, Label::Distance if_equal_distance=Label::kFar)
void Popcnt(Register dst, Operand src)
void LoadAddress(Register destination, ExternalReference source)
void JumpIfSmi(Operand value, Label *smi_label, Label::Distance distance=Label::kFar)
int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion=no_reg)
void CompareRoot(Register with, Register scratch, RootIndex index)
void CallRuntime(Runtime::FunctionId fid)
void ShlPair_cl(Register high, Register low)
void SmiCompare(Operand dst, Smi src)
void EnterFrame(StackFrame::Type type)
void Pop(XMMRegister dst, Register scratch)
void CmpInstanceTypeRange(Register map, Register instance_type_out, Register scratch, InstanceType lower_limit, InstanceType higher_limit)
void CompareStackLimit(Register with, StackLimitKind kind)
void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE
void RecordWriteField(Register object, int offset, Register value, Register scratch, SaveFPRegsMode save_fp, SmiCheck smi_check=SmiCheck::kInline)
void Push(XMMRegister src, Register scratch)
void SarPair(Register high, Register low, uint8_t imm8)
int CallCFunction(ExternalReference function, int num_arguments, SetIsolateDataSlots set_isolate_data_slots=SetIsolateDataSlots::kYes, Label *return_location=nullptr)
void RecordWrite(Register object, Register address, Register value, SaveFPRegsMode save_fp, SmiCheck smi_check=SmiCheck::kInline)
void Move(Register dst, Operand src)
void InvokeFunction(Register function, Register new_target, Register actual_parameter_count, InvokeType type)
void Move(Register dst, Register src)
void Call(Handle< Code > code_object, RelocInfo::Mode rmode)
void Assert(Condition cc, AbortReason reason) NOOP_UNLESS_DEBUG_CODE
void JumpIfEqual(Register a, int32_t b, Label *dest)
void DropArguments(Register count, Register scratch)
void LeaveExitFrame(Register scratch)
void AssertFeedbackVector(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE
void CallBuiltinByIndex(Register builtin_index, Register target)
void EnterExitFrame(int extra_slots, StackFrame::Type frame_type, Register c_function)
void LoadRootRelative(Register destination, int32_t offset) final
void JumpIfNotRoot(Register with, RootIndex index, Label *if_not_equal, Label::Distance if_not_equal_distance=Label::kFar)
void Push(Handle< HeapObject > handle)
void CompareRange(Register value, unsigned lower_limit, unsigned higher_limit, Register scratch)
void CallCodeObject(Register code_object)
void CallEphemeronKeyBarrier(Register object, Register slot_address, SaveFPRegsMode fp_mode)
void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE
void DropArgumentsAndPushNewReceiver(Register argc, Operand receiver, Register scratch)
void LoadRootRegisterOffset(Register destination, intptr_t offset) final
void EmitDecrementCounter(StatsCounter *counter, int value, Register scratch)
void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE
void LoadWeakValue(Register in_out, Label *target_if_cleared)
void Check(Condition cc, AbortReason reason)
void CheckPageFlag(Register object, Register scratch, int mask, Condition cc, Label *condition_met, Label::Distance condition_met_distance=Label::kFar)
void PinsrdPreSse41(XMMRegister dst, Operand src, uint8_t imm8, uint32_t *load_pc_offset)
void SmiCompare(Operand dst, Register src)
int CallCFunction(Register function, int num_arguments, SetIsolateDataSlots set_isolate_data_slots=SetIsolateDataSlots::kYes, Label *return_location=nullptr)
void Cvtsi2ss(XMMRegister dst, Operand src)
void InvokeFunctionCode(Register function, Register new_target, Register expected_parameter_count, Register actual_parameter_count, InvokeType type)
void AssertCallableFunction(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE
void Jump(const ExternalReference &reference)
void InvokePrologue(Register expected_parameter_count, Register actual_parameter_count, InvokeType type)
void Cvttsd2ui(Register dst, XMMRegister src, XMMRegister tmp)
void ReplaceClosureCodeWithOptimizedCode(Register optimized_code, Register closure, Register scratch1, Register slot_address)
void PushArray(Register array, Register size, Register scratch, PushArrayOrder order=PushArrayOrder::kNormal)
void LoadFeedbackVector(Register dst, Register closure, Register scratch, Label *fbv_undef, Label::Distance distance)
void LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing(Register flags, XMMRegister saved_feedback_vector, CodeKind current_code_kind, Label *flags_need_processing)
void SmiCompare(Register dst, Tagged< Smi > src)
void JumpIfIsInRange(Register value, unsigned lower_limit, unsigned higher_limit, Register scratch, Label *on_in_range, Label::Distance near_jump=Label::kFar)
void JumpIfNotSmi(Register value, Label *not_smi_label, Label::Distance distance=Label::kFar)
void Cvtui2sd(XMMRegister dst, Operand src, Register scratch)
void CallBuiltin(Builtin builtin)
void Tzcnt(Register dst, Operand src)
void CmpObjectType(Register heap_object, InstanceType type, Register map)
void Cvtui2sd(XMMRegister dst, Register src, Register scratch)
void SarPair_cl(Register high, Register low)
void ShlPair(Register high, Register low, uint8_t imm8)
void LeaveFrame(StackFrame::Type type)
void LoadGlobalProxy(Register dst)
int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion=no_reg)
void ShrPair(Register high, Register low, uint8_t imm8)
void AssertSmi(Operand object) NOOP_UNLESS_DEBUG_CODE
void Cvtsi2sd(XMMRegister dst, Register src)
Operand RootAsOperand(RootIndex index)
void LoadCodeInstructionStart(Register destination, Register code_object, CodeEntrypointTag=kDefaultCodeEntrypointTag)
void PushStackHandler(Register scratch)
Operand ExternalReferenceAsOperand(ExternalReference reference, Register scratch)
void Move(Operand dst, const Immediate &src)
void LoadRoot(Register destination, RootIndex index) final
void JumpIfNotSmi(Operand value, Label *smi_label, Label::Distance distance=Label::kFar)
Immediate ClearedValue() const
void PushRoot(RootIndex index)
void PopReturnAddressTo(XMMRegister dst, Register scratch)
void Lzcnt(Register dst, Register src)
void JumpCodeObject(Register code_object, JumpMode jump_mode=JumpMode::kJump)
void Ret(int bytes_dropped, Register scratch)
void JumpIfSmi(Register value, Label *smi_label, Label::Distance distance=Label::kFar)
void DropArgumentsAndPushNewReceiver(Register argc, Register receiver, Register scratch)
void LoadFromConstantsTable(Register destination, int constant_index) final
void CmpInstanceType(Register map, InstanceType type)
void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE
void DecrementCounter(StatsCounter *counter, int value, Register scratch)
void ComputeCodeStartAddress(Register dst)
void MaybeSaveRegisters(RegList registers)
void EmitIncrementCounter(StatsCounter *counter, int value, Register scratch)
void Move(Register dst, int32_t x)
DISALLOW_IMPLICIT_CONSTRUCTORS(MacroAssembler)
void JumpJSFunction(Register function_object, JumpMode jump_mode=JumpMode::kJump)
void IncrementCounter(StatsCounter *counter, int value, Register scratch)
void Move(Register dst, Tagged< Smi > src)
void AssertConstructor(Register object) NOOP_UNLESS_DEBUG_CODE
void CallRuntime(const Runtime::Function *f, int num_arguments)
void OptimizeCodeOrTailCallOptimizedCodeSlot(Register flags, XMMRegister saved_feedback_vector)
void SmiUntag(Register output, Register value)
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg)
void Drop(int element_count)
void GenerateTailCallToReturnedCode(Runtime::FunctionId function_id)
void AssertFunction(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE
void Cvtsi2ss(XMMRegister dst, Register src)
Operand StackLimitAsOperand(StackLimitKind kind)
void Jump(Handle< Code > code_object, RelocInfo::Mode rmode)
void SmiCompare(Register dst, Operand src)
void AssertFeedbackCell(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE
void CallForDeoptimization(Builtin target, int deopt_id, Label *exit, DeoptimizeKind kind, Label *ret, Label *jump_deoptimization_entry_label)
Operand ExternalReferenceAsOperand(IsolateFieldId id)
void StackOverflowCheck(Register num_args, Register scratch, Label *stack_overflow, bool include_receiver=false)
void AllocateStackSpace(Register bytes)
void LoadEntryFromBuiltinIndex(Register builtin_index, Register target)
void Move(XMMRegister dst, double src)
void JumpIfLessThan(Register a, int32_t b, Label *dest)
void Popcnt(Register dst, Register src)
Operand EntryFromBuiltinAsOperand(Builtin builtin)
void Move(Register dst, Handle< HeapObject > src)
void ShrPair_cl(Register high, Register low)
void PopStackHandler(Register scratch)
void AssertJSAny(Register object, Register map_tmp, AbortReason abort_reason) NOOP_UNLESS_DEBUG_CODE
void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE
void PinsrdPreSse41(XMMRegister dst, Register src, uint8_t imm8, uint32_t *load_pc_offset)
void Cvtsi2sd(XMMRegister dst, Operand src)
void Cvttss2ui(Register dst, Operand src, XMMRegister tmp)
void Cvttsd2ui(Register dst, Operand src, XMMRegister tmp)
void JumpToExternalReference(const ExternalReference &ext, bool builtin_exit_frame=false)
void Move(XMMRegister dst, uint64_t src)
void MaybeRestoreRegisters(RegList registers)
void CallRecordWriteStub(Register object, Register slot_address, SaveFPRegsMode fp_mode, StubCallMode mode=StubCallMode::kCallBuiltinPointer)
void MemoryChunkHeaderFromObject(Register object, Register header)
void AssertUndefinedOrAllocationSite(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE
void Move(Register dst, const Immediate &src)
void Cvtui2ss(XMMRegister dst, Operand src, Register tmp)
void SmiCompare(Register smi1, Register smi2)
void Cvtui2ss(XMMRegister dst, Register src, Register tmp)
void StubPrologue(StackFrame::Type type)
void TestCodeIsMarkedForDeoptimization(Register code)
void StoreRootRelative(int32_t offset, Register value) final
void LoadMap(Register destination, Register object)
Operand ExternalReferenceAddressAsOperand(ExternalReference reference)
void TailCallRuntime(Runtime::FunctionId fid)
void PushReturnAddressFrom(XMMRegister src, Register scratch)
void CallRuntime(Runtime::FunctionId fid, int num_arguments)
void LoadNativeContextSlot(Register dst, int index)
void CompareRoot(Register with, RootIndex index)
Operand HeapObjectAsOperand(Handle< HeapObject > object)
void CallRecordWriteStubSaveRegisters(Register object, Register slot_address, SaveFPRegsMode fp_mode, StubCallMode mode=StubCallMode::kCallBuiltinPointer)
void Lzcnt(Register dst, Operand src)
int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode, Register exclusion=no_reg) const
void DropArguments(Register count)
void Cvttss2ui(Register dst, XMMRegister src, XMMRegister tmp)
DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor)
Operand GetArgumentOperand(int index) const
#define NOOP_UNLESS_DEBUG_CODE
Definition assembler.h:628
DirectHandle< Object > new_target
Definition execution.cc:75
Label label
int32_t offset
TNode< Object > receiver
LiftoffRegister reg
int x
uint32_t const mask
SmiCheck
InvokeType
SetIsolateDataSlots
JumpMode
RegListBase< RegisterT > registers
InstructionOperand destination
constexpr Register no_reg
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
Definition handles-inl.h:72
MemOperand ExitFrameCallerStackSlotOperand(int index)
const int kSmiTagSize
Definition v8-internal.h:87
Operand FieldOperand(Register object, int offset)
constexpr int kSystemPointerSize
Definition globals.h:410
const int kHeapObjectTag
Definition v8-internal.h:72
V8_EXPORT_PRIVATE FlagValues v8_flags
const intptr_t kSmiTagMask
Definition v8-internal.h:88
void CallApiFunctionAndReturn(MacroAssembler *masm, bool with_profiling, Register function_address, ExternalReference thunk_ref, Register thunk_arg, int slots_to_drop_on_return, MemOperand *argc_operand, MemOperand return_value_operand)
const int kSmiTag
Definition v8-internal.h:86
MemOperand ExitFrameStackSlotOperand(int offset)
uint32_t test
#define UNREACHABLE()
Definition logging.h:67
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK_GE(v1, v2)
Definition logging.h:488
#define V8_EXPORT_PRIVATE
Definition macros.h:460