code review

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
This commit is contained in:
songzhengchao 2021-10-22 17:20:06 +08:00
parent 32e1e3341c
commit 08f5ec2df0
2 changed files with 6 additions and 6 deletions

View File

@ -199,11 +199,11 @@ public:
void IterateWeakEcmaGlobalStorage(const WeakRootVisitor &visitor);
uintptr_t* GetLastOptCallRuntimePc_() const
uintptr_t* GetLastOptCallRuntimePc() const
{
return lastOptCallRuntimePc_;
}
void SetLastOptCallRuntimePc_(uintptr_t* pc)
void SetLastOptCallRuntimePc(uintptr_t* pc)
{
lastOptCallRuntimePc_ = pc;
}

View File

@ -53,12 +53,12 @@ public:
class CallRuntimeTrampolinesScope {
public:
CallRuntimeTrampolinesScope(JSThread *thread, uintptr_t *newFp, uintptr_t *fp)
CallRuntimeTrampolinesScope(JSThread *thread, uintptr_t *newFp, uintptr_t *pc)
:oldFramePointer_(nullptr),
thread_(thread)
{
lastOptCallRuntimePc_ = thread->GetRuntimeTrampolinesFP();
thread->SetRuntimeTrampolinesFP(fp);
lastOptCallRuntimePc_ = thread->GetLastOptCallRuntimePc();
thread->SetLastOptCallRuntimePc(pc);
JSTaggedType *cursp = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame());
oldFramePointer_ = static_cast<uintptr_t *>(static_cast<void *>(cursp));
JSTaggedType *newSp = static_cast<JSTaggedType *>(static_cast<void *>(newFp));
@ -80,7 +80,7 @@ public:
std::cout << __FUNCTION__ << "type = " << as_integer(type) << std::endl;
JSTaggedType *oldSp = static_cast<JSTaggedType *>(static_cast<void *>(oldFramePointer_));
thread_->SetCurrentSPFrame(oldSp);
thread_->SetRuntimeTrampolinesFP(lastOptCallRuntimePc_);
thread_->SetLastOptCallRuntimePc(lastOptCallRuntimePc_);
}
private:
uintptr_t *oldFramePointer_;