fastboot review

Signed-off-by: surpassgoodchao <surpassgoodchao@qq.com>
This commit is contained in:
surpassgoodchao 2021-10-12 12:26:02 +08:00
parent 8724269cb9
commit d15fafc5ac
21 changed files with 104 additions and 99 deletions

View File

@ -192,7 +192,7 @@ CString ErrorHelper::BuildNativeEcmaStackTrace(JSThread *thread)
{ {
auto ecmaVm = thread->GetEcmaVM(); auto ecmaVm = thread->GetEcmaVM();
CString data; CString data;
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {
continue; continue;

View File

@ -1134,10 +1134,9 @@ void DoSafepoint()
if (found) { if (found) {
for (auto &info : infos) { for (auto &info : infos) {
uintptr_t **address = nullptr; uintptr_t **address = nullptr;
if (info.first == 7) { // 7: x86_64 dwarf register num, representing rsp if (info.first == SP_DWARF_REG_NUM) {
address = reinterpret_cast<uintptr_t **>(reinterpret_cast<uint8_t *>(rsp) + info.second); address = reinterpret_cast<uintptr_t **>(reinterpret_cast<uint8_t *>(rsp) + info.second);
// rbp } else if (info.first == FP_DWARF_REG_NUM) {
} else if (info.first == 6) { // 6: x86_64 dwarf register num, representing rbp
address = reinterpret_cast<uintptr_t **>(reinterpret_cast<uint8_t *>(rbp) + info.second); address = reinterpret_cast<uintptr_t **>(reinterpret_cast<uint8_t *>(rbp) + info.second);
} }
std::cout << std::hex << "ref addr:" << address; std::cout << std::hex << "ref addr:" << address;

View File

@ -552,7 +552,7 @@ void JSTaggedValue::DumpVal(JSThread *thread, JSTaggedType val)
void JSThread::DumpStack() void JSThread::DumpStack()
{ {
EcmaFrameHandler handler(this); InterpretedFrameHandler handler(this);
handler.DumpStack(std::cout); handler.DumpStack(std::cout);
} }

View File

@ -25,7 +25,7 @@
#include "include/tooling/pt_lang_extension.h" #include "include/tooling/pt_lang_extension.h"
namespace panda { namespace panda {
using ecmascript::EcmaFrameHandler; using ecmascript::InterpretedFrameHandler;
using ecmascript::EcmaVM; using ecmascript::EcmaVM;
using ecmascript::JSThread; using ecmascript::JSThread;
@ -34,7 +34,7 @@ std::pair<Method *, uint32_t> EcmaLanguageContext::GetCatchMethodAndOffset(Metho
Method *catchMethod = method; Method *catchMethod = method;
uint32_t catchOffset = 0; uint32_t catchOffset = 0;
auto jsThread = static_cast<JSThread *>(thread); auto jsThread = static_cast<JSThread *>(thread);
EcmaFrameHandler frameHandler(jsThread); InterpretedFrameHandler frameHandler(jsThread);
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {
continue; continue;

View File

@ -118,12 +118,17 @@
// or Optimized EntryFrame/Optimized Frame. // or Optimized EntryFrame/Optimized Frame.
// **nop** represent don't call SAVE or UPDATE, **illegal** represent this secnarios don't existed. // **nop** represent don't call SAVE or UPDATE, **illegal** represent this secnarios don't existed.
// ``` // +----------------------------------------------------------------------+
// iframe OptimizedEntry Optimized RunTime // | | iframe | OptimizedEntry | Optimized | RunTime |
// iframe SAVE/UPATE SAVE illegal SAVE/UPATE // |-----------------------------------------------------------------------
// OptimizedEntry UPATE illegal nop UPATE // |iframe | SAVE/UPATE | SAVE | illegal | SAVE/UPATE |
// Optimized UPATE illegal nop UPATE // |-----------------------------------------------------------------------
// RunTime nop illegal illegal nop // |OptimizedEntry | UPATE | illegal | nop | UPATE |
// |-----------------------------------------------------------------------
// |Optimized | UPATE | illegal | nop | UPATE |
// |-----------------------------------------------------------------------
// |RunTime | nop | illegal | illegal | nop |
// +----------------------------------------------------------------------+
// ``` // ```
// Iterator Frame from Runtime Frame, the process is as flollows: // Iterator Frame from Runtime Frame, the process is as flollows:
@ -231,22 +236,22 @@ auto as_integer(Enumeration const value)
return static_cast<typename std::underlying_type<Enumeration>::type>(value); return static_cast<typename std::underlying_type<Enumeration>::type>(value);
} }
class OptFrameStateBase { class OptimizedFrameStateBase {
public: public:
FrameType frameType; FrameType frameType;
uint64_t *prev; // for llvm :c-fp ; for interrupt: thread-fp for gc uint64_t *prev; // for llvm :c-fp ; for interrupt: thread-fp for gc
}; };
class InterPretFrameStateBase { class InterpretedFrameStateBase {
public: public:
uint64_t *prev; // for llvm :c-fp ; for interrupt: thread-fp for gc uint64_t *prev; // for llvm :c-fp ; for interrupt: thread-fp for gc
FrameType frameType; FrameType frameType;
}; };
class LLVMOptimizedEntryFrameState { class OptimizedEntryFrameState {
public: public:
uint64_t *threadFp; // for gc uint64_t *threadFp; // for gc
OptFrameStateBase base; OptimizedFrameStateBase base;
}; };
constexpr int kSystemPointerSize = sizeof(void*); constexpr int kSystemPointerSize = sizeof(void*);

View File

@ -36,7 +36,7 @@ public:
static inline FunctionCache *GetCurrent(JSThread *thread) static inline FunctionCache *GetCurrent(JSThread *thread)
{ {
JSTaggedValue funcValue = EcmaFrameHandler(thread).GetFunction(); JSTaggedValue funcValue = InterpretedFrameHandler(thread).GetFunction();
JSFunction *func = JSFunction::Cast(funcValue.GetTaggedObject()); JSFunction *func = JSFunction::Cast(funcValue.GetTaggedObject());
return FunctionCache::Cast(func->GetFunctionCache().GetTaggedObject()); return FunctionCache::Cast(func->GetFunctionCache().GetTaggedObject());
} }

View File

@ -23,18 +23,18 @@
#include "ecmascript/compiler/llvm/llvm_stackmap_parser.h" #include "ecmascript/compiler/llvm/llvm_stackmap_parser.h"
namespace panda::ecmascript { namespace panda::ecmascript {
EcmaFrameHandler::EcmaFrameHandler(const JSThread *thread) InterpretedFrameHandler::InterpretedFrameHandler(const JSThread *thread)
{ {
sp_ = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame()); sp_ = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame());
} }
bool EcmaFrameHandler::HasFrame() const bool InterpretedFrameHandler::HasFrame() const
{ {
// Breakframe also is a frame // Breakframe also is a frame
return sp_ != nullptr; return sp_ != nullptr;
} }
bool EcmaFrameHandler::IsBreakFrame() const bool InterpretedFrameHandler::IsBreakFrame() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -42,7 +42,7 @@ bool EcmaFrameHandler::IsBreakFrame() const
return state->sp == nullptr; return state->sp == nullptr;
} }
void EcmaFrameHandler::PrevFrame() void InterpretedFrameHandler::PrevFrame()
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -50,29 +50,29 @@ void EcmaFrameHandler::PrevFrame()
sp_ = state->base.prev; sp_ = state->base.prev;
} }
EcmaFrameHandler EcmaFrameHandler::GetPrevFrame() const InterpretedFrameHandler InterpretedFrameHandler::GetPrevFrame() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1;
return EcmaFrameHandler(state->base.prev); return InterpretedFrameHandler(state->base.prev);
} }
JSTaggedValue EcmaFrameHandler::GetVRegValue(size_t index) const JSTaggedValue InterpretedFrameHandler::GetVRegValue(size_t index) const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
return JSTaggedValue(sp_[index]); return JSTaggedValue(sp_[index]);
} }
void EcmaFrameHandler::SetVRegValue(size_t index, JSTaggedValue value) void InterpretedFrameHandler::SetVRegValue(size_t index, JSTaggedValue value)
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
sp_[index] = value.GetRawData(); sp_[index] = value.GetRawData();
} }
JSTaggedValue EcmaFrameHandler::GetAcc() const JSTaggedValue InterpretedFrameHandler::GetAcc() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -80,7 +80,7 @@ JSTaggedValue EcmaFrameHandler::GetAcc() const
return state->acc; return state->acc;
} }
uint32_t EcmaFrameHandler::GetSize() const uint32_t InterpretedFrameHandler::GetSize() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -91,7 +91,7 @@ uint32_t EcmaFrameHandler::GetSize() const
return static_cast<uint32_t>(size); return static_cast<uint32_t>(size);
} }
uint32_t EcmaFrameHandler::GetBytecodeOffset() const uint32_t InterpretedFrameHandler::GetBytecodeOffset() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -101,7 +101,7 @@ uint32_t EcmaFrameHandler::GetBytecodeOffset() const
return static_cast<uint32_t>(offset); return static_cast<uint32_t>(offset);
} }
JSMethod *EcmaFrameHandler::GetMethod() const JSMethod *InterpretedFrameHandler::GetMethod() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -109,7 +109,7 @@ JSMethod *EcmaFrameHandler::GetMethod() const
return state->method; return state->method;
} }
JSTaggedValue EcmaFrameHandler::GetFunction() const JSTaggedValue InterpretedFrameHandler::GetFunction() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -120,7 +120,7 @@ JSTaggedValue EcmaFrameHandler::GetFunction() const
return func; return func;
} }
const uint8_t *EcmaFrameHandler::GetPc() const const uint8_t *InterpretedFrameHandler::GetPc() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -128,7 +128,7 @@ const uint8_t *EcmaFrameHandler::GetPc() const
return state->pc; return state->pc;
} }
JSTaggedType *EcmaFrameHandler::GetSp() const JSTaggedType *InterpretedFrameHandler::GetSp() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -136,7 +136,7 @@ JSTaggedType *EcmaFrameHandler::GetSp() const
return state->sp; return state->sp;
} }
ConstantPool *EcmaFrameHandler::GetConstpool() const ConstantPool *InterpretedFrameHandler::GetConstpool() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -144,7 +144,7 @@ ConstantPool *EcmaFrameHandler::GetConstpool() const
return state->constpool; return state->constpool;
} }
JSTaggedValue EcmaFrameHandler::GetEnv() const JSTaggedValue InterpretedFrameHandler::GetEnv() const
{ {
ASSERT(HasFrame()); ASSERT(HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
@ -152,7 +152,7 @@ JSTaggedValue EcmaFrameHandler::GetEnv() const
return state->env; return state->env;
} }
void EcmaFrameHandler::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1) void InterpretedFrameHandler::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1)
{ {
JSTaggedType *current = sp_; JSTaggedType *current = sp_;
if (current != nullptr) { if (current != nullptr) {
@ -176,10 +176,10 @@ void EcmaFrameHandler::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1
} }
} }
void EcmaFrameHandler::DumpStack(std::ostream &os) const void InterpretedFrameHandler::DumpStack(std::ostream &os) const
{ {
size_t i = 0; size_t i = 0;
EcmaFrameHandler frameHandler(sp_); InterpretedFrameHandler frameHandler(sp_);
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
os << "[" << i++ os << "[" << i++
<< "]:" << frameHandler.GetMethod()->ParseFunctionName() << "]:" << frameHandler.GetMethod()->ParseFunctionName()
@ -187,9 +187,9 @@ void EcmaFrameHandler::DumpStack(std::ostream &os) const
} }
} }
void EcmaFrameHandler::DumpPC(std::ostream &os, const uint8_t *pc) const void InterpretedFrameHandler::DumpPC(std::ostream &os, const uint8_t *pc) const
{ {
EcmaFrameHandler frameHandler(sp_); InterpretedFrameHandler frameHandler(sp_);
ASSERT(frameHandler.HasFrame()); ASSERT(frameHandler.HasFrame());
// NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions, bugprone-narrowing-conversions) // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions, bugprone-narrowing-conversions)
@ -245,18 +245,19 @@ void FrameIterator::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1) c
reinterpret_cast<long long>(current) + FrameConst::kFrameType)); reinterpret_cast<long long>(current) + FrameConst::kFrameType));
if (type == FrameType::INTERPRETER_FRAME) { if (type == FrameType::INTERPRETER_FRAME) {
FrameState *state = reinterpret_cast<FrameState *>(current) - 1; FrameState *state = reinterpret_cast<FrameState *>(current) - 1;
EcmaFrameHandler(current).Iterate(v0, v1); InterpretedFrameHandler(current).Iterate(v0, v1);
current = state->base.prev; current = state->base.prev;
} else if (type == FrameType::OPTIMIZED_FRAME) { } else if (type == FrameType::OPTIMIZED_FRAME) {
OptFrameStateBase *state = reinterpret_cast<OptFrameStateBase *>( OptimizedFrameStateBase *state = reinterpret_cast<OptimizedFrameStateBase *>(
reinterpret_cast<long long>(current) - reinterpret_cast<long long>(current) -
MEMBER_OFFSET(OptFrameStateBase, prev)); MEMBER_OFFSET(OptimizedFrameStateBase, prev));
OptimizedFrameHandler(current).Iterate(v0, v1); OptimizedFrameHandler(current).Iterate(v0, v1);
current = reinterpret_cast<JSTaggedType *>(state->prev); current = reinterpret_cast<JSTaggedType *>(state->prev);
} else { } else {
LLVMOptimizedEntryFrameState *state = reinterpret_cast<LLVMOptimizedEntryFrameState *>( ASSERT(type == FrameType::OPTIMIZED_ENTRY_FRAME);
OptimizedEntryFrameState *state = reinterpret_cast<OptimizedEntryFrameState *>(
reinterpret_cast<long long>(current) - reinterpret_cast<long long>(current) -
MEMBER_OFFSET(LLVMOptimizedEntryFrameState, base.prev)); MEMBER_OFFSET(OptimizedEntryFrameState, base.prev));
OptimizedEntryFrameHandler(current).Iterate(v0, v1); OptimizedEntryFrameHandler(current).Iterate(v0, v1);
current = reinterpret_cast<JSTaggedType *>(state->threadFp); current = reinterpret_cast<JSTaggedType *>(state->threadFp);
} }

View File

@ -26,18 +26,18 @@ class JSThread;
class JSFunction; class JSFunction;
class ConstantPool; class ConstantPool;
class EcmaFrameHandler { class InterpretedFrameHandler {
public: public:
explicit EcmaFrameHandler(JSTaggedType *sp) : sp_(sp) {} explicit InterpretedFrameHandler(JSTaggedType *sp) : sp_(sp) {}
explicit EcmaFrameHandler(const JSThread *thread); explicit InterpretedFrameHandler(const JSThread *thread);
~EcmaFrameHandler() = default; ~InterpretedFrameHandler() = default;
DEFAULT_COPY_SEMANTIC(EcmaFrameHandler); DEFAULT_COPY_SEMANTIC(InterpretedFrameHandler);
DEFAULT_MOVE_SEMANTIC(EcmaFrameHandler); DEFAULT_MOVE_SEMANTIC(InterpretedFrameHandler);
bool HasFrame() const; bool HasFrame() const;
bool IsBreakFrame() const; bool IsBreakFrame() const;
void PrevFrame(); void PrevFrame();
EcmaFrameHandler GetPrevFrame() const; InterpretedFrameHandler GetPrevFrame() const;
JSTaggedValue GetVRegValue(size_t index) const; JSTaggedValue GetVRegValue(size_t index) const;
void SetVRegValue(size_t index, JSTaggedValue value); void SetVRegValue(size_t index, JSTaggedValue value);

View File

@ -229,7 +229,7 @@ JSTaggedValue EcmaInterpreter::ExecuteNative(JSThread *thread, const CallParams&
FrameState *state = GET_FRAME(newSp); FrameState *state = GET_FRAME(newSp);
state->base.prev = sp; state->base.prev = sp;
state->base.frameType = ecmascript::FrameType::INTERPRETER_FRAME; state->base.frameType = FrameType::INTERPRETER_FRAME;
state->pc = nullptr; state->pc = nullptr;
state->sp = newSp; state->sp = newSp;
state->method = methodToCall; state->method = methodToCall;
@ -450,7 +450,7 @@ void EcmaInterpreter::ResumeContext(JSThread *thread)
void EcmaInterpreter::NotifyBytecodePcChanged(JSThread *thread) void EcmaInterpreter::NotifyBytecodePcChanged(JSThread *thread)
{ {
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {
continue; continue;
@ -3183,7 +3183,7 @@ NO_UB_SANITIZE void EcmaInterpreter::RunInternal(JSThread *thread, ConstantPool
HANDLE_OPCODE(EXCEPTION_HANDLER) { HANDLE_OPCODE(EXCEPTION_HANDLER) {
auto exception = thread->GetException(); auto exception = thread->GetException();
EcmaFrameHandler frameHandler(sp); InterpretedFrameHandler frameHandler(sp);
uint32_t pcOffset = panda_file::INVALID_OFFSET; uint32_t pcOffset = panda_file::INVALID_OFFSET;
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {

View File

@ -40,7 +40,7 @@ struct FrameState {
JSTaggedValue acc; JSTaggedValue acc;
JSTaggedValue env; JSTaggedValue env;
uint64_t numActualArgs; uint64_t numActualArgs;
InterPretFrameStateBase base; InterpretedFrameStateBase base;
}; };
// NOLINTNEXTLINE(bugprone-sizeof-expression) // NOLINTNEXTLINE(bugprone-sizeof-expression)

View File

@ -82,7 +82,7 @@ JSTaggedValue SlowRuntimeHelper::NewObject(JSThread *thread, JSHandle<JSTaggedVa
void SlowRuntimeHelper::SaveFrameToContext(JSThread *thread, JSHandle<GeneratorContext> context) void SlowRuntimeHelper::SaveFrameToContext(JSThread *thread, JSHandle<GeneratorContext> context)
{ {
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
uint32_t nregs = frameHandler.GetSize(); uint32_t nregs = frameHandler.GetSize();
JSHandle<TaggedArray> regsArray = factory->NewTaggedArray(nregs); JSHandle<TaggedArray> regsArray = factory->NewTaggedArray(nregs);
@ -122,7 +122,7 @@ JSTaggedValue ConstructGeneric(JSThread *thread, JSHandle<JSFunction> ctor, JSHa
} }
// Add the input parameter // Add the input parameter
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
CallParams params; CallParams params;
params.callTarget = ECMAObject::Cast(*ctor); params.callTarget = ECMAObject::Cast(*ctor);
params.newTarget = newTgt.GetTaggedType(); params.newTarget = newTgt.GetTaggedType();
@ -221,7 +221,7 @@ JSTaggedValue ConstructProxy(JSThread *thread, JSHandle<JSProxy> ctor, JSHandle<
args->Set(thread, i, value); args->Set(thread, i, value);
} }
} }
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
for (array_size_t i = 0; i < argsCount; ++i) { for (array_size_t i = 0; i < argsCount; ++i) {
JSTaggedValue value = frameHandler.GetVRegValue(baseArgLocation + i); JSTaggedValue value = frameHandler.GetVRegValue(baseArgLocation + i);
args->Set(thread, i + preArgsSize, value); args->Set(thread, i + preArgsSize, value);

View File

@ -439,7 +439,7 @@ JSTaggedValue SlowRuntimeStub::CreateObjectWithExcludedKeys(JSThread *thread, ui
JSHandle<JSObject> obj(thread, objVal); JSHandle<JSObject> obj(thread, objVal);
array_size_t numExcludedKeys = 0; array_size_t numExcludedKeys = 0;
JSHandle<TaggedArray> excludedKeys = factory->NewTaggedArray(numKeys + 1); JSHandle<TaggedArray> excludedKeys = factory->NewTaggedArray(numKeys + 1);
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
JSTaggedValue excludedKey = frameHandler.GetVRegValue(firstArgRegIdx); JSTaggedValue excludedKey = frameHandler.GetVRegValue(firstArgRegIdx);
if (!excludedKey.IsUndefined()) { if (!excludedKey.IsUndefined()) {
numExcludedKeys = numKeys + 1; numExcludedKeys = numKeys + 1;
@ -1716,7 +1716,7 @@ JSTaggedValue SlowRuntimeStub::SuperCall(JSThread *thread, JSTaggedValue func, J
INTERPRETER_TRACE(thread, SuperCall); INTERPRETER_TRACE(thread, SuperCall);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
JSHandle<JSTaggedValue> funcHandle(thread, func); JSHandle<JSTaggedValue> funcHandle(thread, func);
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);
@ -1741,7 +1741,7 @@ JSTaggedValue SlowRuntimeStub::SuperCallSpread(JSThread *thread, JSTaggedValue f
{ {
INTERPRETER_TRACE(thread, SuperCallSpread); INTERPRETER_TRACE(thread, SuperCallSpread);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
EcmaFrameHandler frameHandler(thread); InterpretedFrameHandler frameHandler(thread);
JSHandle<JSTaggedValue> funcHandle(thread, func); JSHandle<JSTaggedValue> funcHandle(thread, func);
JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget);

View File

@ -78,7 +78,7 @@ void JSThread::ClearException()
JSTaggedValue JSThread::GetCurrentLexenv() const JSTaggedValue JSThread::GetCurrentLexenv() const
{ {
return EcmaFrameHandler(currentFrame_).GetEnv(); return InterpretedFrameHandler(currentFrame_).GetEnv();
} }
void JSThread::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1) void JSThread::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1)

View File

@ -2088,7 +2088,7 @@ JSHandle<JSObject> ObjectFactory::NewEmptyJSObject()
EcmaString *ObjectFactory::ResolveString(uint32_t stringId) EcmaString *ObjectFactory::ResolveString(uint32_t stringId)
{ {
JSMethod *caller = EcmaFrameHandler(thread_).GetMethod(); JSMethod *caller = InterpretedFrameHandler(thread_).GetMethod();
auto *pf = caller->GetPandaFile(); auto *pf = caller->GetPandaFile();
auto id = panda_file::File::EntityId(stringId); auto id = panda_file::File::EntityId(stringId);
auto foundStr = pf->GetStringData(id); auto foundStr = pf->GetStringData(id);

View File

@ -30,7 +30,7 @@ bool RuntimeTrampolines::AddElementInternal(uint64_t argThread, uint64_t argRece
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
JSHandle<JSObject> receiver(thread, reinterpret_cast<TaggedObject *>(argReceiver)); JSHandle<JSObject> receiver(thread, reinterpret_cast<TaggedObject *>(argReceiver));
JSHandle<JSTaggedValue> value(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argValue))); JSHandle<JSTaggedValue> value(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argValue)));
@ -44,7 +44,7 @@ bool RuntimeTrampolines::CallSetter(uint64_t argThread, uint64_t argSetter, uint
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
JSHandle<JSTaggedValue> receiver(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver))); JSHandle<JSTaggedValue> receiver(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver)));
JSHandle<JSTaggedValue> value(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argValue))); JSHandle<JSTaggedValue> value(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argValue)));
@ -57,7 +57,7 @@ void RuntimeTrampolines::ThrowTypeError(uint64_t argThread, int argMessageString
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
std::string message = MessageString::GetMessageString(argMessageStringId); std::string message = MessageString::GetMessageString(argMessageStringId);
ObjectFactory *factory = JSThread::Cast(thread)->GetEcmaVM()->GetFactory(); ObjectFactory *factory = JSThread::Cast(thread)->GetEcmaVM()->GetFactory();
@ -71,7 +71,7 @@ bool RuntimeTrampolines::JSProxySetProperty(uint64_t argThread, uint64_t argProx
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
[[maybe_unused]] EcmaHandleScope handleScope(thread); [[maybe_unused]] EcmaHandleScope handleScope(thread);
JSHandle<JSProxy> proxy(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argProxy))); JSHandle<JSProxy> proxy(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argProxy)));
JSHandle<JSTaggedValue> index(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argKey))); JSHandle<JSTaggedValue> index(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argKey)));
@ -92,7 +92,7 @@ uint64_t RuntimeTrampolines::CallGetter(uint64_t argThread, uint64_t argGetter,
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
auto accessor = AccessorData::Cast(reinterpret_cast<TaggedObject *>(argGetter)); auto accessor = AccessorData::Cast(reinterpret_cast<TaggedObject *>(argGetter));
JSHandle<JSTaggedValue> objHandle(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver))); JSHandle<JSTaggedValue> objHandle(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver)));
return JSObject::CallGetter(thread, accessor, objHandle).GetRawData(); return JSObject::CallGetter(thread, accessor, objHandle).GetRawData();
@ -103,7 +103,7 @@ uint64_t RuntimeTrampolines::AccessorGetter(uint64_t argThread, uint64_t argGett
JSTaggedType *fp = nullptr; JSTaggedType *fp = nullptr;
GET_CURRETN_FP(fp); GET_CURRETN_FP(fp);
auto thread = reinterpret_cast<JSThread *>(argThread); auto thread = reinterpret_cast<JSThread *>(argThread);
StubCallRunTimeThreadFpScope(thread, fp); CallRuntimeTrampolinesScope scope(thread, fp);
auto accessor = AccessorData::Cast(reinterpret_cast<TaggedObject *>(argGetter)); auto accessor = AccessorData::Cast(reinterpret_cast<TaggedObject *>(argGetter));
JSHandle<JSObject> objHandle(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver))); JSHandle<JSObject> objHandle(thread, JSTaggedValue(reinterpret_cast<TaggedObject *>(argReceiver)));
return accessor->CallInternalGet(thread, objHandle).GetRawData(); return accessor->CallInternalGet(thread, objHandle).GetRawData();

