Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ThrowErrorSlowPathCode Class Referenceabstract

#include <flow_graph_compiler.h>

Inheritance diagram for dart::ThrowErrorSlowPathCode:
dart::TemplateSlowPathCode< Instruction > dart::SlowPathCode dart::ZoneAllocated dart::LateInitializationErrorSlowPath dart::NullErrorSlowPath dart::RangeErrorSlowPath dart::WriteErrorSlowPath

Public Member Functions

 ThrowErrorSlowPathCode (Instruction *instruction, const RuntimeEntry &runtime_entry)
 
virtual const char * name ()=0
 
virtual void EmitCodeAtSlowPathEntry (FlowGraphCompiler *compiler)
 
virtual void AddMetadataForRuntimeCall (FlowGraphCompiler *compiler)
 
virtual void PushArgumentsForRuntimeCall (FlowGraphCompiler *compiler)
 
virtual intptr_t GetNumberOfArgumentsForRuntimeCall ()
 
virtual void EmitSharedStubCall (FlowGraphCompiler *compiler, bool save_fpu_registers)
 
virtual void EmitNativeCode (FlowGraphCompiler *compiler)
 
- Public Member Functions inherited from dart::TemplateSlowPathCode< Instruction >
 TemplateSlowPathCode (Instruction *instruction)
 
Instructioninstruction () const
 
- Public Member Functions inherited from dart::SlowPathCode
 SlowPathCode (Instruction *instruction)
 
virtual ~SlowPathCode ()
 
Instructioninstruction () const
 
compiler::Labelentry_label ()
 
compiler::Labelexit_label ()
 
void GenerateCode (FlowGraphCompiler *compiler)
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Detailed Description

Definition at line 215 of file flow_graph_compiler.h.

Constructor & Destructor Documentation

◆ ThrowErrorSlowPathCode()

dart::ThrowErrorSlowPathCode::ThrowErrorSlowPathCode ( Instruction instruction,
const RuntimeEntry runtime_entry 
)
inline

Definition at line 217 of file flow_graph_compiler.h.

219 : TemplateSlowPathCode(instruction), runtime_entry_(runtime_entry) {}

Member Function Documentation

◆ AddMetadataForRuntimeCall()

virtual void dart::ThrowErrorSlowPathCode::AddMetadataForRuntimeCall ( FlowGraphCompiler compiler)
inlinevirtual

Reimplemented in dart::NullErrorSlowPath.

Definition at line 226 of file flow_graph_compiler.h.

226{}

◆ EmitCodeAtSlowPathEntry()

virtual void dart::ThrowErrorSlowPathCode::EmitCodeAtSlowPathEntry ( FlowGraphCompiler compiler)
inlinevirtual

Definition at line 225 of file flow_graph_compiler.h.

225{}

◆ EmitNativeCode()

void dart::ThrowErrorSlowPathCode::EmitNativeCode ( FlowGraphCompiler compiler)
virtual

Implements dart::SlowPathCode.

Definition at line 3091 of file flow_graph_compiler.cc.

3091 {
3093 __ Comment("slow path %s operation", name());
3094 }
3095 const bool use_shared_stub =
3096 instruction()->UseSharedSlowPathStub(compiler->is_optimizing());
3097 ASSERT(use_shared_stub == instruction()->locs()->call_on_shared_slow_path());
3098 const bool live_fpu_registers =
3100 const intptr_t num_args =
3101 use_shared_stub ? 0 : GetNumberOfArgumentsForRuntimeCall();
3102 __ Bind(entry_label());
3104 LocationSummary* locs = instruction()->locs();
3105 const bool has_frame = compiler->flow_graph().graph_entry()->NeedsFrame();
3106 if (use_shared_stub) {
3107 if (!has_frame) {
3108#if !defined(TARGET_ARCH_IA32)
3109 ASSERT(__ constant_pool_allowed());
3110 __ set_constant_pool_allowed(false);
3111#endif
3112 __ EnterDartFrame(0);
3113 }
3114 EmitSharedStubCall(compiler, live_fpu_registers);
3115#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64)
3116 if (!has_frame) {
3117 // Undo EnterDartFrame for the code generated after this slow path.
3118 RESTORES_LR_FROM_FRAME({});
3119 }
3120#endif
3121 } else {
3122 ASSERT(has_frame);
3123 // Save registers as they are needed for lazy deopt / exception handling.
3124 compiler->SaveLiveRegisters(locs);
3126 __ CallRuntime(runtime_entry_, num_args);
3127 }
3128 const intptr_t deopt_id = instruction()->deopt_id();
3129 compiler->AddCurrentDescriptor(UntaggedPcDescriptors::kOther, deopt_id,
3130 instruction()->source());
3132 compiler->RecordSafepoint(locs, num_args);
3133 if (!FLAG_precompiled_mode ||
3134 (compiler->CurrentTryIndex() != kInvalidTryIndex)) {
3135 Environment* env =
3136 compiler->SlowPathEnvironmentFor(instruction(), num_args);
3137 // TODO(47044): Should be able to say `FLAG_precompiled_mode` instead.
3138 if (CompilerState::Current().is_aot()) {
3139 compiler->RecordCatchEntryMoves(env);
3140 } else if (compiler->is_optimizing()) {
3141 ASSERT(env != nullptr);
3142 compiler->AddSlowPathDeoptInfo(deopt_id, env);
3143 } else {
3144 ASSERT(env == nullptr);
3145 const intptr_t deopt_id_after = DeoptId::ToDeoptAfter(deopt_id);
3146 // Add deoptimization continuation point.
3147 compiler->AddCurrentDescriptor(UntaggedPcDescriptors::kDeopt,
3148 deopt_id_after, instruction()->source());
3149 }
3150 }
3151 if (!use_shared_stub) {
3152 __ Breakpoint();
3153 }
3154}
static CompilerState & Current()
static intptr_t ToDeoptAfter(intptr_t deopt_id)
Definition: deopt_id.h:31
virtual bool UseSharedSlowPathStub(bool is_optimizing) const
Definition: il.h:1377
LocationSummary * locs()
Definition: il.h:1192
intptr_t deopt_id() const
Definition: il.h:993
RegisterSet * live_registers()
Definition: locations.h:941
intptr_t FpuRegisterCount() const
Definition: locations.h:809
compiler::Label * entry_label()
virtual void EmitCodeAtSlowPathEntry(FlowGraphCompiler *compiler)
virtual intptr_t GetNumberOfArgumentsForRuntimeCall()
virtual void EmitSharedStubCall(FlowGraphCompiler *compiler, bool save_fpu_registers)
virtual void AddMetadataForRuntimeCall(FlowGraphCompiler *compiler)
virtual void PushArgumentsForRuntimeCall(FlowGraphCompiler *compiler)
virtual const char * name()=0
void static bool EmittingComments()
#define ASSERT(E)
SkBitmap source
Definition: examples.cpp:28
#define __
static constexpr intptr_t kInvalidTryIndex
Definition: __init__.py:1
static bool Bind(PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, const BufferView &view)

◆ EmitSharedStubCall()

virtual void dart::ThrowErrorSlowPathCode::EmitSharedStubCall ( FlowGraphCompiler compiler,
bool  save_fpu_registers 
)
inlinevirtual

Reimplemented in dart::RangeErrorSlowPath, dart::WriteErrorSlowPath, dart::LateInitializationErrorSlowPath, and dart::NullErrorSlowPath.

Definition at line 232 of file flow_graph_compiler.h.

233 {
234 UNREACHABLE();
235 }
#define UNREACHABLE()
Definition: assert.h:248

◆ GetNumberOfArgumentsForRuntimeCall()

virtual intptr_t dart::ThrowErrorSlowPathCode::GetNumberOfArgumentsForRuntimeCall ( )
inlinevirtual

Reimplemented in dart::RangeErrorSlowPath, dart::WriteErrorSlowPath, and dart::LateInitializationErrorSlowPath.

Definition at line 230 of file flow_graph_compiler.h.

230{ return 0; }

◆ name()

virtual const char * dart::ThrowErrorSlowPathCode::name ( )
pure virtual

◆ PushArgumentsForRuntimeCall()

virtual void dart::ThrowErrorSlowPathCode::PushArgumentsForRuntimeCall ( FlowGraphCompiler compiler)
inlinevirtual

The documentation for this class was generated from the following files: