a6eeea35cb
Bug: v8:9247 TBR=bmeurer@chromium.org,neis@chromium.org NOPRESUBMIT=true Change-Id: Ia1e49d1aac09c4ff9e05d58fab9d08dd71198878 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621931 Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#61682}
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_WASM_MEMORY_TRACING_H_
|
|
#define V8_WASM_MEMORY_TRACING_H_
|
|
|
|
#include <cstdint>
|
|
|
|
#include "src/codegen/machine-type.h"
|
|
#include "src/wasm/wasm-tier.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
namespace wasm {
|
|
|
|
// This struct is create in generated code, hence use low-level types.
|
|
struct MemoryTracingInfo {
|
|
uint32_t address;
|
|
uint8_t is_store; // 0 or 1
|
|
uint8_t mem_rep;
|
|
static_assert(
|
|
std::is_same<decltype(mem_rep),
|
|
std::underlying_type<MachineRepresentation>::type>::value,
|
|
"MachineRepresentation uses uint8_t");
|
|
|
|
MemoryTracingInfo(uint32_t addr, bool is_store, MachineRepresentation rep)
|
|
: address(addr), is_store(is_store), mem_rep(static_cast<uint8_t>(rep)) {}
|
|
};
|
|
|
|
// Callback for tracing a memory operation for debugging.
|
|
// Triggered by --wasm-trace-memory.
|
|
void TraceMemoryOperation(ExecutionTier, const MemoryTracingInfo* info,
|
|
int func_index, int position, uint8_t* mem_start);
|
|
|
|
} // namespace wasm
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_WASM_MEMORY_TRACING_H_
|