Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
dart::PatchableCallHandler Class Reference

Public Member Functions

 PatchableCallHandler (Thread *thread, const GrowableArray< const Instance * > &caller_arguments, MissHandler miss_handler, NativeArguments arguments, StackFrame *caller_frame, const Code &caller_code, const Function &caller_function)
 
void ResolveSwitchAndReturn (const Object &data)
 

Detailed Description

Definition at line 1953 of file runtime_entry.cc.

Constructor & Destructor Documentation

◆ PatchableCallHandler()

dart::PatchableCallHandler::PatchableCallHandler ( Thread thread,
const GrowableArray< const Instance * > &  caller_arguments,
MissHandler  miss_handler,
NativeArguments  arguments,
StackFrame caller_frame,
const Code caller_code,
const Function caller_function 
)
inline

Definition at line 1955 of file runtime_entry.cc.

1962 : isolate_(thread->isolate()),
1963 thread_(thread),
1964 zone_(thread->zone()),
1965 caller_arguments_(caller_arguments),
1966 miss_handler_(miss_handler),
1967 arguments_(arguments),
1968 caller_frame_(caller_frame),
1969 caller_code_(caller_code),
1970 caller_function_(caller_function),
1971 name_(String::Handle()),
1972 args_descriptor_(Array::Handle()) {
1973 // We only have two arg IC calls in JIT mode.
1974 ASSERT(caller_arguments_.length() == 1 || !FLAG_precompiled_mode);
1975 }
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)

Member Function Documentation

◆ ResolveSwitchAndReturn()

void dart::PatchableCallHandler::ResolveSwitchAndReturn ( const Object data)

Definition at line 2556 of file runtime_entry.cc.

2556 {
2557 // Find out actual target (which can be time consuming) without holding any
2558 // locks.
2559 const auto& target_function =
2560 Function::Handle(zone_, ResolveTargetFunction(old_data));
2561
2562 auto& data = Object::Handle(zone_);
2563
2564 // We ensure any transition in a patchable calls are done in an atomic
2565 // manner, we ensure we always transition forward (e.g. Monomorphic ->
2566 // Polymorphic).
2567 //
2568 // Mutators are only stopped if we actually need to patch a patchable call.
2569 // We may not do that if we e.g. just add one more check to an ICData.
2570 SafepointMutexLocker ml(thread_->isolate_group()->patchable_call_mutex());
2571
2572#if defined(DART_PRECOMPILED_RUNTIME)
2573 data =
2574 CodePatcher::GetSwitchableCallDataAt(caller_frame_->pc(), caller_code_);
2575 uword target_entry = 0;
2577 caller_frame_->pc(), caller_code_));
2578 HandleMissAOT(data, target_entry, target_function);
2579#else
2580 auto& code = Code::Handle(zone_);
2581 if (should_consider_patching()) {
2582 code ^= CodePatcher::GetInstanceCallAt(caller_frame_->pc(), caller_code_,
2583 &data);
2584 } else {
2585 ASSERT(old_data.IsICData() || old_data.IsMegamorphicCache());
2586 data = old_data.ptr();
2587 }
2588 HandleMissJIT(data, code, target_function);
2589#endif
2590}
static uword GetSwitchableCallTargetEntryAt(uword return_address, const Code &caller_code)
static ObjectPtr GetSwitchableCallDataAt(uword return_address, const Code &caller_code)
static CodePtr GetInstanceCallAt(uword return_address, const Code &caller_code, Object *data)
Mutex * patchable_call_mutex()
Definition: isolate.h:519
uword pc() const
Definition: stack_frame.h:43
IsolateGroup * isolate_group() const
Definition: thread.h:541
uintptr_t uword
Definition: globals.h:501
static int8_t data[kExtLength]
#define DEBUG_ONLY(code)
Definition: globals.h:141

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