Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 3080 of file flow_graph_compiler.cc.

3080 {
3082 __ Comment("slow path %s operation", name());
3083 }
3084 const bool use_shared_stub =
3085 instruction()->UseSharedSlowPathStub(compiler->is_optimizing());
3086 ASSERT(use_shared_stub == instruction()->locs()->call_on_shared_slow_path());
3087 const bool live_fpu_registers =
3089 const intptr_t num_args =
3090 use_shared_stub ? 0 : GetNumberOfArgumentsForRuntimeCall();
3091 __ Bind(entry_label());
3093 LocationSummary* locs = instruction()->locs();
3094 const bool has_frame = compiler->flow_graph().graph_entry()->NeedsFrame();
3095 if (use_shared_stub) {
3096 if (!has_frame) {
3097#if !defined(TARGET_ARCH_IA32)
3098 ASSERT(__ constant_pool_allowed());
3099 __ set_constant_pool_allowed(false);
3100#endif
3101 __ EnterDartFrame(0);
3102 }
3103 EmitSharedStubCall(compiler, live_fpu_registers);
3104#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64)
3105 if (!has_frame) {
3106 // Undo EnterDartFrame for the code generated after this slow path.
3107 RESTORES_LR_FROM_FRAME({});
3108 }
3109#endif
3110 } else {
3111 ASSERT(has_frame);
3112 // Save registers as they are needed for lazy deopt / exception handling.
3113 compiler->SaveLiveRegisters(locs);
3115 __ CallRuntime(runtime_entry_, num_args);
3116 }
3117 const intptr_t deopt_id = instruction()->deopt_id();
3118 compiler->AddCurrentDescriptor(UntaggedPcDescriptors::kOther, deopt_id,
3119 instruction()->source());
3121 compiler->RecordSafepoint(locs, num_args);
3122 if (!FLAG_precompiled_mode ||
3123 (compiler->CurrentTryIndex() != kInvalidTryIndex)) {
3124 Environment* env =
3125 compiler->SlowPathEnvironmentFor(instruction(), num_args);
3126 // TODO(47044): Should be able to say `FLAG_precompiled_mode` instead.
3127 if (CompilerState::Current().is_aot()) {
3128 compiler->RecordCatchEntryMoves(env);
3129 } else if (compiler->is_optimizing()) {
3130 ASSERT(env != nullptr);
3131 compiler->AddSlowPathDeoptInfo(deopt_id, env);
3132 } else {
3133 ASSERT(env == nullptr);
3134 const intptr_t deopt_id_after = DeoptId::ToDeoptAfter(deopt_id);
3135 // Add deoptimization continuation point.
3136 compiler->AddCurrentDescriptor(UntaggedPcDescriptors::kDeopt,
3137 deopt_id_after, instruction()->source());
3138 }
3139 }
3140 if (!use_shared_stub) {
3141 __ Breakpoint();
3142 }
3143}
#define __
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:1371
LocationSummary * locs()
Definition il.h:1186
intptr_t deopt_id() const
Definition il.h:987
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
static constexpr intptr_t kInvalidTryIndex
Definition __init__.py:1

◆ 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: