CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/UI/JitCompareScreen.h
Views: 1401
#pragma once1#include "Common/UI/UIScreen.h"2#include "UI/MiscScreens.h"34class JitCompareScreen : public UIDialogScreenWithBackground {5public:6JitCompareScreen();7void CreateViews() override;89const char *tag() const override { return "JitCompare"; }1011private:12void Flip();13void UpdateDisasm();1415// Uses the current ListType16void FillBlockList();1718UI::LinearLayout *comparisonView_;19UI::LinearLayout *leftDisasm_;20UI::LinearLayout *rightDisasm_;2122UI::LinearLayout *blockListView_;23UI::LinearLayout *blockListContainer_;2425UI::LinearLayout *statsView_;26UI::LinearLayout *statsContainer_;2728UI::EventReturn OnSelectBlock(UI::EventParams &e);29UI::EventReturn OnBlockAddress(UI::EventParams &e);30UI::EventReturn OnAddressChange(UI::EventParams &e);31UI::EventReturn OnShowStats(UI::EventParams &e);32UI::EventReturn OnBlockClick(UI::EventParams &e);3334// To switch, change the below things and call RecreateViews();35enum class ViewMode {36BLOCK_LIST,37DISASM,38STATS,39};40enum class ListType {41ALL_BLOCKS,42FPU_BLOCKS,43VFPU_BLOCKS,44};45enum class ListSort {46BLOCK_NUM,47BLOCK_LENGTH_DESC,48BLOCK_LENGTH_ASC,49TIME_SPENT,50EXECUTIONS,51MAX52};53ViewMode viewMode_ = ViewMode::BLOCK_LIST;54ListType listType_ = ListType::ALL_BLOCKS;55ListSort listSort_ = ListSort::TIME_SPENT;5657int currentBlock_ = -1; // For DISASM mode58int64_t sumTotalNanos_ = 0;59int64_t sumExecutions_ = 0;60std::vector<int> blockList_; // for BLOCK_LIST mode6162UI::TextView *blockName_;63UI::TextEdit *blockAddr_;64UI::TextView *blockStats_;65};6667class AddressPromptScreen : public PopupScreen {68public:69AddressPromptScreen(std::string_view title) : PopupScreen(title, "OK", "Cancel") {}7071const char *tag() const override { return "AddressPrompt"; }7273bool key(const KeyInput &key) override;7475UI::Event OnChoice;7677protected:78void CreatePopupContents(UI::ViewGroup *parent) override;79void OnCompleted(DialogResult result) override;80UI::EventReturn OnDigitButton(UI::EventParams &e);81UI::EventReturn OnBackspace(UI::EventParams &e);8283private:84void AddDigit(int n);85void BackspaceDigit();86void UpdatePreviewDigits();8788UI::TextView *addrView_ = nullptr;89UI::Button *buttons_[16]{};90unsigned int addr_ = 0;91};929394