Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 1948 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 1950 of file runtime_entry.cc.

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

Member Function Documentation

◆ ResolveSwitchAndReturn()

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

Definition at line 2551 of file runtime_entry.cc.

2551 {
2552 // Find out actual target (which can be time consuming) without holding any
2553 // locks.
2554 const auto& target_function =
2555 Function::Handle(zone_, ResolveTargetFunction(old_data));
2556
2557 auto& data = Object::Handle(zone_);
2558
2559 // We ensure any transition in a patchable calls are done in an atomic
2560 // manner, we ensure we always transition forward (e.g. Monomorphic ->
2561 // Polymorphic).
2562 //
2563 // Mutators are only stopped if we actually need to patch a patchable call.
2564 // We may not do that if we e.g. just add one more check to an ICData.
2565 SafepointMutexLocker ml(thread_->isolate_group()->patchable_call_mutex());
2566
2567#if defined(DART_PRECOMPILED_RUNTIME)
2568 data =
2569 CodePatcher::GetSwitchableCallDataAt(caller_frame_->pc(), caller_code_);
2570 uword target_entry = 0;
2572 caller_frame_->pc(), caller_code_));
2573 HandleMissAOT(data, target_entry, target_function);
2574#else
2575 auto& code = Code::Handle(zone_);
2576 if (should_consider_patching()) {
2577 code ^= CodePatcher::GetInstanceCallAt(caller_frame_->pc(), caller_code_,
2578 &data);
2579 } else {
2580 ASSERT(old_data.IsICData() || old_data.IsMegamorphicCache());
2581 data = old_data.ptr();
2582 }
2583 HandleMissJIT(data, code, target_function);
2584#endif
2585}
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:514
uword pc() const
Definition stack_frame.h:43
IsolateGroup * isolate_group() const
Definition thread.h:540
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: