#include "src/deoptimizer/translated-state.h"
#include <inttypes.h>
#include <iomanip>
#include <optional>
#include "src/base/memory.h"
#include "src/common/assert-scope.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/deoptimizer/materialized-object-store.h"
#include "src/deoptimizer/translation-opcode.h"
#include "src/diagnostics/disasm.h"
#include "src/execution/frames.h"
#include "src/execution/isolate.h"
#include "src/heap/heap.h"
#include "src/numbers/conversions.h"
#include "src/objects/arguments.h"
#include "src/objects/deoptimization-data.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/heap-object.h"
#include "src/objects/oddball.h"
#include "src/objects/object-macros.h"
#include "src/objects/string.h"
namespace v8 {
Memory;
ReadUnalignedValue;
namespace internal {
void DeoptimizationFrameTranslationPrintSingleOpcode(
std::ostream& os, TranslationOpcode opcode,
DeoptimizationFrameTranslation::Iterator& iterator,
Tagged<DeoptimizationLiteralArray> literal_array) { … }
TranslatedValue TranslatedValue::NewDeferredObject(TranslatedState* container,
int length,
int object_index) { … }
TranslatedValue TranslatedValue::NewDuplicateObject(TranslatedState* container,
int id) { … }
TranslatedValue TranslatedValue::NewFloat(TranslatedState* container,
Float32 value) { … }
TranslatedValue TranslatedValue::NewDouble(TranslatedState* container,
Float64 value) { … }
TranslatedValue TranslatedValue::NewHoleyDouble(TranslatedState* container,
Float64 value) { … }
TranslatedValue TranslatedValue::NewSimd128(TranslatedState* container,
Simd128 value) { … }
TranslatedValue TranslatedValue::NewInt32(TranslatedState* container,
int32_t value) { … }
TranslatedValue TranslatedValue::NewInt64(TranslatedState* container,
int64_t value) { … }
TranslatedValue TranslatedValue::NewInt64ToBigInt(TranslatedState* container,
int64_t value) { … }
TranslatedValue TranslatedValue::NewUint64ToBigInt(TranslatedState* container,
uint64_t value) { … }
TranslatedValue TranslatedValue::NewUint32(TranslatedState* container,
uint32_t value) { … }
TranslatedValue TranslatedValue::NewUint64(TranslatedState* container,
uint64_t value) { … }
TranslatedValue TranslatedValue::NewBool(TranslatedState* container,
uint32_t value) { … }
TranslatedValue TranslatedValue::NewTagged(TranslatedState* container,
Tagged<Object> literal) { … }
TranslatedValue TranslatedValue::NewInvalid(TranslatedState* container) { … }
Isolate* TranslatedValue::isolate() const { … }
Tagged<Object> TranslatedValue::raw_literal() const { … }
int32_t TranslatedValue::int32_value() const { … }
int64_t TranslatedValue::int64_value() const { … }
uint64_t TranslatedValue::uint64_value() const { … }
uint32_t TranslatedValue::uint32_value() const { … }
Float32 TranslatedValue::float_value() const { … }
Float64 TranslatedValue::double_value() const { … }
Simd128 TranslatedValue::simd_value() const { … }
int TranslatedValue::object_length() const { … }
int TranslatedValue::object_index() const { … }
Tagged<Object> TranslatedValue::GetRawValue() const { … }
void TranslatedValue::set_initialized_storage(Handle<HeapObject> storage) { … }
Handle<Object> TranslatedValue::GetValue() { … }
bool TranslatedValue::IsMaterializedObject() const { … }
bool TranslatedValue::IsMaterializableByDebugger() const { … }
int TranslatedValue::GetChildrenCount() const { … }
uint64_t TranslatedState::GetUInt64Slot(Address fp, int slot_offset) { … }
uint32_t TranslatedState::GetUInt32Slot(Address fp, int slot_offset) { … }
Float32 TranslatedState::GetFloatSlot(Address fp, int slot_offset) { … }
Float64 TranslatedState::GetDoubleSlot(Address fp, int slot_offset) { … }
Simd128 TranslatedState::getSimd128Slot(Address fp, int slot_offset) { … }
void TranslatedValue::Handlify() { … }
TranslatedFrame TranslatedFrame::UnoptimizedFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height, int return_value_offset, int return_value_count) { … }
TranslatedFrame TranslatedFrame::InlinedExtraArguments(
Tagged<SharedFunctionInfo> shared_info, int height) { … }
TranslatedFrame TranslatedFrame::ConstructCreateStubFrame(
Tagged<SharedFunctionInfo> shared_info, int height) { … }
TranslatedFrame TranslatedFrame::ConstructInvokeStubFrame(
Tagged<SharedFunctionInfo> shared_info) { … }
TranslatedFrame TranslatedFrame::BuiltinContinuationFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height) { … }
#if V8_ENABLE_WEBASSEMBLY
TranslatedFrame TranslatedFrame::WasmInlinedIntoJSFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height) { … }
TranslatedFrame TranslatedFrame::JSToWasmBuiltinContinuationFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height, std::optional<wasm::ValueKind> return_kind) { … }
TranslatedFrame TranslatedFrame::LiftoffFrame(BytecodeOffset bytecode_offset,
int height, int function_index) { … }
#endif
TranslatedFrame TranslatedFrame::JavaScriptBuiltinContinuationFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height) { … }
TranslatedFrame TranslatedFrame::JavaScriptBuiltinContinuationWithCatchFrame(
BytecodeOffset bytecode_offset, Tagged<SharedFunctionInfo> shared_info,
int height) { … }
int TranslatedFrame::GetValueCount() const { … }
void TranslatedFrame::Handlify(Isolate* isolate) { … }
DeoptimizationLiteralProvider::DeoptimizationLiteralProvider(
Tagged<DeoptimizationLiteralArray> literal_array)
: … { … }
DeoptimizationLiteralProvider::DeoptimizationLiteralProvider(
std::vector<DeoptimizationLiteral> literals)
: … { … }
DeoptimizationLiteralProvider::~DeoptimizationLiteralProvider() = default;
TranslatedValue DeoptimizationLiteralProvider::Get(TranslatedState* container,
int literal_index) const { … }
TranslatedFrame TranslatedState::CreateNextTranslatedFrame(
DeoptTranslationIterator* iterator,
const DeoptimizationLiteralProvider& literal_array, Address fp,
FILE* trace_file) { … }
void TranslatedFrame::AdvanceIterator(
std::deque<TranslatedValue>::iterator* iter) { … }
void TranslatedState::CreateArgumentsElementsTranslatedValues(
int frame_index, Address input_frame_pointer, CreateArgumentsType type,
FILE* trace_file) { … }
int TranslatedState::CreateNextTranslatedValue(
int frame_index, DeoptTranslationIterator* iterator,
const DeoptimizationLiteralProvider& literal_array, Address fp,
RegisterValues* registers, FILE* trace_file) { … }
Address TranslatedState::DecompressIfNeeded(intptr_t value) { … }
TranslatedState::TranslatedState(const JavaScriptFrame* frame)
: … { … }
void TranslatedState::Init(Isolate* isolate, Address input_frame_pointer,
Address stack_frame_pointer,
DeoptTranslationIterator* iterator,
const DeoptimizationLiteralProvider& literal_array,
RegisterValues* registers, FILE* trace_file,
int formal_parameter_count,
int actual_argument_count) { … }
void TranslatedState::Prepare(Address stack_frame_pointer) { … }
TranslatedValue* TranslatedState::GetValueByObjectIndex(int object_index) { … }
Handle<HeapObject> TranslatedState::InitializeObjectAt(TranslatedValue* slot) { … }
void TranslatedState::InitializeCapturedObjectAt(
int object_index, std::stack<int>* worklist,
const DisallowGarbageCollection& no_gc) { … }
void TranslatedState::EnsureObjectAllocatedAt(TranslatedValue* slot) { … }
int TranslatedValue::GetSmiValue() const { … }
void TranslatedState::MaterializeFixedDoubleArray(TranslatedFrame* frame,
int* value_index,
TranslatedValue* slot,
DirectHandle<Map> map) { … }
void TranslatedState::MaterializeHeapNumber(TranslatedFrame* frame,
int* value_index,
TranslatedValue* slot) { … }
namespace {
enum StorageKind : uint8_t { … };
}
void TranslatedState::SkipSlots(int slots_to_skip, TranslatedFrame* frame,
int* value_index) { … }
void TranslatedState::EnsureCapturedObjectAllocatedAt(
int object_index, std::stack<int>* worklist) { … }
void TranslatedValue::ReplaceElementsArrayWithCopy() { … }
void TranslatedState::EnsureChildrenAllocated(int count, TranslatedFrame* frame,
int* value_index,
std::stack<int>* worklist) { … }
void TranslatedState::EnsurePropertiesAllocatedAndMarked(
TranslatedValue* properties_slot, DirectHandle<Map> map) { … }
Handle<ByteArray> TranslatedState::AllocateStorageFor(TranslatedValue* slot) { … }
void TranslatedState::EnsureJSObjectAllocated(TranslatedValue* slot,
DirectHandle<Map> map) { … }
TranslatedValue* TranslatedState::GetResolvedSlot(TranslatedFrame* frame,
int value_index) { … }
TranslatedValue* TranslatedState::GetResolvedSlotAndAdvance(
TranslatedFrame* frame, int* value_index) { … }
Handle<Object> TranslatedState::GetValueAndAdvance(TranslatedFrame* frame,
int* value_index) { … }
void TranslatedState::InitializeJSObjectAt(
TranslatedFrame* frame, int* value_index, TranslatedValue* slot,
DirectHandle<Map> map, const DisallowGarbageCollection& no_gc) { … }
void TranslatedState::InitializeObjectWithTaggedFieldsAt(
TranslatedFrame* frame, int* value_index, TranslatedValue* slot,
DirectHandle<Map> map, const DisallowGarbageCollection& no_gc) { … }
TranslatedValue* TranslatedState::ResolveCapturedObject(TranslatedValue* slot) { … }
TranslatedFrame* TranslatedState::GetFrameFromJSFrameIndex(int jsframe_index) { … }
TranslatedFrame* TranslatedState::GetArgumentsInfoFromJSFrameIndex(
int jsframe_index, int* args_count) { … }
void TranslatedState::StoreMaterializedValuesAndDeopt(JavaScriptFrame* frame) { … }
void TranslatedState::UpdateFromPreviouslyMaterializedObjects() { … }
void TranslatedState::VerifyMaterializedObjects() { … }
bool TranslatedState::DoUpdateFeedback() { … }
void TranslatedState::ReadUpdateFeedback(
DeoptTranslationIterator* iterator,
Tagged<DeoptimizationLiteralArray> literal_array, FILE* trace_file) { … }
}
}
#include "src/objects/object-macros-undef.h"