// Copyright 2013 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. #include "src/compiler/backend/code-generator.h" #include "src/base/adapters.h" #include "src/codegen/assembler-inl.h" #include "src/codegen/macro-assembler-inl.h" #include "src/codegen/optimized-compilation-info.h" #include "src/codegen/string-constants.h" #include "src/compiler/backend/code-generator-impl.h" #include "src/compiler/linkage.h" #include "src/compiler/pipeline.h" #include "src/compiler/wasm-compiler.h" #include "src/diagnostics/eh-frame.h" #include "src/execution/frames.h" #include "src/logging/counters.h" #include "src/logging/log.h" #include "src/objects/smi.h" #include "src/utils/address-map.h" namespace v8 { namespace internal { namespace compiler { class CodeGenerator::JumpTable final : public ZoneObject { public: JumpTable(JumpTable* next, Label** targets, size_t target_count) : next_(next), targets_(targets), target_count_(target_count) {} Label* label() { return &label_; } JumpTable* next() const { return next_; } Label** targets() const { return targets_; } size_t target_count() const { return target_count_; } private: Label label_; JumpTable* const next_; Label** const targets_; size_t const target_count_; }; CodeGenerator::CodeGenerator( Zone* codegen_zone, Frame* frame, Linkage* linkage, InstructionSequence* instructions, OptimizedCompilationInfo* info, Isolate* isolate, base::Optional osr_helper, int start_source_position, JumpOptimizationInfo* jump_opt, PoisoningMitigationLevel poisoning_level, const AssemblerOptions& options, int32_t builtin_index, size_t max_unoptimized_frame_height, std::unique_ptr buffer) : zone_(codegen_zone), isolate_(isolate), frame_access_state_(nullptr), linkage_(linkage), instructions_(instructions), unwinding_info_writer_(zone()), info_(info), labels_(zone()->NewArray