27  return (ptr1 & 
mask) == (ptr2 & 
mask);
 
   38  static Pattern patterns[] = {
 
   42    {3, {0x55, 0x89, 0xE5}, {0, 1, -1}},
 
   45    {2, {0x5D, 0xC2}, {0, 1, -1}},
 
   48    {2, {0x5D, 0xC3}, {0, 1, -1}},
 
   52    {4, {0x55, 0x48, 0x89, 0xE5}, {0, 1, -1}},
 
   55    {2, {0x5D, 0xC2}, {0, 1, -1}},
 
   58    {2, {0x5D, 0xC3}, {0, 1, -1}},
 
   62  uint8_t* 
pc = 
reinterpret_cast<uint8_t*
>(address);
 
   64    for (
int* offset_ptr = 
pattern->offsets; *offset_ptr != -1; ++offset_ptr) {
 
   84#if defined(USE_SIMULATOR) 
   85class SimulatorHelper {
 
   92bool SimulatorHelper::FillRegisters(Isolate* isolate,
 
   94  Simulator* simulator = isolate->thread_local_top()->simulator_;
 
   96  if (simulator == 
nullptr) 
return false;
 
   98  if (!simulator->has_bad_pc()) {
 
   99    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  101  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  102  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::r11));
 
  103  state->lr = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::lr));
 
  104#elif V8_TARGET_ARCH_ARM64 
  105  state->pc = 
reinterpret_cast<void*
>(simulator->pc());
 
  106  state->sp = 
reinterpret_cast<void*
>(simulator->sp());
 
  107  state->fp = 
reinterpret_cast<void*
>(simulator->fp());
 
  108  state->lr = 
reinterpret_cast<void*
>(simulator->lr());
 
  109#elif V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_LOONG64 
  110  if (!simulator->has_bad_pc()) {
 
  111    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  113  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  114  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::fp));
 
  115#elif V8_TARGET_ARCH_PPC64 
  116  if (!simulator->has_bad_pc()) {
 
  117    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  119  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  120  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::fp));
 
  121  state->lr = 
reinterpret_cast<void*
>(simulator->get_lr());
 
  122#elif V8_TARGET_ARCH_S390X 
  123  if (!simulator->has_bad_pc()) {
 
  124    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  126  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  127  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::fp));
 
  128  state->lr = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::ra));
 
  129#elif V8_TARGET_ARCH_RISCV64 
  130  if (!simulator->has_bad_pc()) {
 
  131    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  133  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  134  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::fp));
 
  135  state->lr = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::ra));
 
  136#elif V8_TARGET_ARCH_RISCV32 
  137  if (!simulator->has_bad_pc()) {
 
  138    state->pc = 
reinterpret_cast<void*
>(simulator->get_pc());
 
  140  state->sp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::sp));
 
  141  state->fp = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::fp));
 
  142  state->lr = 