View File

@ -50,23 +50,23 @@ public:
static uint32_t StringGetHashCode(uint64_t ecmaString); static uint32_t StringGetHashCode(uint64_t ecmaString);
}; };
class StubCallRunTimeThreadFpScope { class CallRuntimeTrampolinesScope {
public: public:
StubCallRunTimeThreadFpScope(JSThread *thread, JSTaggedType *newFp) CallRuntimeTrampolinesScope(JSThread *thread, JSTaggedType *newFp)
:oldRbp_(const_cast<JSTaggedType *>(thread->GetCurrentSPFrame())), :oldRbp_(const_cast<JSTaggedType *>(thread->GetCurrentSPFrame())),
thread_(thread) thread_(thread)
{ {
thread_->SetCurrentSPFrame(newFp); thread_->SetCurrentSPFrame(newFp);
std::cout << "StubCallRunTimeThreadFpScope newFp: " << newFp << " oldRbp_ : " << oldRbp_ std::cout << "CallRuntimeTrampolinesScope newFp: " << newFp << " oldRbp_ : " << oldRbp_
<< " thread_->fp:" << thread_->GetCurrentSPFrame() <<std::endl; << " thread_->fp:" << thread_->GetCurrentSPFrame() <<std::endl;
FrameType type = *(reinterpret_cast<FrameType*>( FrameType type = *(reinterpret_cast<FrameType*>(
reinterpret_cast<long long>(newFp) + FrameConst::kFrameType)); reinterpret_cast<long long>(newFp) + FrameConst::kFrameType));
std::cout << "type = " << as_integer(type) << std::endl; std::cout << "type = " << as_integer(type) << std::endl;
} }
~StubCallRunTimeThreadFpScope() ~CallRuntimeTrampolinesScope()
{ {
std::cout << "~StubCallRunTimeThreadFpScope oldRbp_: " << oldRbp_ << std::cout << "~CallRuntimeTrampolinesScope oldRbp_: " << oldRbp_ <<
" thread_->fp:" << thread_->GetCurrentSPFrame() << std::endl; " thread_->fp:" << thread_->GetCurrentSPFrame() << std::endl;
FrameType type = *(reinterpret_cast<FrameType*>( FrameType type = *(reinterpret_cast<FrameType*>(
reinterpret_cast<long long>(oldRbp_) + FrameConst::kFrameType)); reinterpret_cast<long long>(oldRbp_) + FrameConst::kFrameType));

View File

@ -458,7 +458,7 @@ PtJSExtractor *JSBackend::GetExtractor(const CString &url)
bool JSBackend::GenerateCallFrames(CVector<std::unique_ptr<CallFrame>> *callFrames) bool JSBackend::GenerateCallFrames(CVector<std::unique_ptr<CallFrame>> *callFrames)
{ {
int32_t callFrameId = 0; int32_t callFrameId = 0;
auto walkerFunc = [this, &callFrameId, &callFrames](const EcmaFrameHandler *frameHandler) -> StackState { auto walkerFunc = [this, &callFrameId, &callFrames](const InterpretedFrameHandler *frameHandler) -> StackState {
JSMethod *method = DebuggerApi::GetMethod(frameHandler); JSMethod *method = DebuggerApi::GetMethod(frameHandler);
if (method->IsNative()) { if (method->IsNative()) {
LOG(INFO, DEBUGGER) << "GenerateCallFrames: Skip CFrame and Native method"; LOG(INFO, DEBUGGER) << "GenerateCallFrames: Skip CFrame and Native method";
@ -478,7 +478,7 @@ bool JSBackend::GenerateCallFrames(CVector<std::unique_ptr<CallFrame>> *callFram
return DebuggerApi::StackWalker(ecmaVm_, walkerFunc); return DebuggerApi::StackWalker(ecmaVm_, walkerFunc);
} }
bool JSBackend::GenerateCallFrame(CallFrame *callFrame, const EcmaFrameHandler *frameHandler, int32_t callFrameId) bool JSBackend::GenerateCallFrame(CallFrame *callFrame, const InterpretedFrameHandler *frameHandler, int32_t callFrameId)
{ {
JSMethod *method = DebuggerApi::GetMethod(frameHandler); JSMethod *method = DebuggerApi::GetMethod(frameHandler);
auto *pf = method->GetPandaFile(); auto *pf = method->GetPandaFile();
@ -528,7 +528,7 @@ bool JSBackend::GenerateCallFrame(CallFrame *callFrame, const EcmaFrameHandler *
return true; return true;
} }
std::unique_ptr<Scope> JSBackend::GetLocalScopeChain(const EcmaFrameHandler *frameHandler, std::unique_ptr<Scope> JSBackend::GetLocalScopeChain(const InterpretedFrameHandler *frameHandler,
std::unique_ptr<RemoteObject> *thisObj) std::unique_ptr<RemoteObject> *thisObj)
{ {
auto localScope = std::make_unique<Scope>(); auto localScope = std::make_unique<Scope>();

View File

@ -109,8 +109,8 @@ private:
PtJSExtractor *GetExtractor(const panda_file::File *file); PtJSExtractor *GetExtractor(const panda_file::File *file);
PtJSExtractor *GetExtractor(const CString &url); PtJSExtractor *GetExtractor(const CString &url);
bool GenerateCallFrames(CVector<std::unique_ptr<CallFrame>> *callFrames); bool GenerateCallFrames(CVector<std::unique_ptr<CallFrame>> *callFrames);
bool GenerateCallFrame(CallFrame *callFrame, const EcmaFrameHandler *frameHandler, int32_t frameId); bool GenerateCallFrame(CallFrame *callFrame, const InterpretedFrameHandler *frameHandler, int32_t frameId);
std::unique_ptr<Scope> GetLocalScopeChain(const EcmaFrameHandler *frameHandler, std::unique_ptr<Scope> GetLocalScopeChain(const InterpretedFrameHandler *frameHandler,
std::unique_ptr<RemoteObject> *thisObj); std::unique_ptr<RemoteObject> *thisObj);
std::unique_ptr<Scope> GetGlobalScopeChain(); std::unique_ptr<Scope> GetGlobalScopeChain();
std::optional<Error> SetValue(int32_t regIndex, std::unique_ptr<RemoteObject> *result, const CString &varValue); std::optional<Error> SetValue(int32_t regIndex, std::unique_ptr<RemoteObject> *result, const CString &varValue);

View File

@ -49,11 +49,11 @@ CString DebuggerApi::ConvertToString(const std::string &str)
return panda::ecmascript::ConvertToString(str); return panda::ecmascript::ConvertToString(str);
} }
// EcmaFrameHandler // InterpretedFrameHandler
uint32_t DebuggerApi::GetStackDepth(const EcmaVM *ecmaVm) uint32_t DebuggerApi::GetStackDepth(const EcmaVM *ecmaVm)
{ {
uint32_t count = 0; uint32_t count = 0;
EcmaFrameHandler frameHandler(ecmaVm->GetJSThread()); InterpretedFrameHandler frameHandler(ecmaVm->GetJSThread());
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {
continue; continue;
@ -63,9 +63,9 @@ uint32_t DebuggerApi::GetStackDepth(const EcmaVM *ecmaVm)
return count; return count;
} }
bool DebuggerApi::StackWalker(const EcmaVM *ecmaVm, std::function<StackState(const EcmaFrameHandler *)> func) bool DebuggerApi::StackWalker(const EcmaVM *ecmaVm, std::function<StackState(const InterpretedFrameHandler *)> func)
{ {
EcmaFrameHandler frameHandler(ecmaVm->GetJSThread()); InterpretedFrameHandler frameHandler(ecmaVm->GetJSThread());
for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) {
if (frameHandler.IsBreakFrame()) { if (frameHandler.IsBreakFrame()) {
continue; continue;
@ -84,37 +84,37 @@ bool DebuggerApi::StackWalker(const EcmaVM *ecmaVm, std::function<StackState(con
uint32_t DebuggerApi::GetBytecodeOffset(const EcmaVM *ecmaVm) uint32_t DebuggerApi::GetBytecodeOffset(const EcmaVM *ecmaVm)
{ {
return EcmaFrameHandler(ecmaVm->GetJSThread()).GetBytecodeOffset(); return InterpretedFrameHandler(ecmaVm->GetJSThread()).GetBytecodeOffset();
} }
JSMethod *DebuggerApi::GetMethod(const EcmaVM *ecmaVm) JSMethod *DebuggerApi::GetMethod(const EcmaVM *ecmaVm)
{ {
return EcmaFrameHandler(ecmaVm->GetJSThread()).GetMethod(); return InterpretedFrameHandler(ecmaVm->GetJSThread()).GetMethod();
} }
Local<JSValueRef> DebuggerApi::GetVRegValue(const EcmaVM *ecmaVm, size_t index) Local<JSValueRef> DebuggerApi::GetVRegValue(const EcmaVM *ecmaVm, size_t index)
{ {
auto value = EcmaFrameHandler(ecmaVm->GetJSThread()).GetVRegValue(index); auto value = InterpretedFrameHandler(ecmaVm->GetJSThread()).GetVRegValue(index);
JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value); JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value);
return JSNApiHelper::ToLocal<JSValueRef>(handledValue); return JSNApiHelper::ToLocal<JSValueRef>(handledValue);
} }
void DebuggerApi::SetVRegValue(const EcmaVM *ecmaVm, size_t index, Local<JSValueRef> value) void DebuggerApi::SetVRegValue(const EcmaVM *ecmaVm, size_t index, Local<JSValueRef> value)
{ {
return EcmaFrameHandler(ecmaVm->GetJSThread()).SetVRegValue(index, JSNApiHelper::ToJSTaggedValue(*value)); return InterpretedFrameHandler(ecmaVm->GetJSThread()).SetVRegValue(index, JSNApiHelper::ToJSTaggedValue(*value));
} }
uint32_t DebuggerApi::GetBytecodeOffset(const EcmaFrameHandler *frameHandler) uint32_t DebuggerApi::GetBytecodeOffset(const InterpretedFrameHandler *frameHandler)
{ {
return frameHandler->GetBytecodeOffset(); return frameHandler->GetBytecodeOffset();
} }
JSMethod *DebuggerApi::GetMethod(const EcmaFrameHandler *frameHandler) JSMethod *DebuggerApi::GetMethod(const InterpretedFrameHandler *frameHandler)
{ {
return frameHandler->GetMethod(); return frameHandler->GetMethod();
} }
Local<JSValueRef> DebuggerApi::GetVRegValue(const EcmaVM *ecmaVm, const EcmaFrameHandler *frameHandler, size_t index) Local<JSValueRef> DebuggerApi::GetVRegValue(const EcmaVM *ecmaVm, const InterpretedFrameHandler *frameHandler, size_t index)
{ {
auto value = frameHandler->GetVRegValue(index); auto value = frameHandler->GetVRegValue(index);
JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value); JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value);

View File

@ -32,7 +32,7 @@ class JSDebugger;
} // tooling::ecmascript } // tooling::ecmascript
namespace ecmascript { namespace ecmascript {
class EcmaFrameHandler; class InterpretedFrameHandler;
class EcmaVM; class EcmaVM;
class JSMethod; class JSMethod;
class JSThread; class JSThread;
@ -41,7 +41,7 @@ class JSThread;
namespace panda::tooling::ecmascript { namespace panda::tooling::ecmascript {
using panda::ecmascript::CString; using panda::ecmascript::CString;
using panda::ecmascript::EcmaFrameHandler; using panda::ecmascript::InterpretedFrameHandler;
using panda::ecmascript::EcmaVM; using panda::ecmascript::EcmaVM;
using panda::ecmascript::JSMethod; using panda::ecmascript::JSMethod;
using panda::ecmascript::JSThread; using panda::ecmascript::JSThread;
@ -59,16 +59,16 @@ public:
static CString ToCString(int32_t number); static CString ToCString(int32_t number);
static CString ConvertToString(const std::string &str); static CString ConvertToString(const std::string &str);
// EcmaFrameHandler // InterpretedFrameHandler
static uint32_t GetStackDepth(const EcmaVM *ecmaVm); static uint32_t GetStackDepth(const EcmaVM *ecmaVm);
static bool StackWalker(const EcmaVM *ecmaVm, std::function<StackState(const EcmaFrameHandler *)> func); static bool StackWalker(const EcmaVM *ecmaVm, std::function<StackState(const InterpretedFrameHandler *)> func);
static uint32_t GetBytecodeOffset(const EcmaVM *ecmaVm); static uint32_t GetBytecodeOffset(const EcmaVM *ecmaVm);
static JSMethod *GetMethod(const EcmaVM *ecmaVm); static JSMethod *GetMethod(const EcmaVM *ecmaVm);
static Local<JSValueRef> GetVRegValue(const EcmaVM *ecmaVm, size_t index); static Local<JSValueRef> GetVRegValue(const EcmaVM *ecmaVm, size_t index);
static void SetVRegValue(const EcmaVM *ecmaVm, size_t index, Local<JSValueRef> value); static void SetVRegValue(const EcmaVM *ecmaVm, size_t index, Local<JSValueRef> value);
static uint32_t GetBytecodeOffset(const EcmaFrameHandler *frameHandler); static uint32_t GetBytecodeOffset(const InterpretedFrameHandler *frameHandler);
static JSMethod *GetMethod(const EcmaFrameHandler *frameHandler); static JSMethod *GetMethod(const InterpretedFrameHandler *frameHandler);
static Local<JSValueRef> GetVRegValue(const EcmaVM *ecmaVm, const EcmaFrameHandler *frameHandler, size_t index); static Local<JSValueRef> GetVRegValue(const EcmaVM *ecmaVm, const InterpretedFrameHandler *frameHandler, size_t index);
// JSThread // JSThread
static Local<JSValueRef> GetException(const EcmaVM *ecmaVm); static Local<JSValueRef> GetException(const EcmaVM *ecmaVm);

View File

@ -17,7 +17,7 @@
#include "ecmascript/tooling/pt_js_extractor.h" #include "ecmascript/tooling/pt_js_extractor.h"
namespace panda::tooling::ecmascript { namespace panda::tooling::ecmascript {
using panda::ecmascript::EcmaFrameHandler; using panda::ecmascript::InterpretedFrameHandler;
using panda::ecmascript::JSTaggedType; using panda::ecmascript::JSTaggedType;
uint32_t PtJSExtractor::SingleStepper::GetStackDepth() const uint32_t PtJSExtractor::SingleStepper::GetStackDepth() const
{ {