reinterpret_cast<void*
>(simulator->get_register(Simulator::ra));
 
  144  if (state->sp == 0 || state->fp == 0) {
 
  168                                   bool use_simulator_reg_state,
 
  170                                   const std::optional<uint64_t> trace_id) {
 
  174  if (!
GetStackSample(v8_isolate, ®s, record_c_entry_frame, stack,
 
  176                      use_simulator_reg_state)) {
 
  184    state = info.vm_state;
 
  187  frames_count = 
static_cast<unsigned>(info.frames_count);
 
  189  context = info.context;
 
 
  221                                void** frames, 
size_t frames_limit,
 
  224                                bool use_simulator_reg_state) {
 
  227  sample_info->
vm_state = isolate->current_vm_state();
 
  231  sample_info->
context = 
nullptr;
 
  247        reinterpret_cast<void*
>(
embedder_state->native_context_address());
 
  252  if (top_context.
ptr() != i::Context::kNoContext &&
 
  253      top_context.
ptr() != i::Context::kInvalidContext) {
 
  255    sample_info->
context = 
reinterpret_cast<void*
>(top_native_context.
ptr());
 
  258  i::Address js_entry_sp = isolate->js_entry_sp();
 
  259  if (js_entry_sp == 0) 
return true;  
 
  260#if V8_ENABLE_WEBASSEMBLY 
  265  if (stack != 
nullptr && stack->jmpbuf()->parent != 
nullptr) {
 
  266    js_entry_sp = stack->base();
 
  270#if defined(USE_SIMULATOR) 
  271  if (use_simulator_reg_state) {
 
  272    if (!i::SimulatorHelper::FillRegisters(isolate, regs)) {
 
  273      i::ProfilerStats::Instance()->AddReason(
 
  274          i::ProfilerStats::Reason::kSimulatorFillRegistersFailed);
 
  279  USE(use_simulator_reg_state);
 
  288      isolate->heap()->code_region().contains(
 
  290      IsNoFrameRegion(
reinterpret_cast<i::Address>(regs->
pc))) {
 
  292    i::ProfilerStats::Instance()->AddReason(
 
  293        i::ProfilerStats::Reason::kNoFrameRegion);
 
  298  i::Address handler = i::Isolate::handler(isolate->thread_local_top());
 
  306        external_callback_entry_ptr == 
nullptr 
  308            : 
reinterpret_cast<void*
>(*external_callback_entry_ptr);
 
  317  IsolateData* isolate_data = isolate->isolate_data();
 
  334  if (it.done()) 
return true;
 
  338      (it.top_frame_type() == internal::StackFrame::EXIT ||
 
  339       it.top_frame_type() == internal::StackFrame::BUILTIN_EXIT)) {
 
  345    void* c_function = 
reinterpret_cast<void*
>(isolate->c_function());
 
  347      frames[
i] = c_function;
 
  351#ifdef V8_RUNTIME_CALL_STATS 
  352  i::RuntimeCallTimer* timer =
 
  353      isolate->
counters()->runtime_call_stats()->current_timer();
 
  355  for (; !it.done() && 
i < frames_limit; it.Advance()) {
 
  356#ifdef V8_RUNTIME_CALL_STATS 
  357    while (timer && 
reinterpret_cast<i::Address>(timer) < it.frame()->fp() &&
 
  359      frames[
i++] = 
reinterpret_cast<void*
>(timer->counter());
 
  360      timer = timer->parent();
 
  362    if (
i == frames_limit) 
break;
 
  365    if (it.frame()->is_interpreted()) {
 
  374          frame->
fp() + i::InterpreterFrameConstants::kBytecodeArrayFromFp);
 
  376          frame->
fp() + i::InterpreterFrameConstants::kBytecodeOffsetFromFp);
 
  382        frames[
i++] = 
reinterpret_cast<void*
>(
 
  383            bytecode_array + i::Internals::SmiValue(bytecode_offset));
 
  390    frames[
i++] = 
reinterpret_cast<void*
>(it.frame()->unauthenticated_pc());
 
 
  397  PrintF(
"TickSample: at %p\n", 
this);
 
  408  PrintF(
" - sampling_interval: %" PRId64 
"\n",
 
 
#define ASAN_UNPOISON_MEMORY_REGION(start, size)
 
int64_t InMicroseconds() const
 
Address * callback_entrypoint_address()
 
Address JSStackComparableAddress()
 
Address fast_api_call_target() const
 
Address fast_c_call_caller_fp() const
 
V8_INLINE constexpr StorageType ptr() const
 
#define HAS_STRONG_HEAP_OBJECT_TAG(value)
 
#define HAS_SMI_TAG(value)
 
Handle< SharedFunctionInfo > info
 
#define MSAN_MEMORY_IS_INITIALIZED(start, size)
 
constexpr size_t kPageSize
 
void PrintF(const char *format,...)
 
refactor address components for immediate indexing make OptimizeMaglevOnNextCall optimize to turbofan instead of maglev filter for tracing turbofan compilation nullptr
 
static constexpr Address kNullAddress
 
const char * StateToString(StateTag state)
 
#define DCHECK(condition)
 
EmbedderStateTag embedder_state
 
void * external_callback_entry
 
std::optional< uint64_t > trace_id_
 
base::TimeDelta sampling_interval_
 
static constexpr unsigned kMaxFramesCount
 
base::TimeTicks timestamp
 
EmbedderStateTag embedder_state
 
void * external_callback_entry
 
static bool GetStackSample(Isolate *isolate, v8::RegisterState *state, RecordCEntryFrame record_c_entry_frame, void **frames, size_t frames_limit, v8::SampleInfo *sample_info, StateTag *out_state=nullptr, bool use_simulator_reg_state=true)
 
void Init(Isolate *isolate, const v8::RegisterState &state, RecordCEntryFrame record_c_entry_frame, bool update_stats, bool use_simulator_reg_state=true, base::TimeDelta sampling_interval=base::TimeDelta(), const std::optional< uint64_t > trace_id=std::nullopt)
 
bool has_external_callback