├── .github └── images │ ├── panel_cc_layout.png │ ├── panel_code_suggest.png │ ├── panel_comp_activity.png │ ├── panel_comp_chain.png │ ├── panel_elim_alloc.png │ ├── panel_free_cc.png │ ├── panel_histo.png │ ├── panel_main.png │ ├── panel_timeline.png │ └── panel_tops.png ├── .gitignore ├── .idea ├── checkstyle-idea.xml ├── codeStyles │ └── codeStyleConfig.xml ├── gradle.xml ├── intellij-javadocs-4.0.1.xml ├── kotlinc.xml ├── misc.xml ├── uiDesigner.xml └── vcs.xml ├── .run └── Run IDE with Plugin.run.xml ├── CONTRIBUTING.md ├── LICENSE-BSD ├── README.md ├── TODO ├── build.gradle.kts ├── core ├── build.gradle.kts └── src │ └── main │ ├── java │ └── org │ │ └── adoptopenjdk │ │ └── jitwatch │ │ ├── chain │ │ ├── CompileChainWalker.java │ │ └── CompileNode.java │ │ ├── compilation │ │ ├── AbstractCompilationVisitable.java │ │ ├── AbstractCompilationWalker.java │ │ ├── CompilationUtil.java │ │ ├── ICompilationVisitable.java │ │ └── codecache │ │ │ ├── CodeCacheEventWalker.java │ │ │ └── CodeCacheWalkerResult.java │ │ ├── core │ │ ├── ErrorLog.java │ │ ├── IJITListener.java │ │ ├── JITWatchConfig.java │ │ ├── JITWatchConstants.java │ │ └── TagProcessor.java │ │ ├── demo │ │ └── MakeHotSpotLog.java │ │ ├── histo │ │ ├── AbstractHistoVisitable.java │ │ ├── AttributeNameHistoWalker.java │ │ ├── CompileTimeHistoWalker.java │ │ ├── Histo.java │ │ ├── IHistoVisitable.java │ │ ├── InlineSizeHistoVisitable.java │ │ └── NativeSizeHistoWalker.java │ │ ├── hotthrow │ │ ├── HotThrowFinder.java │ │ └── HotThrowResult.java │ │ ├── inline │ │ └── HeadlessInlineVisitor.java │ │ ├── intrinsic │ │ └── IntrinsicFinder.java │ │ ├── jarscan │ │ ├── IJarScanOperation.java │ │ ├── JarScan.java │ │ ├── allocationcount │ │ │ ├── AllocCountMap.java │ │ │ ├── AllocationCountOperation.java │ │ │ └── InstructionAllocCountMap.java │ │ ├── freqinlinesize │ │ │ └── FreqInlineSizeOperation.java │ │ ├── instructioncount │ │ │ └── InstructionCountOperation.java │ │ ├── invokecount │ │ │ ├── InvokeCountOperation.java │ │ │ ├── InvokeMethodCountMap.java │ │ │ └── MethodCountMap.java │ │ ├── methodlength │ │ │ └── MethodLengthOperation.java │ │ ├── methodsizehisto │ │ │ └── MethodSizeHistoOperation.java │ │ ├── nextinstruction │ │ │ ├── NextInstructionCount.java │ │ │ ├── NextInstructionCountList.java │ │ │ └── NextInstructionOperation.java │ │ ├── sequencecount │ │ │ ├── InstructionSequence.java │ │ │ └── SequenceCountOperation.java │ │ └── sequencesearch │ │ │ ├── FoundSequence.java │ │ │ └── SequenceSearchOperation.java │ │ ├── journal │ │ ├── AbstractJournalVisitable.java │ │ ├── IJournalVisitable.java │ │ └── JournalUtil.java │ │ ├── jvmlang │ │ └── LanguageManager.java │ │ ├── launch │ │ └── LaunchHeadless.java │ │ ├── loader │ │ ├── BytecodeLoader.java │ │ ├── DisposableURLClassLoader.java │ │ └── ResourceLoader.java │ │ ├── logger │ │ ├── ILogListener.java │ │ ├── ILoggerBackend.java │ │ ├── Logger.java │ │ ├── LoggerFactory.java │ │ ├── NullLogListener.java │ │ ├── StdLogListener.java │ │ └── StdOutLoggerBackend.java │ │ ├── model │ │ ├── AbstractMetaMember.java │ │ ├── AnnotationException.java │ │ ├── BCIOpcodeMap.java │ │ ├── CodeCacheEvent.java │ │ ├── Compilation.java │ │ ├── CompilerName.java │ │ ├── CompilerThread.java │ │ ├── EliminatedAllocation.java │ │ ├── EventType.java │ │ ├── IMetaMember.java │ │ ├── IParseDictionary.java │ │ ├── IReadOnlyJITDataModel.java │ │ ├── JITDataModel.java │ │ ├── JITEvent.java │ │ ├── JITStats.java │ │ ├── Journal.java │ │ ├── LogParseException.java │ │ ├── MemberSignatureParts.java │ │ ├── MetaClass.java │ │ ├── MetaConstructor.java │ │ ├── MetaMethod.java │ │ ├── MetaPackage.java │ │ ├── NumberedLine.java │ │ ├── PackageManager.java │ │ ├── ParseDictionary.java │ │ ├── ParsedClasspath.java │ │ ├── SplitLog.java │ │ ├── Tag.java │ │ ├── Task.java │ │ ├── assembly │ │ │ ├── AbstractAssemblyParser.java │ │ │ ├── Architecture.java │ │ │ ├── AssemblyBlock.java │ │ │ ├── AssemblyInstruction.java │ │ │ ├── AssemblyLabels.java │ │ │ ├── AssemblyMethod.java │ │ │ ├── AssemblyProcessor.java │ │ │ ├── AssemblyReference.java │ │ │ ├── AssemblyUtil.java │ │ │ ├── IAssemblyParser.java │ │ │ ├── arm │ │ │ │ └── AssemblyParserARM.java │ │ │ └── x86 │ │ │ │ └── AssemblyParserX86.java │ │ └── bytecode │ │ │ ├── BCAnnotationType.java │ │ │ ├── BCParamConstant.java │ │ │ ├── BCParamNumeric.java │ │ │ ├── BCParamString.java │ │ │ ├── BCParamSwitch.java │ │ │ ├── BytecodeAnnotationBuilder.java │ │ │ ├── BytecodeAnnotationList.java │ │ │ ├── BytecodeAnnotations.java │ │ │ ├── BytecodeInstruction.java │ │ │ ├── ClassBC.java │ │ │ ├── ConstantPool.java │ │ │ ├── ExceptionTable.java │ │ │ ├── ExceptionTableEntry.java │ │ │ ├── IBytecodeParam.java │ │ │ ├── InnerClassRelationship.java │ │ │ ├── LineAnnotation.java │ │ │ ├── LineTable.java │ │ │ ├── LineTableEntry.java │ │ │ ├── MemberBytecode.java │ │ │ ├── Opcode.java │ │ │ ├── SourceMapper.java │ │ │ └── UncommonTrap.java │ │ ├── parser │ │ ├── AbstractLogParser.java │ │ ├── ILogParseErrorListener.java │ │ ├── ILogParser.java │ │ ├── ParserFactory.java │ │ ├── ParserType.java │ │ ├── hotspot │ │ │ └── HotSpotLogParser.java │ │ ├── j9 │ │ │ ├── J9Line.java │ │ │ ├── J9LogParser.java │ │ │ └── J9Util.java │ │ └── zing │ │ │ ├── ZingLine.java │ │ │ ├── ZingLineType.java │ │ │ └── ZingLogParser.java │ │ ├── process │ │ ├── AbstractProcess.java │ │ ├── IExternalProcess.java │ │ ├── compiler │ │ │ ├── CompilerGroovy.java │ │ │ ├── CompilerJRuby.java │ │ │ ├── CompilerJava.java │ │ │ ├── CompilerJavaScript.java │ │ │ ├── CompilerKotlin.java │ │ │ ├── CompilerScala.java │ │ │ └── ICompiler.java │ │ ├── javap │ │ │ ├── JavapProcess.java │ │ │ └── ReflectionJavap.java │ │ └── runtime │ │ │ ├── IRuntime.java │ │ │ ├── RuntimeGroovy.java │ │ │ ├── RuntimeJRuby.java │ │ │ ├── RuntimeJava.java │ │ │ ├── RuntimeJavaScript.java │ │ │ ├── RuntimeKotlin.java │ │ │ └── RuntimeScala.java │ │ ├── report │ │ ├── AbstractReportBuilder.java │ │ ├── Report.java │ │ ├── ReportType.java │ │ ├── comparator │ │ │ ├── MemberComparator.java │ │ │ └── ScoreComparator.java │ │ ├── escapeanalysis │ │ │ ├── AbstractEscapeAnalysisWalker.java │ │ │ └── eliminatedallocation │ │ │ │ └── EliminatedAllocationWalker.java │ │ ├── inlining │ │ │ └── InliningWalker.java │ │ ├── locks │ │ │ └── OptimisedLocksWalker.java │ │ └── suggestion │ │ │ └── SuggestionWalker.java │ │ ├── toplist │ │ ├── AbstractTopListVisitable.java │ │ ├── CompileTimeTopListVisitable.java │ │ ├── CompiledAttributeTopListVisitable.java │ │ ├── HotThrowTopListVisitable.java │ │ ├── ITopListScore.java │ │ ├── ITopListVisitable.java │ │ ├── InliningFailReasonTopListVisitable.java │ │ ├── MemberScore.java │ │ ├── MostUsedIntrinsicsTopListVisitable.java │ │ ├── NativeMethodSizeTopListVisitable.java │ │ ├── StaleTaskToplistVisitable.java │ │ └── StringTopListScore.java │ │ ├── treevisitor │ │ ├── ITreeVisitable.java │ │ └── TreeVisitor.java │ │ └── util │ │ ├── ClassUtil.java │ │ ├── DisassemblyUtil.java │ │ ├── FileUtil.java │ │ ├── HeadlessUtil.java │ │ ├── JVMSUtil.java │ │ ├── NetUtil.java │ │ ├── OSUtil.java │ │ ├── ParseUtil.java │ │ ├── StringUtil.java │ │ ├── TimerUtil.java │ │ ├── TooltipUtil.java │ │ └── VmVersionDetector.java │ └── resources │ ├── examples │ ├── Adder.groovy │ ├── Branchless.java │ ├── CodeCacheBuster.java │ ├── DeoptTest.java │ ├── DoesItVectorise.java │ ├── DoesItVectoriseValue.java │ ├── ElisionTest.java │ ├── ElisionTest2.java │ ├── EscapeTest.java │ ├── EscapeTestManyFields.java │ ├── EscapeTestMultipleFields.java │ ├── EscapeTestString.java │ ├── EscapeTestUnboxing.java │ ├── HotThrow.java │ ├── Inc.scala │ ├── IncWhile.scala │ ├── InlineElimAlloc.java │ ├── InlineSmallCode.java │ ├── InliningChains.java │ ├── IntrinsicTest.java │ ├── Lambda.java │ ├── LockCoarsen.java │ ├── LockEliminate.java │ ├── LoopUnroll.java │ ├── MegamorphicBypass.java │ ├── OSRTest.java │ ├── PartialEscapeFail.java │ ├── PolymorphismTest.java │ ├── SafePointTest.java │ ├── SimpleInliningTest.java │ ├── Sort.java │ ├── StringBufferLockElision.java │ ├── TailRec.scala │ ├── TestInner.java │ ├── TrivialMethod.java │ ├── UpperCase.java │ ├── hello.kt │ └── run.js │ └── x86reference.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── nasm ├── LICENSE ├── build.gradle.kts ├── gen │ └── com │ │ └── nasmlanguage │ │ ├── NASMLexer.java │ │ ├── _NASMLexer.java │ │ ├── parser │ │ └── NASMParser.java │ │ └── psi │ │ ├── NASMAddress.java │ │ ├── NASMAssign.java │ │ ├── NASMBitShiftLExpr.java │ │ ├── NASMBitShiftRExpr.java │ │ ├── NASMBitwiseANDExpr.java │ │ ├── NASMBitwiseNOTExpr.java │ │ ├── NASMBitwiseORExpr.java │ │ ├── NASMBitwiseXORExpr.java │ │ ├── NASMConditional.java │ │ ├── NASMConstant.java │ │ ├── NASMDataElement.java │ │ ├── NASMDefine.java │ │ ├── NASMDirective.java │ │ ├── NASMDirectiveArg.java │ │ ├── NASMDivExpr.java │ │ ├── NASMEndDirective.java │ │ ├── NASMError.java │ │ ├── NASMExpr.java │ │ ├── NASMIStruc.java │ │ ├── NASMIdentifier.java │ │ ├── NASMInclude.java │ │ ├── NASMInstruction.java │ │ ├── NASMLabel.java │ │ ├── NASMLabelDefMacro.java │ │ ├── NASMLabelIdentifier.java │ │ ├── NASMLogicalANDExpr.java │ │ ├── NASMLogicalORExpr.java │ │ ├── NASMLogicalXORExpr.java │ │ ├── NASMMacro.java │ │ ├── NASMMacroCall.java │ │ ├── NASMMacroDefCall.java │ │ ├── NASMMacroDefinitionCall.java │ │ ├── NASMMacroLabel.java │ │ ├── NASMMacroParamCounter.java │ │ ├── NASMMacroParamReference.java │ │ ├── NASMMacroVarReference.java │ │ ├── NASMMapOption.java │ │ ├── NASMMinusExpr.java │ │ ├── NASMMnemonic.java │ │ ├── NASMModulusExpr.java │ │ ├── NASMMulExpr.java │ │ ├── NASMNumericLiteral.java │ │ ├── NASMParenthesisExpr.java │ │ ├── NASMPlusExpr.java │ │ ├── NASMPreprocessor.java │ │ ├── NASMReg.java │ │ ├── NASMSeg.java │ │ ├── NASMSegmentAddress.java │ │ ├── NASMStr.java │ │ ├── NASMStrlen.java │ │ ├── NASMStruc.java │ │ ├── NASMStructure.java │ │ ├── NASMStructureField.java │ │ ├── NASMTokenConcatExpr.java │ │ ├── NASMTypes.java │ │ ├── NASMVisitor.java │ │ └── impl │ │ ├── NASMAddressImpl.java │ │ ├── NASMAssignImpl.java │ │ ├── NASMBitShiftLExprImpl.java │ │ ├── NASMBitShiftRExprImpl.java │ │ ├── NASMBitwiseANDExprImpl.java │ │ ├── NASMBitwiseNOTExprImpl.java │ │ ├── NASMBitwiseORExprImpl.java │ │ ├── NASMBitwiseXORExprImpl.java │ │ ├── NASMConditionalImpl.java │ │ ├── NASMConstantImpl.java │ │ ├── NASMDataElementImpl.java │ │ ├── NASMDefineImpl.java │ │ ├── NASMDirectiveImpl.java │ │ ├── NASMDivExprImpl.java │ │ ├── NASMEndDirectiveImpl.java │ │ ├── NASMErrorImpl.java │ │ ├── NASMExprImpl.java │ │ ├── NASMIStrucImpl.java │ │ ├── NASMIdentifierImpl.java │ │ ├── NASMIncludeImpl.java │ │ ├── NASMInstructionImpl.java │ │ ├── NASMLabelDefMacroImpl.java │ │ ├── NASMLabelIdentifierImpl.java │ │ ├── NASMLabelImpl.java │ │ ├── NASMLogicalANDExprImpl.java │ │ ├── NASMLogicalORExprImpl.java │ │ ├── NASMLogicalXORExprImpl.java │ │ ├── NASMMacroCallImpl.java │ │ ├── NASMMacroDefCallImpl.java │ │ ├── NASMMacroImpl.java │ │ ├── NASMMacroLabelImpl.java │ │ ├── NASMMacroParamCounterImpl.java │ │ ├── NASMMacroParamReferenceImpl.java │ │ ├── NASMMacroVarReferenceImpl.java │ │ ├── NASMMapOptionImpl.java │ │ ├── NASMMinusExprImpl.java │ │ ├── NASMMnemonicImpl.java │ │ ├── NASMModulusExprImpl.java │ │ ├── NASMMulExprImpl.java │ │ ├── NASMNumericLiteralImpl.java │ │ ├── NASMParenthesisExprImpl.java │ │ ├── NASMPlusExprImpl.java │ │ ├── NASMPreprocessorImpl.java │ │ ├── NASMRegImpl.java │ │ ├── NASMSegImpl.java │ │ ├── NASMSegmentAddressImpl.java │ │ ├── NASMStrImpl.java │ │ ├── NASMStrlenImpl.java │ │ ├── NASMStrucImpl.java │ │ ├── NASMStructureFieldImpl.java │ │ ├── NASMStructureImpl.java │ │ └── NASMTokenConcatExprImpl.java └── src │ └── main │ └── java │ └── com │ └── nasmlanguage │ ├── NASM.bnf │ ├── NASMAnnotator.java │ ├── NASMChooseByNameContributor.java │ ├── NASMColorSettingsPage.java │ ├── NASMCommenter.java │ ├── NASMCompletionContributor.java │ ├── NASMFileElementType.java │ ├── NASMFileType.java │ ├── NASMFileTypeFactory_deprecated.java │ ├── NASMFindUsagesProvider.java │ ├── NASMIcons.java │ ├── NASMLanguage.java │ ├── NASMNamesValidator.java │ ├── NASMPairedBraceMatcher.java │ ├── NASMParserDefinition.java │ ├── NASMRefactoringSupportProvider.java │ ├── NASMReference.java │ ├── NASMReferenceContributor.java │ ├── NASMReferenceProvider.java │ ├── NASMSyntaxHighlighter.java │ ├── NASMSyntaxHighlighterFactory.java │ ├── NASMUtil.java │ ├── _NASMLexer.flex │ ├── icons │ ├── FileType_asm.svg │ └── FileType_asm@2x.svg │ ├── parser │ └── NASMParserUtil.java │ ├── psi │ ├── NASMElementFactory.java │ ├── NASMElementType.java │ ├── NASMFile.java │ ├── NASMNamedElement.java │ ├── NASMTokenType.java │ └── impl │ │ ├── NASMNamedElementImpl.java │ │ └── NASMPsiImplUtil.java │ └── stubs │ └── NASMFileStub.java ├── settings.gradle.kts └── src └── main ├── java └── org │ └── adoptopenjdk │ └── jitwatch │ ├── ui │ ├── JitWatch4iToolWindowFactory.java │ ├── code │ │ ├── AssemblyTextBuilder.java │ │ ├── BytecodeTextBuilder.java │ │ ├── CodePanelBase.java │ │ ├── CodeToolWindowManager.java │ │ ├── IViewer.java │ │ ├── JavaTypeUtils.java │ │ ├── JitRunConfigurationEditor.java │ │ ├── JitRunConfigurationExtension.java │ │ ├── JitWatchCodeUtil.java │ │ ├── JitWatchModelService.java │ │ ├── JitWatchSettings.java │ │ ├── PsiMetaMemberWrapper.java │ │ ├── ViewerAssembly.java │ │ ├── ViewerByteCode.java │ │ └── languages │ │ │ ├── DefaultJitLanguageSupport.java │ │ │ ├── JitWatchJavaSupport.java │ │ │ ├── JitWatchKotlinSupport.java │ │ │ ├── JitWatchLanguageSupport.java │ │ │ └── JitWatchLanguageSupportUtil.java │ ├── compilationchooser │ │ └── CompilationChooser.java │ ├── compilechain │ │ └── CompileChainPanel.java │ ├── graphing │ │ ├── AbstractGraphPanel.java │ │ ├── CodeCachePanel.java │ │ ├── HistoPanel.java │ │ └── TimeLinePanel.java │ ├── log │ │ └── LogPanel.java │ ├── main │ │ ├── ClassMemberListPanel.java │ │ ├── ClassTreePanel.java │ │ ├── CompilationTableRow.java │ │ ├── ICompilationChangeListener.java │ │ ├── IMemberSelectedListener.java │ │ ├── IPrevNextCompilationListener.java │ │ ├── IStageAccessProxy.java │ │ └── JITWatchUI.java │ ├── nmethod │ │ ├── AbstractNMethodPanel.java │ │ ├── NMethodInfoPanel.java │ │ ├── codecache │ │ │ └── CodeCacheLayoutPanel.java │ │ └── compilerthread │ │ │ └── CompilerThreadPanel.java │ ├── parserchooser │ │ ├── IParserSelectedListener.java │ │ └── ParserChooser.java │ ├── report │ │ ├── AbstractReportRowBean.java │ │ ├── IReportRowBean.java │ │ ├── IReportTable.java │ │ ├── ReportPanel.java │ │ ├── ReportStageType.java │ │ ├── cell │ │ │ ├── ButtonCellEditor.java │ │ │ ├── ButtonCellModule.java │ │ │ ├── ButtonCellRenderer.java │ │ │ ├── IntegerTableCellRenderer.java │ │ │ ├── MemberTableCellRenderer.java │ │ │ ├── TextTableCellRenderer.java │ │ │ └── TextWrapTableCellRenderer.java │ │ ├── eliminatedallocation │ │ │ ├── EliminatedAllocationRowBean.java │ │ │ └── EliminatedAllocationTable.java │ │ ├── inlining │ │ │ └── InliningRowBean.java │ │ ├── locks │ │ │ ├── OptimisedLockRowBean.java │ │ │ └── OptimisedLockTable.java │ │ └── suggestion │ │ │ ├── SuggestionRowBean.java │ │ │ └── SuggestionTable.java │ ├── resize │ │ └── IRedrawable.java │ └── toplist │ │ ├── TopListPanel.java │ │ └── TopListWrapper.java │ └── util │ ├── IntelliJLoggerBackend.java │ └── RollingStringBuilder.java └── resources ├── META-INF ├── plugin.xml └── pluginIcon.svg ├── i18n ├── lang.properties ├── lang_de.properties ├── lang_es.properties ├── lang_fr.properties ├── lang_pl.properties ├── lang_pt_BR.properties └── lang_zh.properties ├── images ├── camera.png └── tick.png ├── style-dark.css └── style.css /.github/images/panel_cc_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_cc_layout.png -------------------------------------------------------------------------------- /.github/images/panel_code_suggest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_code_suggest.png -------------------------------------------------------------------------------- /.github/images/panel_comp_activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_comp_activity.png -------------------------------------------------------------------------------- /.github/images/panel_comp_chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_comp_chain.png -------------------------------------------------------------------------------- /.github/images/panel_elim_alloc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_elim_alloc.png -------------------------------------------------------------------------------- /.github/images/panel_free_cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_free_cc.png -------------------------------------------------------------------------------- /.github/images/panel_histo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_histo.png -------------------------------------------------------------------------------- /.github/images/panel_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_main.png -------------------------------------------------------------------------------- /.github/images/panel_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_timeline.png -------------------------------------------------------------------------------- /.github/images/panel_tops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/.github/images/panel_tops.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | !**/src/main/**/build/ 5 | !**/src/test/**/build/ 6 | 7 | ### IntelliJ IDEA ### 8 | .idea/modules.xml 9 | .idea/jarRepositories.xml 10 | .idea/compiler.xml 11 | .idea/libraries/ 12 | *.iws 13 | *.iml 14 | *.ipr 15 | out/ 16 | !**/src/main/**/out/ 17 | !**/src/test/**/out/ 18 | 19 | ### Eclipse ### 20 | .apt_generated 21 | .classpath 22 | .factorypath 23 | .project 24 | .settings 25 | .springBeans 26 | .sts4-cache 27 | bin/ 28 | !**/src/main/**/bin/ 29 | !**/src/test/**/bin/ 30 | 31 | ### NetBeans ### 32 | /nbproject/private/ 33 | /nbbuild/ 34 | /dist/ 35 | /nbdist/ 36 | /.nb-gradle/ 37 | 38 | ### VS Code ### 39 | .vscode/ 40 | 41 | ### Mac OS ### 42 | .DS_Store -------------------------------------------------------------------------------- /.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10.19.0 5 | JavaOnly 6 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.run/Run IDE with Plugin.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 17 | 19 | true 20 | true 21 | false 22 | 23 | 24 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Suggest A Patch 4 | 5 | Use [GitHub Pull Requests](https://github.com/JetBrains/jitwatch4i/pulls) 6 | to suggest a patch that fixes a bug or implement a new feature. 7 | 8 | For a major change, please file an issue first so that it can be discussed. 9 | 10 | ## Report An Issue Or Request A Feature 11 | 12 | Use [GitHub Issues](https://github.com/JetBrains/jitwatch4i/issues) 13 | to report an issue or request a feature. 14 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | x load bytecode from jar files 2 | x IntelliJ logger backend 3 | x fix compilation selection 4 | x task_done not found in ignoreTags = new HashSet<>(); 16 | 17 | protected void handleOther(Tag tag) 18 | { 19 | if (!ignoreTags.contains(tag.getName())) 20 | { 21 | CompilationUtil.unhandledTag(this, tag); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/compilation/AbstractCompilationWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.compilation; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IParseDictionary; 9 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 10 | import org.adoptopenjdk.jitwatch.model.LogParseException; 11 | import org.adoptopenjdk.jitwatch.model.Tag; 12 | import org.adoptopenjdk.jitwatch.treevisitor.ITreeVisitable; 13 | import org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor; 14 | 15 | public abstract class AbstractCompilationWalker extends AbstractCompilationVisitable implements ITreeVisitable 16 | { 17 | protected IReadOnlyJITDataModel model; 18 | 19 | public AbstractCompilationWalker(IReadOnlyJITDataModel model) 20 | { 21 | this.model = model; 22 | } 23 | 24 | public void walkCompilations() 25 | { 26 | TreeVisitor.walkTree(model, this); 27 | } 28 | 29 | @Override 30 | public void visitTag(Tag toVisit, IParseDictionary parseDictionary) throws LogParseException 31 | { 32 | } 33 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/compilation/ICompilationVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.compilation; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IParseDictionary; 9 | import org.adoptopenjdk.jitwatch.model.LogParseException; 10 | import org.adoptopenjdk.jitwatch.model.Tag; 11 | 12 | public interface ICompilationVisitable 13 | { 14 | void visitTag(Tag toVisit, IParseDictionary parseDictionary) throws LogParseException; 15 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/core/IJITListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.core; 7 | 8 | import org.adoptopenjdk.jitwatch.logger.ILogListener; 9 | import org.adoptopenjdk.jitwatch.model.JITEvent; 10 | 11 | public interface IJITListener extends ILogListener 12 | { 13 | void handleJITEvent(JITEvent event); 14 | void handleReadStart(); 15 | void handleReadComplete(); 16 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/histo/AbstractHistoVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.histo; 7 | 8 | import org.adoptopenjdk.jitwatch.compilation.AbstractCompilationVisitable; 9 | import org.adoptopenjdk.jitwatch.model.IParseDictionary; 10 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 11 | import org.adoptopenjdk.jitwatch.model.LogParseException; 12 | import org.adoptopenjdk.jitwatch.model.Tag; 13 | import org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor; 14 | 15 | public abstract class AbstractHistoVisitable extends AbstractCompilationVisitable implements IHistoVisitable 16 | { 17 | protected Histo histo; 18 | protected IReadOnlyJITDataModel model; 19 | protected long resolution; 20 | 21 | public AbstractHistoVisitable(IReadOnlyJITDataModel model, long resolution) 22 | { 23 | this.model = model; 24 | this.resolution = resolution; 25 | } 26 | 27 | @Override 28 | public Histo buildHistogram() 29 | { 30 | histo = new Histo(resolution); 31 | 32 | TreeVisitor.walkTree(model, this); 33 | 34 | return histo; 35 | } 36 | 37 | @Override 38 | public void reset() 39 | { 40 | } 41 | 42 | @Override 43 | public void visitTag(Tag toVisit, IParseDictionary parseDictionary) throws LogParseException 44 | { 45 | } 46 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/histo/AttributeNameHistoWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.histo; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 10 | 11 | public class AttributeNameHistoWalker extends AbstractHistoVisitable 12 | { 13 | private boolean isCompileAttribute; 14 | private String attributeName; 15 | 16 | public AttributeNameHistoWalker(IReadOnlyJITDataModel model, boolean isCompileAttribute, String attributeName, long resolution) 17 | { 18 | super(model, resolution); 19 | 20 | this.isCompileAttribute = isCompileAttribute; 21 | this.attributeName = attributeName; 22 | } 23 | 24 | @Override 25 | public void visit(IMetaMember mm) 26 | { 27 | String attrValue = null; 28 | 29 | if (isCompileAttribute) 30 | { 31 | attrValue = mm.getCompiledAttribute(attributeName); 32 | } 33 | else 34 | { 35 | attrValue = mm.getQueuedAttribute(attributeName); 36 | } 37 | 38 | if (attrValue != null) 39 | { 40 | long val = Long.valueOf(attrValue); 41 | 42 | histo.addValue(val); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/histo/CompileTimeHistoWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.histo; 7 | 8 | import org.adoptopenjdk.jitwatch.model.Compilation; 9 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 10 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 11 | 12 | public class CompileTimeHistoWalker extends AbstractHistoVisitable 13 | { 14 | public CompileTimeHistoWalker(IReadOnlyJITDataModel model, long resolution) // TODO filter by compile level? 15 | { 16 | super(model, resolution); 17 | } 18 | 19 | @Override 20 | public void visit(IMetaMember mm) 21 | { 22 | for (Compilation compilation : mm.getCompilations()) 23 | { 24 | if (!compilation.isC2N()) 25 | { 26 | histo.addValue(compilation.getCompilationDuration()); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/histo/IHistoVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.histo; 7 | 8 | import org.adoptopenjdk.jitwatch.treevisitor.ITreeVisitable; 9 | 10 | public interface IHistoVisitable extends ITreeVisitable 11 | { 12 | Histo buildHistogram(); 13 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/histo/NativeSizeHistoWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.histo; 7 | 8 | import org.adoptopenjdk.jitwatch.model.Compilation; 9 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 10 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 11 | 12 | public class NativeSizeHistoWalker extends AbstractHistoVisitable 13 | { 14 | public NativeSizeHistoWalker(IReadOnlyJITDataModel model, long resolution) 15 | { 16 | super(model, resolution); 17 | } 18 | 19 | @Override 20 | public void visit(IMetaMember mm) 21 | { 22 | for (Compilation compilation : mm.getCompilations()) 23 | { 24 | long nativeSize = compilation.getNativeSize(); 25 | 26 | if (nativeSize != 0) 27 | { 28 | histo.addValue(nativeSize); 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/IJarScanOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.jarscan; 7 | 8 | import org.adoptopenjdk.jitwatch.model.bytecode.MemberBytecode; 9 | 10 | public interface IJarScanOperation 11 | { 12 | void processInstructions(String className, MemberBytecode memberBytecode); 13 | 14 | String getReport(); 15 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/allocationcount/InstructionAllocCountMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.jarscan.allocationcount; 7 | 8 | import java.util.EnumMap; 9 | import java.util.Map; 10 | 11 | import org.adoptopenjdk.jitwatch.model.bytecode.Opcode; 12 | 13 | public class InstructionAllocCountMap 14 | { 15 | private Map opcodeMap = new EnumMap<>(Opcode.class); 16 | 17 | public void count(Opcode opcode, String allocatedType) 18 | { 19 | AllocCountMap typeCountMap = opcodeMap.get(opcode); 20 | 21 | if (typeCountMap == null) 22 | { 23 | typeCountMap = new AllocCountMap(); 24 | opcodeMap.put(opcode, typeCountMap); 25 | } 26 | 27 | typeCountMap.countAllocationOfType(allocatedType); 28 | } 29 | 30 | public String toString(int limitPerInvoke) 31 | { 32 | StringBuilder builder = new StringBuilder(); 33 | 34 | for (Map.Entry entry : opcodeMap.entrySet()) 35 | { 36 | Opcode opcode = entry.getKey(); 37 | AllocCountMap typeCountMap = entry.getValue(); 38 | 39 | builder.append(typeCountMap.toString(opcode, limitPerInvoke)); 40 | } 41 | 42 | return builder.toString(); 43 | } 44 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/invokecount/InvokeMethodCountMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.jarscan.invokecount; 7 | 8 | import java.util.EnumMap; 9 | import java.util.Map; 10 | 11 | import org.adoptopenjdk.jitwatch.model.bytecode.Opcode; 12 | 13 | public class InvokeMethodCountMap 14 | { 15 | private Map opcodeMap = new EnumMap<>(Opcode.class); 16 | 17 | public void countInvocationOfMethod(Opcode opcode, String method) 18 | { 19 | MethodCountMap invokeCountMap = opcodeMap.get(opcode); 20 | 21 | if (invokeCountMap == null) 22 | { 23 | invokeCountMap = new MethodCountMap(); 24 | opcodeMap.put(opcode, invokeCountMap); 25 | } 26 | 27 | invokeCountMap.count(method); 28 | } 29 | 30 | public String toString(int limitPerInvoke) 31 | { 32 | StringBuilder builder = new StringBuilder(); 33 | 34 | for (Map.Entry entry : opcodeMap.entrySet()) 35 | { 36 | Opcode opcode = entry.getKey(); 37 | MethodCountMap invokeCountMap = entry.getValue(); 38 | 39 | builder.append(invokeCountMap.toString(opcode, limitPerInvoke)); 40 | } 41 | 42 | return builder.toString(); 43 | } 44 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/nextinstruction/NextInstructionCount.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.jarscan.nextinstruction; 7 | 8 | import org.adoptopenjdk.jitwatch.model.bytecode.Opcode; 9 | 10 | public class NextInstructionCount 11 | { 12 | private Opcode opcode; 13 | 14 | private int count; 15 | 16 | public NextInstructionCount(Opcode opcode, int count) 17 | { 18 | this.opcode = opcode; 19 | this.count = count; 20 | } 21 | 22 | public Opcode getOpcode() 23 | { 24 | return opcode; 25 | } 26 | 27 | public int getCount() 28 | { 29 | return count; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/jarscan/nextinstruction/NextInstructionCountList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.jarscan.nextinstruction; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.Comparator; 11 | import java.util.List; 12 | 13 | public class NextInstructionCountList 14 | { 15 | private List list = new ArrayList<>(); 16 | 17 | public List getList() 18 | { 19 | Collections.sort(list, new Comparator() 20 | { 21 | @Override 22 | public int compare(NextInstructionCount o1, NextInstructionCount o2) 23 | { 24 | return Integer.compare(o2.getCount(), o1.getCount()); 25 | } 26 | }); 27 | 28 | return list; 29 | } 30 | 31 | public void add(NextInstructionCount nextBytecode) 32 | { 33 | list.add(nextBytecode); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/journal/AbstractJournalVisitable.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.journal; 2 | 3 | import org.adoptopenjdk.jitwatch.model.Tag; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | public abstract class AbstractJournalVisitable implements IJournalVisitable { 9 | protected Set ignoreTags = new HashSet(); 10 | 11 | public AbstractJournalVisitable() { 12 | } 13 | 14 | protected void handleOther(Tag tag) { 15 | if (!this.ignoreTags.contains(tag.getName())) { 16 | JournalUtil.unhandledTag(this, tag); 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/journal/IJournalVisitable.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.journal; 2 | 3 | import org.adoptopenjdk.jitwatch.model.IParseDictionary; 4 | import org.adoptopenjdk.jitwatch.model.LogParseException; 5 | import org.adoptopenjdk.jitwatch.model.Tag; 6 | 7 | public interface IJournalVisitable { 8 | void visitTag(Tag var1, IParseDictionary var2) throws LogParseException; 9 | } 10 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/loader/DisposableURLClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.loader; 7 | 8 | import java.net.URL; 9 | import java.net.URLClassLoader; 10 | import java.util.ArrayList; 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | public class DisposableURLClassLoader extends URLClassLoader 15 | { 16 | private List urlList = new ArrayList<>(); 17 | 18 | public DisposableURLClassLoader(final List urls) 19 | { 20 | super(urls.toArray(new URL[urls.size()])); 21 | 22 | urlList.addAll(urls); 23 | } 24 | 25 | public List getURLListCopy() 26 | { 27 | return Collections.unmodifiableList(urlList); 28 | } 29 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/logger/ILogListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.logger; 7 | 8 | public interface ILogListener 9 | { 10 | void handleLogEntry(String entry); 11 | void handleErrorEntry(String entry); 12 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/logger/ILoggerBackend.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.logger; 2 | 3 | public interface ILoggerBackend 4 | { 5 | void writeLog(Class clazz, Logger.Level level, String message, Throwable throwable, Object... args); 6 | } 7 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/logger/LoggerFactory.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.logger; 2 | 3 | import java.nio.file.Path; 4 | 5 | public class LoggerFactory 6 | { 7 | private static ILoggerBackend loggerBackend = new StdOutLoggerBackend(); 8 | 9 | public static Logger getLogger(Class clazz) 10 | { 11 | return new Logger(clazz); 12 | } 13 | 14 | public static void setLogFile(Path path) { 15 | // relax for now 16 | } 17 | 18 | public static ILoggerBackend getLoggerBackend() 19 | { 20 | return loggerBackend; 21 | } 22 | 23 | public static void setLoggerBackend(ILoggerBackend loggerBackend) 24 | { 25 | LoggerFactory.loggerBackend = loggerBackend; 26 | } 27 | 28 | protected static void writeLog(Class clazz, Logger.Level level, String message, Throwable throwable, Object... args) 29 | { 30 | loggerBackend.writeLog(clazz, level, message, throwable, args); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/logger/NullLogListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.logger; 7 | 8 | public class NullLogListener implements ILogListener 9 | { 10 | 11 | @Override 12 | public void handleLogEntry(String entry) 13 | { 14 | } 15 | 16 | @Override 17 | public void handleErrorEntry(String entry) 18 | { 19 | } 20 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/logger/StdLogListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.logger; 7 | 8 | public class StdLogListener implements ILogListener 9 | { 10 | 11 | @Override 12 | public void handleLogEntry(String entry) 13 | { 14 | System.out.println(entry); 15 | } 16 | 17 | @Override 18 | public void handleErrorEntry(String entry) 19 | { 20 | System.err.println(entry); 21 | } 22 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/BCIOpcodeMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | import java.util.HashMap; 9 | 10 | import org.adoptopenjdk.jitwatch.model.bytecode.Opcode; 11 | 12 | public class BCIOpcodeMap extends HashMap 13 | { 14 | private static final long serialVersionUID = 1L; 15 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/CompilerName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | public enum CompilerName 9 | { 10 | C1, C2; 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/EliminatedAllocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | public class EliminatedAllocation 9 | { 10 | private String type; 11 | private int bytecodeOffset; 12 | 13 | public String getType() 14 | { 15 | return type; 16 | } 17 | 18 | public void setType(String type) 19 | { 20 | this.type = type; 21 | } 22 | 23 | public int getBytecodeOffset() 24 | { 25 | return bytecodeOffset; 26 | } 27 | 28 | public void setBytecodeOffset(int bytecodeOffset) 29 | { 30 | this.bytecodeOffset = bytecodeOffset; 31 | } 32 | 33 | public EliminatedAllocation(String type, int bytecodeOffset) 34 | { 35 | this.type = type; 36 | this.bytecodeOffset = bytecodeOffset; 37 | } 38 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/EventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | public enum EventType 9 | { 10 | QUEUE("Queued"), NMETHOD_C1("Compiled (C1)"), NMETHOD_C2("Compiled (C2)"), NMETHOD_C2N("Compiled (C2N)"), NMETHOD_J9( 11 | "Compiled (J9)"), NMETHOD_ZING("Compiled (Zing)"), NMETHOD_FALCON( 12 | "Compiled (Falcon)"), NMETHOD_JVMCI("Compiled (JVMCI)"), TASK("Compile Detail"); 13 | 14 | EventType(String text) 15 | { 16 | this.text = text; 17 | } 18 | 19 | private final String text; 20 | 21 | public String getText() 22 | { 23 | return text; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/IParseDictionary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | import org.adoptopenjdk.jitwatch.model.bytecode.Opcode; 9 | 10 | public interface IParseDictionary 11 | { 12 | void putType(String id, Tag type); 13 | 14 | void putKlass(String id, Tag klass); 15 | 16 | void putMethod(String id, Tag method); 17 | 18 | void putBCIOpcode(String methodID, int bci, Opcode opcode); 19 | 20 | Tag getType(String id); 21 | 22 | Tag getKlass(String id); 23 | 24 | Tag getMethod(String id); 25 | 26 | String getParseMethod(); 27 | 28 | BCIOpcodeMap getBCIOpcodeMap(String methodID); 29 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/IReadOnlyJITDataModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | import java.lang.reflect.Constructor; 9 | import java.lang.reflect.Method; 10 | import java.util.List; 11 | 12 | public interface IReadOnlyJITDataModel 13 | { 14 | PackageManager getPackageManager(); 15 | 16 | JITStats getJITStats(); 17 | 18 | List getEventListCopy(); 19 | 20 | List getCodeCacheEvents(); 21 | 22 | List getCompilerThreads(); 23 | 24 | CompilerThread getCompilerThread(String threadId); 25 | 26 | CompilerThread createCompilerThread(String threadId, String threadName); 27 | 28 | Tag getEndOfLogTag(); 29 | 30 | int getJDKMajorVersion(); 31 | 32 | IMetaMember findMetaMember(MemberSignatureParts msp); 33 | 34 | MetaClass buildAndGetMetaClass(String fqClassName); 35 | 36 | long getBaseTimestamp(); 37 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/Journal.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.model; 2 | 3 | import org.adoptopenjdk.jitwatch.util.ParseUtil; 4 | 5 | import java.util.*; 6 | 7 | public class Journal { 8 | private List entryList = new ArrayList(); 9 | 10 | public Journal() { 11 | } 12 | 13 | public void addEntry(Tag entry) { 14 | synchronized(this.entryList) { 15 | this.entryList.add(entry); 16 | } 17 | } 18 | 19 | public List getEntryList() { 20 | synchronized(this.entryList) { 21 | List copy = new ArrayList(this.entryList); 22 | Collections.sort(copy, new Comparator() { 23 | public int compare(Tag tag1, Tag tag2) { 24 | long ts1 = ParseUtil.getStamp(tag1.getAttributes()); 25 | long ts2 = ParseUtil.getStamp(tag2.getAttributes()); 26 | return Long.compare(ts1, ts2); 27 | } 28 | }); 29 | return copy; 30 | } 31 | } 32 | 33 | public String toString() { 34 | StringBuilder builder = new StringBuilder(); 35 | Iterator var2 = this.getEntryList().iterator(); 36 | 37 | while(var2.hasNext()) { 38 | Tag tag = (Tag)var2.next(); 39 | builder.append(tag.toString(true)).append('\n'); 40 | } 41 | 42 | return builder.toString(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/LogParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | public class LogParseException extends Exception 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public LogParseException(String message) 13 | { 14 | super(message); 15 | } 16 | 17 | public LogParseException(String message, Throwable cause) 18 | { 19 | super(message, cause); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/NumberedLine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | public class NumberedLine 9 | { 10 | private long lineNumber; 11 | private String line; 12 | 13 | public long getLineNumber() 14 | { 15 | return lineNumber; 16 | } 17 | 18 | public void setLineNumber(long lineNumber) 19 | { 20 | this.lineNumber = lineNumber; 21 | } 22 | 23 | public String getLine() 24 | { 25 | return line; 26 | } 27 | 28 | public void setLine(String line) 29 | { 30 | this.line = line; 31 | } 32 | 33 | public NumberedLine(long lineNumber, String line) 34 | { 35 | this.lineNumber = lineNumber; 36 | this.line = line; 37 | } 38 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/ParsedClasspath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.HashSet; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | public class ParsedClasspath 15 | { 16 | private Set classLocationSet = new HashSet<>(); 17 | 18 | public void clear() 19 | { 20 | classLocationSet.clear(); 21 | } 22 | 23 | public void addClassLocation(String location) 24 | { 25 | classLocationSet.add(location); 26 | } 27 | 28 | public List getClassLocations() 29 | { 30 | List asList = new ArrayList<>(classLocationSet); 31 | 32 | Collections.sort(asList); 33 | 34 | return Collections.unmodifiableList(asList); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/assembly/Architecture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.assembly; 7 | 8 | import org.adoptopenjdk.jitwatch.util.StringUtil; 9 | 10 | import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_APOSTROPHE; 11 | 12 | public enum Architecture 13 | { 14 | X86_32, X86_64, ARM_32, ARM_64; 15 | 16 | private static final String ARCH_X86_32 = "i386"; 17 | private static final String ARCH_X86_64 = "i386:x86-64"; 18 | private static final String ARCH_AMD_64 = "amd64"; 19 | 20 | private static final String ARCH_ARM_32 = "arm"; 21 | private static final String ARCH_ARM_64 = "arm-64"; 22 | 23 | public static Architecture parseFromLogLine(String line) 24 | { 25 | String arch = StringUtil.getSubstringBetween(line, S_APOSTROPHE, S_APOSTROPHE); 26 | 27 | if (arch != null) 28 | { 29 | switch (arch) 30 | { 31 | case ARCH_X86_32: 32 | return X86_32; 33 | case ARCH_X86_64: 34 | case ARCH_AMD_64: 35 | return X86_64; 36 | case ARCH_ARM_32: 37 | return ARM_32; 38 | case ARCH_ARM_64: 39 | return ARM_64; 40 | } 41 | } 42 | 43 | return null; 44 | } 45 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/assembly/IAssemblyParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.assembly; 7 | 8 | public interface IAssemblyParser 9 | { 10 | AssemblyMethod parseAssembly(String assemblyString, boolean isDisassembly); 11 | 12 | AssemblyInstruction createInstruction(AssemblyLabels labels, final String inLine); 13 | 14 | AssemblyInstruction parseInstruction(String input, long address, String comment, String annotation, AssemblyLabels labels); 15 | 16 | boolean isConstant(String mnemonic, String operand); 17 | 18 | boolean isRegister(String mnemonic, String operand); 19 | 20 | boolean isAddress(String mnemonic, String operand); 21 | 22 | boolean isJump(String mnemonic); 23 | 24 | String extractRegisterName(final String input); 25 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCAnnotationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public enum BCAnnotationType 9 | { 10 | BRANCH, INLINE_SUCCESS, INLINE_FAIL, ELIMINATED_ALLOCATION, LOCK_ELISION, LOCK_COARSEN, INTRINSIC_USED, UNCOMMON_TRAP, HOT_THROW_PREALLOCATED, HOT_THROW_NOT_PREALLOCATED, VIRTUAL_CALL; 11 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCParamConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.*; 9 | 10 | public class BCParamConstant implements IBytecodeParam 11 | { 12 | private int value; 13 | 14 | public BCParamConstant(String inConstant) 15 | { 16 | // remove leading # for constant pool param 17 | String constant = inConstant.substring(1); 18 | 19 | value = Integer.parseInt(constant); 20 | } 21 | 22 | @Override 23 | public String toString() 24 | { 25 | return S_HASH + Integer.toString(value); 26 | } 27 | 28 | @Override 29 | public Integer getValue() 30 | { 31 | return value; 32 | } 33 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCParamNumeric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public class BCParamNumeric implements IBytecodeParam 9 | { 10 | private int value; 11 | 12 | public BCParamNumeric(int value) 13 | { 14 | this.value = value; 15 | } 16 | 17 | @Override 18 | public String toString() 19 | { 20 | return Integer.toString(value); 21 | } 22 | 23 | @Override 24 | public Integer getValue() 25 | { 26 | return value; 27 | } 28 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BCParamString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public class BCParamString implements IBytecodeParam 9 | { 10 | private String value; 11 | 12 | public BCParamString(String value) 13 | { 14 | this.value = value; 15 | } 16 | 17 | @Override 18 | public String toString() 19 | { 20 | return value; 21 | } 22 | 23 | @Override 24 | public String getValue() 25 | { 26 | return value; 27 | } 28 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/BytecodeAnnotations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | import java.util.Set; 11 | 12 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 13 | 14 | public class BytecodeAnnotations 15 | { 16 | private Map memberAnnotationMap = new HashMap<>(); 17 | 18 | public void addAnnotation(IMetaMember member, int bci, LineAnnotation annotation) 19 | { 20 | BytecodeAnnotationList memberList = memberAnnotationMap.get(member); 21 | 22 | if (memberList == null) 23 | { 24 | memberList = new BytecodeAnnotationList(); 25 | memberAnnotationMap.put(member, memberList); 26 | } 27 | 28 | memberList.addAnnotation(bci, annotation); 29 | } 30 | 31 | public BytecodeAnnotationList getAnnotationList(IMetaMember member) 32 | { 33 | return memberAnnotationMap.get(member); 34 | } 35 | 36 | public void clear() 37 | { 38 | memberAnnotationMap.clear(); 39 | } 40 | 41 | public Set getMembers() 42 | { 43 | return memberAnnotationMap.keySet(); 44 | } 45 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/ConstantPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public class ConstantPool 9 | { 10 | 11 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/ExceptionTableEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public class ExceptionTableEntry 9 | { 10 | private int from; 11 | private int to; 12 | private int target; 13 | private String type; 14 | 15 | public int getFrom() 16 | { 17 | return from; 18 | } 19 | 20 | public int getTo() 21 | { 22 | return to; 23 | } 24 | 25 | public int getTarget() 26 | { 27 | return target; 28 | } 29 | 30 | public String getType() 31 | { 32 | return type; 33 | } 34 | 35 | public ExceptionTableEntry(int from, int to, int target, String type) 36 | { 37 | this.from = from; 38 | this.to = to; 39 | this.target = target; 40 | this.type = type; 41 | } 42 | 43 | @Override 44 | public String toString() 45 | { 46 | StringBuilder builder = new StringBuilder(); 47 | 48 | builder.append(from).append(" \t "); 49 | builder.append(to).append( "\t "); 50 | builder.append(target).append(" \t "); 51 | builder.append(type); 52 | 53 | return builder.toString(); 54 | } 55 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/IBytecodeParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.model.bytecode; 7 | 8 | public interface IBytecodeParam 9 | { 10 | Object getValue(); 11 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/parser/ILogParseErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.parser; 7 | 8 | public interface ILogParseErrorListener 9 | { 10 | void handleError(String title, String body); 11 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/parser/ILogParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.parser; 7 | 8 | import java.io.File; 9 | import java.io.FileReader; 10 | import java.io.IOException; 11 | import java.io.Reader; 12 | 13 | import org.adoptopenjdk.jitwatch.core.JITWatchConfig; 14 | import org.adoptopenjdk.jitwatch.model.JITDataModel; 15 | import org.adoptopenjdk.jitwatch.model.ParsedClasspath; 16 | import org.adoptopenjdk.jitwatch.model.SplitLog; 17 | 18 | public interface ILogParser 19 | { 20 | void setConfig(JITWatchConfig config); 21 | 22 | default void processLogFile(File logFile, ILogParseErrorListener listener) throws IOException{ 23 | processLogFile(new FileReader(logFile), listener); 24 | } 25 | 26 | void processLogFile(Reader logFileReader, ILogParseErrorListener listener) throws IOException; 27 | 28 | SplitLog getSplitLog(); 29 | 30 | void stopParsing(); 31 | 32 | ParsedClasspath getParsedClasspath(); 33 | 34 | JITDataModel getModel(); 35 | 36 | JITWatchConfig getConfig(); 37 | 38 | void reset(); 39 | 40 | boolean hasParseError(); 41 | 42 | String getVMCommand(); 43 | 44 | void discardParsedLogs(); 45 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/parser/ParserFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.parser; 7 | 8 | import org.adoptopenjdk.jitwatch.core.IJITListener; 9 | import org.adoptopenjdk.jitwatch.parser.hotspot.HotSpotLogParser; 10 | import org.adoptopenjdk.jitwatch.parser.j9.J9LogParser; 11 | import org.adoptopenjdk.jitwatch.parser.zing.ZingLogParser; 12 | 13 | public class ParserFactory 14 | { 15 | private ParserFactory() 16 | { 17 | } 18 | 19 | public static ILogParser getParser(ParserType parserType, IJITListener jitListener) 20 | { 21 | switch (parserType) 22 | { 23 | case HOTSPOT: 24 | return new HotSpotLogParser(jitListener); 25 | case J9: 26 | return new J9LogParser(jitListener); 27 | case ZING: 28 | return new ZingLogParser(jitListener); 29 | default: 30 | throw new RuntimeException("Unknown parser " + parserType); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/parser/ParserType.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.parser; 2 | 3 | public enum ParserType 4 | { 5 | HOTSPOT, J9, ZING; 6 | 7 | public String getDisplayName() 8 | { 9 | switch (this) 10 | { 11 | case HOTSPOT: 12 | return "HotSpot"; 13 | case J9: 14 | return "J9"; 15 | case ZING: 16 | return "Zing"; 17 | default: 18 | throw new RuntimeException("Unknown parser type"); 19 | } 20 | } 21 | 22 | public static ParserType fromString(String input) 23 | { 24 | if (input != null) 25 | { 26 | switch (input.toLowerCase()) 27 | { 28 | case "hotspot": 29 | return HOTSPOT; 30 | case "j9": 31 | return J9; 32 | case "zing": 33 | return ZING; 34 | } 35 | } 36 | 37 | throw new RuntimeException("Unknown parser type: " + input); 38 | } 39 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/parser/zing/ZingLineType.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.parser.zing; 2 | 3 | public enum ZingLineType 4 | { 5 | QUEUED, INSTALLED 6 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/process/IExternalProcess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.process; 7 | 8 | public interface IExternalProcess 9 | { 10 | String getOutputStream(); 11 | String getErrorStream(); 12 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/process/compiler/ICompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2022 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.process.compiler; 7 | 8 | import java.io.File; 9 | import java.io.IOException; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | import org.adoptopenjdk.jitwatch.logger.ILogListener; 14 | import org.adoptopenjdk.jitwatch.process.IExternalProcess; 15 | 16 | public interface ICompiler extends IExternalProcess 17 | { 18 | public boolean compile(List sourceFiles, List classpathEntries, List vmOptions, File outputDir, Map environment, ILogListener logListener) throws IOException; 19 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/process/runtime/IRuntime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2022 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.process.runtime; 7 | 8 | import java.io.File; 9 | import java.nio.file.Path; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | import org.adoptopenjdk.jitwatch.logger.ILogListener; 14 | import org.adoptopenjdk.jitwatch.process.IExternalProcess; 15 | 16 | public interface IRuntime extends IExternalProcess 17 | { 18 | public boolean execute(Path workingDir, String className, List classpathEntries, List vmOptions, Map environment, ILogListener logListener); 19 | 20 | public String getClassToExecute(File fileToRun); 21 | 22 | public String getClassForTriView(File fileToRun); 23 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/AbstractReportBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.Comparator; 11 | import java.util.List; 12 | 13 | import org.adoptopenjdk.jitwatch.compilation.AbstractCompilationVisitable; 14 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 15 | import org.adoptopenjdk.jitwatch.treevisitor.ITreeVisitable; 16 | import org.adoptopenjdk.jitwatch.treevisitor.TreeVisitor; 17 | 18 | public abstract class AbstractReportBuilder extends AbstractCompilationVisitable implements ITreeVisitable 19 | { 20 | protected IReadOnlyJITDataModel model; 21 | protected List reportList; 22 | 23 | public AbstractReportBuilder(IReadOnlyJITDataModel model) 24 | { 25 | this.model = model; 26 | reportList = new ArrayList<>(); 27 | } 28 | 29 | public List getReports(Comparator comparator) 30 | { 31 | TreeVisitor.walkTree(model, this); 32 | 33 | findNonMemberReports(); 34 | 35 | Collections.sort(reportList, comparator); 36 | 37 | return reportList; 38 | } 39 | 40 | protected abstract void findNonMemberReports(); 41 | 42 | @Override 43 | public void reset() 44 | { 45 | reportList.clear(); 46 | } 47 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/ReportType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report; 7 | 8 | public enum ReportType 9 | { 10 | BRANCH, INLINE_SUCCESS, INLINE_FAILURE, CODE_CACHE, HOT_THROW, ELIMINATED_ALLOCATION_DIRECT, ELIMINATED_ALLOCATION_INLINE 11 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/comparator/MemberComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report.comparator; 7 | 8 | import java.util.Comparator; 9 | 10 | import org.adoptopenjdk.jitwatch.report.Report; 11 | 12 | public class MemberComparator implements Comparator 13 | { 14 | @Override 15 | public int compare(Report o1, Report o2) 16 | { 17 | return o2.getCaller().getFullyQualifiedMemberName().compareTo(o1.getCaller().getFullyQualifiedMemberName()); 18 | } 19 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/comparator/ScoreComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report.comparator; 7 | 8 | import java.util.Comparator; 9 | 10 | import org.adoptopenjdk.jitwatch.report.Report; 11 | 12 | public class ScoreComparator implements Comparator 13 | { 14 | 15 | @Override 16 | public int compare(Report o1, Report o2) 17 | { 18 | return Integer.compare(o2.getScore(), o1.getScore()); 19 | } 20 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/escapeanalysis/eliminatedallocation/EliminatedAllocationWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report.escapeanalysis.eliminatedallocation; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 9 | import org.adoptopenjdk.jitwatch.model.bytecode.BCAnnotationType; 10 | import org.adoptopenjdk.jitwatch.model.bytecode.LineAnnotation; 11 | import org.adoptopenjdk.jitwatch.report.escapeanalysis.AbstractEscapeAnalysisWalker; 12 | 13 | public class EliminatedAllocationWalker extends AbstractEscapeAnalysisWalker 14 | { 15 | public EliminatedAllocationWalker(IReadOnlyJITDataModel model) 16 | { 17 | super(model); 18 | } 19 | 20 | @Override 21 | protected boolean filterLineAnnotation(LineAnnotation la) 22 | { 23 | return la.getType() == BCAnnotationType.ELIMINATED_ALLOCATION; 24 | } 25 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/report/locks/OptimisedLocksWalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.report.locks; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 9 | import org.adoptopenjdk.jitwatch.model.bytecode.BCAnnotationType; 10 | import org.adoptopenjdk.jitwatch.model.bytecode.LineAnnotation; 11 | import org.adoptopenjdk.jitwatch.report.escapeanalysis.AbstractEscapeAnalysisWalker; 12 | 13 | public class OptimisedLocksWalker extends AbstractEscapeAnalysisWalker 14 | { 15 | public OptimisedLocksWalker(IReadOnlyJITDataModel model) 16 | { 17 | super(model); 18 | } 19 | 20 | @Override 21 | protected boolean filterLineAnnotation(LineAnnotation la) 22 | { 23 | return la.getType() == BCAnnotationType.LOCK_ELISION; 24 | } 25 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/CompileTimeTopListVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | import org.adoptopenjdk.jitwatch.model.Compilation; 9 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 10 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 11 | 12 | public class CompileTimeTopListVisitable extends AbstractTopListVisitable 13 | { 14 | public CompileTimeTopListVisitable(IReadOnlyJITDataModel model, boolean sortHighToLow) 15 | { 16 | super(model, sortHighToLow); 17 | } 18 | 19 | @Override 20 | public void visit(IMetaMember mm) 21 | { 22 | for (Compilation compilation : mm.getCompilations()) 23 | { 24 | if (!compilation.isC2N()) 25 | { 26 | topList.add(new MemberScore(mm, compilation.getCompilationDuration())); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/CompiledAttributeTopListVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 10 | 11 | public class CompiledAttributeTopListVisitable extends AbstractTopListVisitable 12 | { 13 | private final String attr; 14 | 15 | public CompiledAttributeTopListVisitable(IReadOnlyJITDataModel model, String attr, boolean sortHighToLow) 16 | { 17 | super(model, sortHighToLow); 18 | this.attr = attr; 19 | } 20 | 21 | @Override 22 | public void visit(IMetaMember mm) 23 | { 24 | if (mm.getCompiledAttribute(attr) != null) 25 | { 26 | long value = Long.valueOf(mm.getCompiledAttribute(attr)); 27 | topList.add(new MemberScore(mm, value)); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/ITopListScore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | public interface ITopListScore 9 | { 10 | Object getKey(); 11 | long getScore(); 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/ITopListVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | import java.util.List; 9 | 10 | import org.adoptopenjdk.jitwatch.treevisitor.ITreeVisitable; 11 | 12 | public interface ITopListVisitable extends ITreeVisitable 13 | { 14 | List buildTopList(); 15 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/MemberScore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | 10 | public class MemberScore implements ITopListScore 11 | { 12 | private final IMetaMember member; 13 | private final long score; 14 | 15 | public MemberScore(IMetaMember member, long score) 16 | { 17 | this.member = member; 18 | this.score = score; 19 | } 20 | 21 | @Override 22 | public IMetaMember getKey() 23 | { 24 | return member; 25 | } 26 | 27 | @Override 28 | public long getScore() 29 | { 30 | return score; 31 | } 32 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/toplist/StringTopListScore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.toplist; 7 | 8 | public class StringTopListScore implements ITopListScore 9 | { 10 | private final String key; 11 | private final long score; 12 | 13 | public StringTopListScore(String key, long score) 14 | { 15 | this.key = key; 16 | this.score = score; 17 | } 18 | 19 | @Override 20 | public String getKey() 21 | { 22 | return key; 23 | } 24 | 25 | @Override 26 | public long getScore() 27 | { 28 | return score; 29 | } 30 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/treevisitor/ITreeVisitable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.treevisitor; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | 10 | public interface ITreeVisitable 11 | { 12 | void visit(IMetaMember mm); 13 | void reset(); 14 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/treevisitor/TreeVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.treevisitor; 7 | 8 | import java.util.List; 9 | 10 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 11 | import org.adoptopenjdk.jitwatch.model.IReadOnlyJITDataModel; 12 | import org.adoptopenjdk.jitwatch.model.MetaClass; 13 | import org.adoptopenjdk.jitwatch.model.MetaPackage; 14 | 15 | public final class TreeVisitor 16 | { 17 | private TreeVisitor() 18 | { 19 | } 20 | 21 | public static void walkTree(IReadOnlyJITDataModel model, ITreeVisitable visitable) 22 | { 23 | visitable.reset(); 24 | 25 | List roots = model.getPackageManager().getRootPackages(); 26 | 27 | for (MetaPackage mp : roots) 28 | { 29 | walkPackage(mp, visitable); 30 | } 31 | } 32 | 33 | private static void walkPackage(MetaPackage mp, ITreeVisitable visitable) 34 | { 35 | List childPackages = mp.getChildPackages(); 36 | 37 | for (MetaPackage childPackage : childPackages) 38 | { 39 | walkPackage(childPackage, visitable); 40 | } 41 | 42 | List packageClasses = mp.getPackageClasses(); 43 | 44 | for (MetaClass mc : packageClasses) 45 | { 46 | for (IMetaMember mm : mc.getMetaMembers()) 47 | { 48 | visitable.visit(mm); 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /core/src/main/java/org/adoptopenjdk/jitwatch/util/TimerUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.util; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | public class TimerUtil 12 | { 13 | private static Map timestampMap = new HashMap<>(); 14 | 15 | private static long lastNow = 0; 16 | 17 | public static void timerStart(String key) 18 | { 19 | long now = System.currentTimeMillis(); 20 | 21 | timestampMap.put(key, now); 22 | 23 | long delta = now - lastNow; 24 | 25 | if (lastNow != 0) 26 | { 27 | System.out.println(now + " (+" + delta + ") starting " + key); 28 | } 29 | else 30 | { 31 | System.out.println(now + " starting " + key); 32 | } 33 | 34 | lastNow = now; 35 | } 36 | 37 | public static void timerEnd(String key) 38 | { 39 | if (timestampMap.containsKey(key)) 40 | { 41 | long start = timestampMap.get(key); 42 | 43 | long now = System.currentTimeMillis(); 44 | 45 | System.out.println(key + ": " + (now - start) + "ms"); 46 | } 47 | else 48 | { 49 | System.out.println("No start time found for " + key); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/Adder.groovy: -------------------------------------------------------------------------------- 1 | def add(x,y) { 2 | x+y 3 | } 4 | 5 | def y = 10000 6 | def x = 0 7 | 8 | while ( y-- > 0 ) { 9 | x = add(x, 1) 10 | } 11 | 12 | println x -------------------------------------------------------------------------------- /core/src/main/resources/examples/DeoptTest.java: -------------------------------------------------------------------------------- 1 | public class DeoptTest 2 | { 3 | private long greater = 0; 4 | private long less = 0; 5 | private long direction = -1; 6 | 7 | private static final long MAX = 1_000_000; 8 | private static final long MIN = -MAX; 9 | 10 | public DeoptTest() 11 | { 12 | long current = MAX; 13 | long endTime = System.currentTimeMillis() + 20_000; // 20 seconds 14 | 15 | while (System.currentTimeMillis() < endTime) 16 | { 17 | checkZero(current); 18 | 19 | current += direction; 20 | 21 | if (current >= MAX || current <= MIN) 22 | { 23 | direction = -direction; 24 | } 25 | } 26 | 27 | System.out.println(greater + " > 0, " + less + " < 0."); 28 | } 29 | 30 | private void checkZero(long value) 31 | { 32 | if (value > 0) 33 | { 34 | greater(); 35 | } 36 | else 37 | { 38 | less(); 39 | } 40 | } 41 | 42 | public void greater() 43 | { 44 | greater++; 45 | } 46 | 47 | public void less() 48 | { 49 | less++; 50 | } 51 | 52 | public static void main(String[] args) 53 | { 54 | new DeoptTest(); 55 | } 56 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/DoesItVectorise.java: -------------------------------------------------------------------------------- 1 | public class DoesItVectorise 2 | { 3 | public DoesItVectorise() 4 | { 5 | int[] array = new int[1024]; 6 | 7 | for (int i = 0; i < 1_000_000; i++) 8 | { 9 | incrementArray(array, 1); 10 | } 11 | 12 | for (int i = 0; i < array.length; i++) 13 | { 14 | System.out.println(array[i]); 15 | } 16 | } 17 | 18 | public void incrementArray(int[] array, int constant) 19 | { 20 | int length = array.length; 21 | 22 | for (int i = 0; i < length; i++) 23 | { 24 | array[i] += constant; 25 | } 26 | } 27 | 28 | public static void main(String[] args) 29 | { 30 | new DoesItVectorise(); 31 | } 32 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/DoesItVectoriseValue.java: -------------------------------------------------------------------------------- 1 | public class DoesItVectoriseValue 2 | { 3 | public DoesItVectoriseValue() 4 | { 5 | int[] array = new int[1024]; 6 | 7 | for (int i = 0; i < 1_000_000; i++) 8 | { 9 | incrementArray(array, 1); 10 | } 11 | 12 | for (int i = 0; i < array.length; i++) 13 | { 14 | System.out.println(array[i]); 15 | } 16 | } 17 | 18 | public void incrementArray(int[] array, int constant) 19 | { 20 | int length = array.length; 21 | 22 | for (Cursor c = Cursor.of(length); c.canAdvance(); c = c.advance()) 23 | { 24 | array[c.position] += constant; 25 | } 26 | } 27 | 28 | public value record Cursor(int position, int length) 29 | { 30 | public Cursor { 31 | if (length < 0 || position > length) 32 | { 33 | throw new IllegalArgumentException(); 34 | } 35 | } 36 | 37 | public static Cursor of(int length) 38 | { 39 | return new Cursor(0, length); 40 | } 41 | 42 | public boolean canAdvance() 43 | { 44 | return position < length; 45 | } 46 | 47 | public Cursor advance() 48 | { 49 | return new Cursor(position + 1, length); 50 | } 51 | } 52 | 53 | public static void main(String[] args) 54 | { 55 | new DoesItVectoriseValue(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/ElisionTest.java: -------------------------------------------------------------------------------- 1 | import java.util.Vector; 2 | 3 | public class ElisionTest 4 | { 5 | public ElisionTest() 6 | { 7 | Vector vector = new Vector<>(); 8 | 9 | for (long i = 0; i < 100_000; i++) 10 | { 11 | vector.add(i); // add is synchronized 12 | } 13 | 14 | long sum = 0; 15 | 16 | for (int i = 0; i < vector.size(); i++) 17 | { 18 | sum += vector.get(i); 19 | } 20 | 21 | System.out.println("ElisionTest: " + sum); 22 | } 23 | 24 | public static void main(String[] args) 25 | { 26 | new ElisionTest(); 27 | } 28 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/ElisionTest2.java: -------------------------------------------------------------------------------- 1 | import java.util.Vector; 2 | 3 | public class ElisionTest2 4 | { 5 | public ElisionTest2() 6 | { 7 | StringBuffer buffer = new StringBuffer(); 8 | 9 | for (int i = 0; i < 100_000; i++) 10 | { 11 | buffer.append(i); 12 | } 13 | 14 | System.out.println("ElisionTest2: " + buffer.toString().length()); 15 | } 16 | 17 | public static void main(String[] args) 18 | { 19 | new ElisionTest2(); 20 | } 21 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/EscapeTestUnboxing.java: -------------------------------------------------------------------------------- 1 | import java.util.Vector; 2 | import java.util.Random; 3 | 4 | public class EscapeTestUnboxing 5 | { 6 | private java.util.Random random = new java.util.Random(); 7 | 8 | public EscapeTestUnboxing() 9 | { 10 | long sum = 0; 11 | 12 | for (int i = 0; i < 100_000; i++) 13 | { 14 | if (random.nextBoolean()) 15 | { 16 | Integer asInteger = Integer.valueOf(i); 17 | 18 | sum += asInteger; 19 | } 20 | } 21 | 22 | System.out.println(sum); 23 | } 24 | 25 | public static void main(String[] args) 26 | { 27 | new EscapeTestUnboxing(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/HotThrow.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | 3 | public class HotThrow 4 | { 5 | private Random random = new Random(); 6 | 7 | public HotThrow() 8 | { 9 | StringBuilder builder = new StringBuilder(); 10 | 11 | String string = "The quick brown fox jumps over the lazy dog"; 12 | 13 | char[] chars = string.toCharArray(); 14 | 15 | for (int i = 0 ; i < 1_000_000; i++) 16 | { 17 | int index = random.nextInt(100); 18 | 19 | char c = getChar(chars, index); 20 | 21 | builder.append(c); 22 | } 23 | 24 | System.out.println(builder.toString()); 25 | } 26 | 27 | public char getChar(char[] chars, int index) 28 | { 29 | try 30 | { 31 | return chars[index]; 32 | } 33 | catch(ArrayIndexOutOfBoundsException e) 34 | { 35 | return '*'; 36 | } 37 | } 38 | 39 | public static void main(String[] args) 40 | { 41 | new HotThrow(); 42 | } 43 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/Inc.scala: -------------------------------------------------------------------------------- 1 | object Inc { 2 | def main(args: Array[String]):Unit = 3 | { 4 | var i:Int=0 5 | 6 | for(j <- (1 to 1000000000)) 7 | { 8 | i = inc(i) 9 | } 10 | 11 | println(i); 12 | } 13 | 14 | def inc(i:Int):Int=i+1 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/IncWhile.scala: -------------------------------------------------------------------------------- 1 | object IncWhile { 2 | def main(args: Array[String]):Unit = 3 | { 4 | var i:Int=0 5 | var limit = 0; 6 | 7 | while(limit < 1000000000) 8 | { 9 | i = inc(i) 10 | limit = limit + 1; 11 | } 12 | 13 | println(i); 14 | } 15 | 16 | def inc(i:Int):Int=i+1 17 | } 18 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/InlineElimAlloc.java: -------------------------------------------------------------------------------- 1 | public class InlineElimAlloc 2 | { 3 | public long outer(int i) 4 | { 5 | long sum = 0; 6 | 7 | for (int j = 0; j < 20_000; j++) 8 | { 9 | sum += inner(i, j); 10 | } 11 | 12 | return sum; 13 | } 14 | 15 | public long inner(int i, int j) 16 | { 17 | long sum = 0; 18 | 19 | int[] parts = new int[2]; 20 | 21 | parts[0] = i; 22 | parts[1] = j; 23 | 24 | java.util.Random random = new java.util.Random(); 25 | 26 | if (random.nextBoolean()) 27 | { 28 | sum += parts[0]; 29 | } 30 | else 31 | { 32 | sum += parts[1]; 33 | } 34 | 35 | return sum; 36 | } 37 | 38 | public static void main(final String[] args) 39 | { 40 | InlineElimAlloc test = new InlineElimAlloc(); 41 | 42 | long sum = 0; 43 | 44 | for (int i = 0; i < 20_000; i++) 45 | { 46 | sum += test.outer(i); 47 | } 48 | 49 | System.out.println(sum); 50 | } 51 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/IntrinsicTest.java: -------------------------------------------------------------------------------- 1 | public class IntrinsicTest 2 | { 3 | public IntrinsicTest(int iterations) 4 | { 5 | long dstSum = 0; 6 | int[] src = new int[] { 1, 2, 3, 4, 5 }; 7 | int[] dst = new int[src.length]; 8 | 9 | for (int i = 0; i < iterations; i++) 10 | { 11 | // x86 has intrinsic for System.arrayCopy 12 | System.arraycopy(src, 0, dst, 0, src.length); 13 | 14 | for (int dstVal : dst) 15 | { 16 | dstSum += add(dstSum, dstVal); 17 | } 18 | } 19 | 20 | System.out.println("intrinsicTest: " + dstSum); 21 | } 22 | 23 | private long add(long a, long b) 24 | { 25 | return a + b; 26 | } 27 | 28 | public static void main(String[] args) 29 | { 30 | new IntrinsicTest(100_000); 31 | } 32 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/Lambda.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.util.stream.*; 3 | 4 | public class Lambda 5 | { 6 | public static void main(String[] args) 7 | { 8 | List items = new ArrayList<>(); 9 | 10 | items.add("apple"); 11 | items.add("banana"); 12 | items.add("blueberry"); 13 | items.add("cherry"); 14 | items.add("pineapple"); 15 | items.add("pear"); 16 | items.add("strawberry"); 17 | 18 | List filtered = items.stream().filter( item -> item.startsWith("b") ).collect(Collectors.toList()); 19 | 20 | for (Object str : filtered) 21 | { 22 | System.out.println(str); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/LockCoarsen.java: -------------------------------------------------------------------------------- 1 | public class LockCoarsen 2 | { 3 | public LockCoarsen() 4 | { 5 | java.util.Random random = new java.util.Random(); 6 | 7 | long sum = 0; 8 | 9 | Object lock = new Object(); 10 | 11 | for (int i = 0; i < 1_000_000; i++) 12 | { 13 | synchronized(lock) 14 | { 15 | sum += random.nextLong(); 16 | } 17 | 18 | synchronized(lock) 19 | { 20 | sum -= random.nextLong(); 21 | } 22 | } 23 | 24 | System.out.println(sum); 25 | } 26 | 27 | public static void main(String[] args) 28 | { 29 | new LockCoarsen(); 30 | } 31 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/LockEliminate.java: -------------------------------------------------------------------------------- 1 | public class LockEliminate 2 | { 3 | public LockEliminate() 4 | { 5 | long count = 0; 6 | 7 | for (int i = 0; i < 1_000_000; i++) 8 | { 9 | synchronized(this) 10 | { 11 | count = increment(count); 12 | count = decrement(count); 13 | } 14 | 15 | count = increment(count); 16 | } 17 | 18 | System.out.println(count); 19 | } 20 | 21 | private synchronized long increment(long input) 22 | { 23 | return input + 0xDEAD; 24 | } 25 | 26 | private synchronized long decrement(long input) 27 | { 28 | return input - 0xBEEF; 29 | } 30 | 31 | public static void main(String[] args) 32 | { 33 | new LockEliminate(); 34 | } 35 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/MegamorphicBypass.java: -------------------------------------------------------------------------------- 1 | public class MegamorphicBypass 2 | { 3 | public interface Coin { void deposit(); } 4 | 5 | public class Nickel implements Coin { public void deposit() { moneyBox += 5; } } 6 | 7 | public class Dime implements Coin { public void deposit() { moneyBox += 10; } } 8 | 9 | public class Quarter implements Coin { public void deposit() { moneyBox += 25; } } 10 | 11 | public static int moneyBox = 0; 12 | 13 | public MegamorphicBypass() 14 | { 15 | Coin nickel = new Nickel(); 16 | Coin dime = new Dime(); 17 | Coin quarter = new Quarter(); 18 | 19 | Coin coin = null; 20 | 21 | final int maxImplementations = 3; 22 | 23 | for (int i = 0; i < 1_000_000; i++) 24 | { 25 | switch(i % maxImplementations) 26 | { 27 | case 0: coin = nickel; break; 28 | case 1: coin = dime; break; 29 | case 2: coin = quarter; break; 30 | } 31 | 32 | // peel off one type with an instanceof check 33 | if (coin instanceof Nickel) 34 | { 35 | coin.deposit(); 36 | } 37 | else 38 | { 39 | // this callsite will now only observe 2 types and can use bimorphic inlining 40 | coin.deposit(); 41 | } 42 | } 43 | 44 | System.out.println("moneyBox:" + moneyBox); 45 | } 46 | 47 | public static void main(String[] args) { 48 | new MegamorphicBypass(); 49 | } 50 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/OSRTest.java: -------------------------------------------------------------------------------- 1 | public class OSRTest 2 | { 3 | public OSRTest() 4 | { 5 | long sum = 0; 6 | 7 | java.util.Random r = new java.util.Random(); 8 | 9 | for (int i = 0; i < 100_000; i++) 10 | { 11 | sum += r.nextInt(); 12 | } 13 | 14 | for (int i = 0; i < 100_000; i++) 15 | { 16 | sum -= r.nextInt(); 17 | } 18 | 19 | for (int i = 0; i < 100_000; i++) 20 | { 21 | sum *= r.nextInt(); 22 | } 23 | 24 | for (int i = 0; i < 100_000; i++) 25 | { 26 | sum /= r.nextInt(); 27 | } 28 | 29 | System.out.println(sum); 30 | } 31 | 32 | public static void main(String[] args) 33 | { 34 | new OSRTest(); 35 | } 36 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/PolymorphismTest.java: -------------------------------------------------------------------------------- 1 | public class PolymorphismTest 2 | { 3 | public interface Coin 4 | { 5 | void deposit(); 6 | } 7 | 8 | public static int moneyBox = 0; 9 | 10 | public class Nickel implements Coin 11 | { 12 | public void deposit() 13 | { 14 | moneyBox += 5; 15 | } 16 | } 17 | 18 | public class Dime implements Coin 19 | { 20 | public void deposit() 21 | { 22 | moneyBox += 10; 23 | } 24 | } 25 | 26 | public class Quarter implements Coin 27 | { 28 | public void deposit() 29 | { 30 | moneyBox += 25; 31 | } 32 | } 33 | 34 | public PolymorphismTest() 35 | { 36 | Coin nickel = new Nickel(); 37 | Coin dime = new Dime(); 38 | Coin quarter = new Quarter(); 39 | 40 | Coin coin = null; 41 | 42 | // change the variable maxImplementations to control the inlining behaviour 43 | // 2 = bimorphic dispatch - the method call will be inlined 44 | // 3 = megamorphic dispatch - the method call will not be inlined 45 | 46 | final int maxImplementations = 2; 47 | 48 | for (int i = 0; i < 1_000_000; i++) 49 | { 50 | switch(i % maxImplementations) 51 | { 52 | case 0: coin = nickel; break; 53 | case 1: coin = dime; break; 54 | case 2: coin = quarter; break; 55 | } 56 | 57 | coin.deposit(); 58 | } 59 | 60 | System.out.println("moneyBox:" + moneyBox); 61 | } 62 | 63 | public static void main(String[] args) 64 | { 65 | new PolymorphismTest(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/SafePointTest.java: -------------------------------------------------------------------------------- 1 | public class SafePointTest 2 | { 3 | // Safepoints should appear at: 4 | // (1) back branch of uncounted loops 5 | // (2) entry to non-inlined method 6 | // (3) exit of non-inlined method 7 | 8 | private long count = 0; 9 | private long anotherCounter = 0; 10 | 11 | private long endTime = System.currentTimeMillis() + 5_000; 12 | 13 | public SafePointTest() 14 | { 15 | while (System.currentTimeMillis() < endTime) 16 | { 17 | count+= 0xFEED; 18 | } 19 | 20 | System.out.println("I counted to " + count); 21 | 22 | endTime += 5_000; 23 | 24 | while (System.currentTimeMillis() < endTime) 25 | { 26 | incCounter(); 27 | } 28 | 29 | System.out.println("I counted to " + anotherCounter); 30 | } 31 | 32 | // -XX:CompileCommand=dontinline,SafePointTest.incCounter 33 | public void incCounter() 34 | { 35 | anotherCounter += 0xBEEF; 36 | } 37 | 38 | public static void main(String[] args) 39 | { 40 | new SafePointTest(); 41 | } 42 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/SimpleInliningTest.java: -------------------------------------------------------------------------------- 1 | // The Sandbox is designed to help you learn about the HotSpot JIT compilers. 2 | // Please note that the JIT compilers may behave differently when isolating a method 3 | // in the Sandbox compared to running your whole application. 4 | 5 | public class SimpleInliningTest 6 | { 7 | public SimpleInliningTest() 8 | { 9 | int sum = 0; 10 | 11 | // 1_000_000 is F4240 in hex 12 | for (int i = 0 ; i < 1_000_000; i++) 13 | { 14 | sum = this.add(sum, 99); // 63 hex 15 | } 16 | 17 | System.out.println("Sum:" + sum); 18 | } 19 | 20 | public int add(int a, int b) 21 | { 22 | return a + b; 23 | } 24 | 25 | public static void main(String[] args) 26 | { 27 | new SimpleInliningTest(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/Sort.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | import java.util.Random; 3 | 4 | public class Sort 5 | { 6 | public static final int ARRAY_LENGTH = 1_000_000; 7 | public double[] doubleArray1 = new double[ARRAY_LENGTH]; 8 | public double[] doubleArray2 = new double[ARRAY_LENGTH]; 9 | 10 | public Sort() 11 | { 12 | fillArrays(); 13 | 14 | long count1 = countGreaterThanHalfWithSort(doubleArray1); 15 | long count2 = countGreaterThanHalfWithoutSort(doubleArray2); 16 | 17 | System.out.println(count1); 18 | System.out.println(count2); 19 | } 20 | 21 | private void fillArrays() 22 | { 23 | Random random = new Random(19762211); 24 | 25 | for (int i = 0; i < ARRAY_LENGTH; i++) 26 | { 27 | double next = random.nextDouble(); 28 | 29 | doubleArray1[i] = next; 30 | doubleArray2[i] = next; 31 | } 32 | } 33 | 34 | private long countGreaterThanHalfWithSort(double[] theDoubles) 35 | { 36 | long count = 0; 37 | 38 | Arrays.sort(theDoubles); 39 | 40 | for (int i = 0; i < ARRAY_LENGTH; i++) 41 | { 42 | if (theDoubles[i] > 0.5) 43 | { 44 | count++; 45 | } 46 | } 47 | return count; 48 | } 49 | 50 | private long countGreaterThanHalfWithoutSort(double[] theDoubles) 51 | { 52 | long count = 0; 53 | 54 | for (int i = 0; i < ARRAY_LENGTH; i++) 55 | { 56 | if (theDoubles[i] > 0.5) 57 | { 58 | count++; 59 | } 60 | } 61 | return count; 62 | } 63 | 64 | public static void main(String[] args) 65 | { 66 | new Sort(); 67 | } 68 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/StringBufferLockElision.java: -------------------------------------------------------------------------------- 1 | public class StringBufferLockElision 2 | { 3 | public StringBufferLockElision() 4 | { 5 | StringBuffer buffer = new StringBuffer(); 6 | 7 | for (int i = 0; i < 500_000; i++) 8 | { 9 | String joined = concatPieces("a", "b", "c"); 10 | 11 | buffer.append(joined); 12 | } 13 | 14 | System.out.println(buffer.toString()); 15 | } 16 | 17 | private String concatPieces(String one, String two, String three) 18 | { 19 | StringBuffer buffer = new StringBuffer(); 20 | 21 | buffer.append(one); 22 | buffer.append(two); 23 | buffer.append(three); 24 | 25 | return buffer.toString(); 26 | } 27 | 28 | public static void main(String[] args) 29 | { 30 | new StringBufferLockElision(); 31 | } 32 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/TailRec.scala: -------------------------------------------------------------------------------- 1 | import scala.annotation.tailrec 2 | 3 | object TailRec { 4 | def main(args: Array[String]):Unit = 5 | { 6 | var i = inc(0, 1000000000) 7 | 8 | println(i); 9 | } 10 | 11 | @tailrec 12 | def inc(i:Int, iter:Int): 13 | Int=if (iter>0) 14 | inc(i+1, iter-1) 15 | else i 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/TestInner.java: -------------------------------------------------------------------------------- 1 | public class TestInner 2 | { 3 | public TestInner() 4 | { 5 | System.out.println("TestInner()"); 6 | 7 | a(); 8 | 9 | new Inner1(); 10 | } 11 | 12 | public void a() 13 | { 14 | System.out.println("TestInner.a()"); 15 | } 16 | 17 | class Inner1 18 | { 19 | public Inner1() 20 | { 21 | System.out.println("TestInner.Inner1()"); 22 | 23 | b(); 24 | 25 | new Inner2(); 26 | } 27 | 28 | public void b() 29 | { 30 | System.out.println("TestInner.Inner1.b()"); 31 | } 32 | 33 | class Inner2 34 | { 35 | public Inner2() 36 | { 37 | System.out.println("TestInner.Inner1.Inner2()"); 38 | 39 | c(); 40 | } 41 | 42 | public void c() 43 | { 44 | System.out.println("TestInner.Inner1.Inner2.c()"); 45 | } 46 | 47 | } 48 | } 49 | 50 | public static void main(String[] args) 51 | { 52 | new TestInner(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/TrivialMethod.java: -------------------------------------------------------------------------------- 1 | public class TrivialMethod 2 | { 3 | private int count; 4 | 5 | public TrivialMethod() 6 | { 7 | StringBuilder builder = new StringBuilder(); 8 | 9 | for (int i = 0 ; i < 1_000_000; i++) 10 | { 11 | incCount(); 12 | 13 | int localCount = getCount(); 14 | 15 | builder.append(localCount).append("\n"); 16 | } 17 | 18 | System.out.println(builder.toString()); 19 | } 20 | 21 | public int getCount() 22 | { 23 | return count; 24 | } 25 | 26 | public void incCount() 27 | { 28 | count++; 29 | } 30 | 31 | public static void main(String[] args) 32 | { 33 | new TrivialMethod(); 34 | } 35 | } -------------------------------------------------------------------------------- /core/src/main/resources/examples/UpperCase.java: -------------------------------------------------------------------------------- 1 | import java.util.Locale; 2 | 3 | public class UpperCase 4 | { 5 | public String upper; 6 | 7 | public UpperCase() 8 | { 9 | int iterations = 10_000_000; 10 | 11 | String source = "Lorem ipsum dolor sit amet, sensibus partiendo eam at."; 12 | 13 | long start = System.currentTimeMillis(); 14 | convertString(source, iterations); 15 | System.out.println(upper); 16 | System.out.println(System.currentTimeMillis() - start); 17 | 18 | start = System.currentTimeMillis(); 19 | convertCustom(source, iterations); 20 | System.out.println(upper); 21 | System.out.println(System.currentTimeMillis() - start); 22 | } 23 | 24 | private void convertString(String source, int iterations) 25 | { 26 | for (int i = 0; i < iterations; i++) 27 | { 28 | upper = source.toUpperCase(Locale.getDefault()); 29 | } 30 | } 31 | 32 | private void convertCustom(String source, int iterations) 33 | { 34 | for (int i = 0; i < iterations; i++) 35 | { 36 | upper = doUpper(source); 37 | } 38 | } 39 | 40 | private String doUpper(String source) 41 | { 42 | StringBuilder builder = new StringBuilder(); 43 | 44 | int len = source.length(); 45 | 46 | for (int i = 0; i < len; i++) 47 | { 48 | char c = source.charAt(i); 49 | 50 | if (c >= 'a' && c <= 'z') 51 | { 52 | c -= 32; 53 | } 54 | 55 | builder.append(c); 56 | } 57 | 58 | return builder.toString(); 59 | } 60 | 61 | public static void main(String[] args) 62 | { 63 | new UpperCase(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/hello.kt: -------------------------------------------------------------------------------- 1 | fun main(args: Array) { 2 | 3 | var x=1000000 4 | 5 | var sum=0 6 | 7 | while (x > 0) 8 | { 9 | x-- 10 | sum = inc(sum) 11 | } 12 | 13 | println("sum " + sum) 14 | } 15 | 16 | fun inc(x: Int): Int 17 | { 18 | return x+1 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/resources/examples/run.js: -------------------------------------------------------------------------------- 1 | var sum = 0; 2 | 3 | for (var i = 0; i < 1000000; i++) 4 | { 5 | sum = addOne(sum); 6 | sum = addTwo(sum); 7 | } 8 | 9 | print(sum); 10 | 11 | function addOne(number) 12 | { 13 | return add(number, 1); 14 | } 15 | 16 | function addTwo(number) 17 | { 18 | return add(number, 2); 19 | } 20 | 21 | function add(x, y) 22 | { 23 | return x + y; 24 | } 25 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib 2 | kotlin.stdlib.default.dependency=false 3 | # Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html 4 | org.gradle.configuration-cache=true 5 | # Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html 6 | org.gradle.caching=true 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /nasm/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2020 Aidan Khoury 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /nasm/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("java") 3 | id("org.jetbrains.intellij") version "1.17.4" 4 | } 5 | 6 | group = "org.intellij.sdk" 7 | version = "0.6.0" 8 | 9 | intellij { 10 | version.set("2023.2.6") 11 | } 12 | 13 | sourceSets { 14 | main { 15 | java { 16 | setSrcDirs(listOf("src/main/java", "gen")) 17 | } 18 | } 19 | } 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | java { 26 | sourceCompatibility = JavaVersion.VERSION_17 27 | } 28 | 29 | tasks.named("runIde").configure { 30 | enabled = false 31 | } 32 | 33 | tasks.named("buildPlugin").configure { 34 | enabled = false 35 | } -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/NASMLexer.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage; 2 | 3 | import com.intellij.lexer.FlexAdapter; 4 | 5 | public class NASMLexer extends FlexAdapter { 6 | public NASMLexer() { 7 | super(new _NASMLexer()); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMAddress.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMAddress extends NASMExpr { 9 | 10 | @Nullable 11 | NASMExpr getExpr(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMAssign.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMAssign extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @NotNull 14 | PsiElement getAssignTag(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitShiftLExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitShiftLExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitShiftRExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitShiftRExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitwiseANDExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitwiseANDExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitwiseNOTExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitwiseNOTExpr extends NASMExpr { 9 | 10 | @Nullable 11 | NASMExpr getExpr(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitwiseORExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitwiseORExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMBitwiseXORExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMBitwiseXORExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMConditional.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMConditional extends PsiElement { 9 | 10 | @NotNull 11 | List getConstantList(); 12 | 13 | @NotNull 14 | List getDataElementList(); 15 | 16 | @NotNull 17 | List getDirectiveList(); 18 | 19 | @NotNull 20 | List getExprList(); 21 | 22 | @NotNull 23 | List getInstructionList(); 24 | 25 | @NotNull 26 | List getLabelList(); 27 | 28 | @NotNull 29 | List getPreprocessorList(); 30 | 31 | @NotNull 32 | List getStructureList(); 33 | 34 | @NotNull 35 | PsiElement getEndifTag(); 36 | 37 | @Nullable 38 | PsiElement getIfctxTag(); 39 | 40 | @Nullable 41 | PsiElement getIfdefTag(); 42 | 43 | @Nullable 44 | PsiElement getIfidnTag(); 45 | 46 | @Nullable 47 | PsiElement getIfidTag(); 48 | 49 | @Nullable 50 | PsiElement getIfmacroTag(); 51 | 52 | @Nullable 53 | PsiElement getIfnumTag(); 54 | 55 | @Nullable 56 | PsiElement getIfstrTag(); 57 | 58 | @Nullable 59 | PsiElement getIfTag(); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMConstant.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMConstant extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @NotNull 14 | PsiElement getEqu(); 15 | 16 | @NotNull 17 | PsiElement getId(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMDataElement.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMDataElement extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @NotNull 14 | PsiElement getDataOp(); 15 | 16 | @Nullable 17 | PsiElement getId(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMDefine.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMDefine extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @NotNull 14 | PsiElement getDefineTag(); 15 | 16 | NASMIdentifier getDefineIdentifier(); 17 | 18 | String getDefineIdentifierString(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMDirective.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMDirective extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @Nullable 14 | NASMMapOption getMapOption(); 15 | 16 | @Nullable 17 | PsiElement getDirectiveOp(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMDirectiveArg.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMDirectiveArg extends PsiElement { 9 | 10 | @NotNull 11 | NASMExpr getExpr(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMDivExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMDivExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMEndDirective.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMEndDirective extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getEndDirectiveOp(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMError.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMError extends PsiElement { 9 | 10 | @NotNull 11 | PsiElement getErrorTag(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMExpr extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMIStruc.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMIStruc extends PsiElement { 9 | 10 | @NotNull 11 | List getConditionalList(); 12 | 13 | @NotNull 14 | List getExprList(); 15 | 16 | @NotNull 17 | PsiElement getIendTag(); 18 | 19 | @NotNull 20 | PsiElement getIstrucTag(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMIdentifier.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | 6 | import com.intellij.navigation.ItemPresentation; 7 | import com.intellij.psi.PsiReference; 8 | import com.intellij.psi.PsiElement; 9 | import org.jetbrains.annotations.*; 10 | 11 | public interface NASMIdentifier extends NASMExpr, NASMNamedElement { 12 | 13 | @Nullable 14 | PsiElement getId(); 15 | 16 | @Nullable 17 | PsiElement getMacroParamRef(); 18 | 19 | @Nullable 20 | PsiElement getMacroVarRef(); 21 | 22 | String getName(); 23 | 24 | PsiElement setName(String newName); 25 | 26 | @NotNull 27 | PsiElement getNameIdentifier(); 28 | 29 | ItemPresentation getPresentation(); 30 | 31 | @NotNull 32 | PsiReference[] getReferences(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMInclude.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMInclude extends PsiElement { 9 | 10 | @Nullable 11 | PsiElement getIdExtension(); 12 | 13 | @NotNull 14 | PsiElement getIncludeTag(); 15 | 16 | @Nullable 17 | PsiElement getString(); 18 | 19 | String getIncludeString(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMInstruction.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMInstruction extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @Nullable 14 | PsiElement getId(); 15 | 16 | @Nullable 17 | PsiElement getSizeType(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLabel.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMLabel extends NASMNamedElement { 9 | 10 | @Nullable 11 | NASMDataElement getDataElement(); 12 | 13 | @Nullable 14 | NASMExpr getExpr(); 15 | 16 | @Nullable 17 | NASMInstruction getInstruction(); 18 | 19 | @Nullable 20 | NASMLabelDefMacro getLabelDefMacro(); 21 | 22 | @Nullable 23 | NASMStructure getStructure(); 24 | 25 | @Nullable 26 | PsiElement getLbl(); 27 | 28 | @Nullable 29 | PsiElement getLblDef(); 30 | 31 | String getName(); 32 | 33 | PsiElement setName(String newName); 34 | 35 | PsiElement getNameIdentifier(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLabelDefMacro.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMLabelDefMacro extends PsiElement { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @NotNull 14 | PsiElement getId(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLabelIdentifier.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | 6 | import com.intellij.navigation.ItemPresentation; 7 | import com.intellij.psi.PsiReference; 8 | import com.intellij.psi.PsiElement; 9 | import org.jetbrains.annotations.*; 10 | 11 | public interface NASMLabelIdentifier extends NASMExpr, NASMNamedElement { 12 | 13 | @Nullable 14 | PsiElement getId(); 15 | 16 | @Nullable 17 | PsiElement getLbl(); 18 | 19 | @Nullable 20 | PsiElement getMacroParamLblDef(); 21 | 22 | @Nullable 23 | PsiElement getSizeType(); 24 | 25 | String getName(); 26 | 27 | PsiElement setName(String newName); 28 | 29 | PsiElement getNameIdentifier(); 30 | 31 | ItemPresentation getPresentation(); 32 | 33 | @NotNull 34 | PsiReference[] getReferences(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLogicalANDExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMLogicalANDExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLogicalORExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMLogicalORExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMLogicalXORExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMLogicalXORExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacro.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacro extends PsiElement { 9 | 10 | @NotNull 11 | List getDataElementList(); 12 | 13 | @NotNull 14 | List getDirectiveList(); 15 | 16 | @NotNull 17 | List getExprList(); 18 | 19 | @NotNull 20 | List getInstructionList(); 21 | 22 | @NotNull 23 | List getLabelList(); 24 | 25 | @NotNull 26 | List getMacroLabelList(); 27 | 28 | @NotNull 29 | List getPreprocessorList(); 30 | 31 | @Nullable 32 | PsiElement getMacroEndTag(); 33 | 34 | @Nullable 35 | PsiElement getMacroNolistQual(); 36 | 37 | @NotNull 38 | PsiElement getMacroTag(); 39 | 40 | @Nullable 41 | PsiElement getRegister(); 42 | 43 | @Nullable 44 | PsiElement getString(); 45 | 46 | String getMacroIdentifierString(); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroCall.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroCall extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroDefCall.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroDefCall extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroDefinitionCall.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroDefinitionCall extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroLabel.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroLabel extends PsiElement { 9 | 10 | @Nullable 11 | NASMDataElement getDataElement(); 12 | 13 | @Nullable 14 | NASMInstruction getInstruction(); 15 | 16 | @NotNull 17 | PsiElement getMacroParamLblDef(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroParamCounter.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroParamCounter extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getMacroParamCount(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroParamReference.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroParamReference extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getMacroParamRef(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMacroVarReference.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMacroVarReference extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getMacroVarRef(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMapOption.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMapOption extends PsiElement { 9 | 10 | @NotNull 11 | PsiElement getMapFile(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMinusExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMinusExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMnemonic.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMnemonic extends NASMExpr { 9 | 10 | @Nullable 11 | PsiElement getAvx2Op(); 12 | 13 | @Nullable 14 | PsiElement getAvx512Op(); 15 | 16 | @Nullable 17 | PsiElement getAvxOp(); 18 | 19 | @Nullable 20 | PsiElement getFpuOp(); 21 | 22 | @Nullable 23 | PsiElement getGeneralOp(); 24 | 25 | @Nullable 26 | PsiElement getMmxOp(); 27 | 28 | @Nullable 29 | PsiElement getSse2Op(); 30 | 31 | @Nullable 32 | PsiElement getSse3Op(); 33 | 34 | @Nullable 35 | PsiElement getSse4Op(); 36 | 37 | @Nullable 38 | PsiElement getSseOp(); 39 | 40 | @Nullable 41 | PsiElement getSystemOp(); 42 | 43 | @Nullable 44 | PsiElement getVirtualizationOp(); 45 | 46 | @Nullable 47 | PsiElement getX64Op(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMModulusExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMModulusExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMMulExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMMulExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMNumericLiteral.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMNumericLiteral extends NASMExpr { 9 | 10 | @Nullable 11 | PsiElement getBinary(); 12 | 13 | @Nullable 14 | PsiElement getCharacter(); 15 | 16 | @Nullable 17 | PsiElement getDecimal(); 18 | 19 | @Nullable 20 | PsiElement getFloatDecimal(); 21 | 22 | @Nullable 23 | PsiElement getHexadecimal(); 24 | 25 | @Nullable 26 | PsiElement getSizeType(); 27 | 28 | @Nullable 29 | PsiElement getZeroes(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMParenthesisExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMParenthesisExpr extends NASMExpr { 9 | 10 | @Nullable 11 | NASMExpr getExpr(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMPlusExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMPlusExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMPreprocessor.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMPreprocessor extends PsiElement { 9 | 10 | @Nullable 11 | NASMAssign getAssign(); 12 | 13 | @Nullable 14 | NASMConditional getConditional(); 15 | 16 | @Nullable 17 | NASMDefine getDefine(); 18 | 19 | @Nullable 20 | NASMError getError(); 21 | 22 | @Nullable 23 | NASMExpr getExpr(); 24 | 25 | @Nullable 26 | NASMInclude getInclude(); 27 | 28 | @Nullable 29 | NASMMacro getMacro(); 30 | 31 | @Nullable 32 | NASMStrlen getStrlen(); 33 | 34 | @Nullable 35 | PsiElement getPreprocessorOp(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMReg.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMReg extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getRegister(); 12 | 13 | @Nullable 14 | PsiElement getSizeType(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMSeg.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMSeg extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getSegmentRegister(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMSegmentAddress.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMSegmentAddress extends NASMExpr { 9 | 10 | @Nullable 11 | NASMExpr getExpr(); 12 | 13 | @Nullable 14 | NASMLabelDefMacro getLabelDefMacro(); 15 | 16 | @Nullable 17 | PsiElement getHexadecimal(); 18 | 19 | @Nullable 20 | PsiElement getId(); 21 | 22 | @Nullable 23 | PsiElement getLbl(); 24 | 25 | @Nullable 26 | PsiElement getLblDef(); 27 | 28 | @Nullable 29 | PsiElement getSegmentAddrL(); 30 | 31 | @Nullable 32 | PsiElement getZeroes(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMStr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMStr extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getString(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMStrlen.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMStrlen extends PsiElement { 9 | 10 | @NotNull 11 | NASMIdentifier getIdentifier(); 12 | 13 | @Nullable 14 | PsiElement getId(); 15 | 16 | @Nullable 17 | PsiElement getString(); 18 | 19 | @NotNull 20 | PsiElement getStrlenTag(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMStruc.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMStruc extends PsiElement { 9 | 10 | @NotNull 11 | List getConditionalList(); 12 | 13 | @NotNull 14 | List getExprList(); 15 | 16 | @NotNull 17 | PsiElement getEndstrucTag(); 18 | 19 | @NotNull 20 | PsiElement getStrucTag(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMStructure.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMStructure extends PsiElement { 9 | 10 | @Nullable 11 | NASMIStruc getIStruc(); 12 | 13 | @Nullable 14 | NASMStruc getStruc(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMStructureField.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMStructureField extends NASMExpr { 9 | 10 | @NotNull 11 | PsiElement getIdExtension(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/NASMTokenConcatExpr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface NASMTokenConcatExpr extends NASMExpr { 9 | 10 | @NotNull 11 | List getExprList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMAddressImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMAddressImpl extends NASMExprImpl implements NASMAddress { 14 | 15 | public NASMAddressImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitAddress(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public NASMExpr getExpr() { 33 | return findChildByClass(NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMAssignImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMAssignImpl extends ASTWrapperPsiElement implements NASMAssign { 15 | 16 | public NASMAssignImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitAssign(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @NotNull 38 | public PsiElement getAssignTag() { 39 | return findNotNullChildByType(ASSIGN_TAG); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitShiftLExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitShiftLExprImpl extends NASMExprImpl implements NASMBitShiftLExpr { 14 | 15 | public NASMBitShiftLExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitShiftLExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitShiftRExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitShiftRExprImpl extends NASMExprImpl implements NASMBitShiftRExpr { 14 | 15 | public NASMBitShiftRExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitShiftRExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitwiseANDExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitwiseANDExprImpl extends NASMExprImpl implements NASMBitwiseANDExpr { 14 | 15 | public NASMBitwiseANDExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitwiseANDExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitwiseNOTExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitwiseNOTExprImpl extends NASMExprImpl implements NASMBitwiseNOTExpr { 14 | 15 | public NASMBitwiseNOTExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitwiseNOTExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public NASMExpr getExpr() { 33 | return findChildByClass(NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitwiseORExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitwiseORExprImpl extends NASMExprImpl implements NASMBitwiseORExpr { 14 | 15 | public NASMBitwiseORExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitwiseORExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMBitwiseXORExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMBitwiseXORExprImpl extends NASMExprImpl implements NASMBitwiseXORExpr { 14 | 15 | public NASMBitwiseXORExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitBitwiseXORExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMConstantImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMConstantImpl extends ASTWrapperPsiElement implements NASMConstant { 15 | 16 | public NASMConstantImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitConstant(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @NotNull 38 | public PsiElement getEqu() { 39 | return findNotNullChildByType(EQU); 40 | } 41 | 42 | @Override 43 | @NotNull 44 | public PsiElement getId() { 45 | return findNotNullChildByType(ID); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMDataElementImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMDataElementImpl extends ASTWrapperPsiElement implements NASMDataElement { 15 | 16 | public NASMDataElementImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitDataElement(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @NotNull 38 | public PsiElement getDataOp() { 39 | return findNotNullChildByType(DATA_OP); 40 | } 41 | 42 | @Override 43 | @Nullable 44 | public PsiElement getId() { 45 | return findChildByType(ID); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMDirectiveImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMDirectiveImpl extends ASTWrapperPsiElement implements NASMDirective { 15 | 16 | public NASMDirectiveImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitDirective(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public NASMMapOption getMapOption() { 39 | return findChildByClass(NASMMapOption.class); 40 | } 41 | 42 | @Override 43 | @Nullable 44 | public PsiElement getDirectiveOp() { 45 | return findChildByType(DIRECTIVE_OP); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMDivExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMDivExprImpl extends NASMExprImpl implements NASMDivExpr { 14 | 15 | public NASMDivExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitDivExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMEndDirectiveImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMEndDirectiveImpl extends NASMExprImpl implements NASMEndDirective { 14 | 15 | public NASMEndDirectiveImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitEndDirective(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getEndDirectiveOp() { 33 | return findNotNullChildByType(END_DIRECTIVE_OP); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMErrorImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMErrorImpl extends ASTWrapperPsiElement implements NASMError { 15 | 16 | public NASMErrorImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitError(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getErrorTag() { 33 | return findNotNullChildByType(ERROR_TAG); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public abstract class NASMExprImpl extends ASTWrapperPsiElement implements NASMExpr { 15 | 16 | public NASMExprImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMIncludeImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMIncludeImpl extends ASTWrapperPsiElement implements NASMInclude { 15 | 16 | public NASMIncludeImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitInclude(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public PsiElement getIdExtension() { 33 | return findChildByType(ID_EXTENSION); 34 | } 35 | 36 | @Override 37 | @NotNull 38 | public PsiElement getIncludeTag() { 39 | return findNotNullChildByType(INCLUDE_TAG); 40 | } 41 | 42 | @Override 43 | @Nullable 44 | public PsiElement getString() { 45 | return findChildByType(STRING); 46 | } 47 | 48 | @Override 49 | public String getIncludeString() { 50 | return NASMPsiImplUtil.getIncludeString(this); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMInstructionImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMInstructionImpl extends ASTWrapperPsiElement implements NASMInstruction { 15 | 16 | public NASMInstructionImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitInstruction(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getId() { 39 | return findChildByType(ID); 40 | } 41 | 42 | @Override 43 | @Nullable 44 | public PsiElement getSizeType() { 45 | return findChildByType(SIZE_TYPE); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMLabelDefMacroImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMLabelDefMacroImpl extends ASTWrapperPsiElement implements NASMLabelDefMacro { 15 | 16 | public NASMLabelDefMacroImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitLabelDefMacro(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @NotNull 38 | public PsiElement getId() { 39 | return findNotNullChildByType(ID); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMLogicalANDExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMLogicalANDExprImpl extends NASMExprImpl implements NASMLogicalANDExpr { 14 | 15 | public NASMLogicalANDExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitLogicalANDExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMLogicalORExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMLogicalORExprImpl extends NASMExprImpl implements NASMLogicalORExpr { 14 | 15 | public NASMLogicalORExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitLogicalORExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMLogicalXORExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMLogicalXORExprImpl extends NASMExprImpl implements NASMLogicalXORExpr { 14 | 15 | public NASMLogicalXORExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitLogicalXORExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroCallImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMacroCallImpl extends NASMExprImpl implements NASMMacroCall { 14 | 15 | public NASMMacroCallImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroCall(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroDefCallImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMacroDefCallImpl extends NASMExprImpl implements NASMMacroDefCall { 14 | 15 | public NASMMacroDefCallImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroDefCall(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroLabelImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMMacroLabelImpl extends ASTWrapperPsiElement implements NASMMacroLabel { 15 | 16 | public NASMMacroLabelImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroLabel(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public NASMDataElement getDataElement() { 33 | return findChildByClass(NASMDataElement.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public NASMInstruction getInstruction() { 39 | return findChildByClass(NASMInstruction.class); 40 | } 41 | 42 | @Override 43 | @NotNull 44 | public PsiElement getMacroParamLblDef() { 45 | return findNotNullChildByType(MACRO_PARAM_LBL_DEF); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroParamCounterImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMacroParamCounterImpl extends NASMExprImpl implements NASMMacroParamCounter { 14 | 15 | public NASMMacroParamCounterImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroParamCounter(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getMacroParamCount() { 33 | return findNotNullChildByType(MACRO_PARAM_COUNT); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroParamReferenceImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMacroParamReferenceImpl extends NASMExprImpl implements NASMMacroParamReference { 14 | 15 | public NASMMacroParamReferenceImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroParamReference(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getMacroParamRef() { 33 | return findNotNullChildByType(MACRO_PARAM_REF); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMacroVarReferenceImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMacroVarReferenceImpl extends NASMExprImpl implements NASMMacroVarReference { 14 | 15 | public NASMMacroVarReferenceImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMacroVarReference(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getMacroVarRef() { 33 | return findNotNullChildByType(MACRO_VAR_REF); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMapOptionImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMMapOptionImpl extends ASTWrapperPsiElement implements NASMMapOption { 15 | 16 | public NASMMapOptionImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMapOption(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getMapFile() { 33 | return findNotNullChildByType(MAP_FILE); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMinusExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMinusExprImpl extends NASMExprImpl implements NASMMinusExpr { 14 | 15 | public NASMMinusExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMinusExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMModulusExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMModulusExprImpl extends NASMExprImpl implements NASMModulusExpr { 14 | 15 | public NASMModulusExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitModulusExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMMulExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMMulExprImpl extends NASMExprImpl implements NASMMulExpr { 14 | 15 | public NASMMulExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitMulExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMParenthesisExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMParenthesisExprImpl extends NASMExprImpl implements NASMParenthesisExpr { 14 | 15 | public NASMParenthesisExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitParenthesisExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public NASMExpr getExpr() { 33 | return findChildByClass(NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMPlusExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMPlusExprImpl extends NASMExprImpl implements NASMPlusExpr { 14 | 15 | public NASMPlusExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitPlusExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMRegImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMRegImpl extends NASMExprImpl implements NASMReg { 14 | 15 | public NASMRegImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitReg(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getRegister() { 33 | return findNotNullChildByType(REGISTER); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getSizeType() { 39 | return findChildByType(SIZE_TYPE); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMSegImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMSegImpl extends NASMExprImpl implements NASMSeg { 14 | 15 | public NASMSegImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitSeg(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getSegmentRegister() { 33 | return findNotNullChildByType(SEGMENT_REGISTER); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMStrImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMStrImpl extends NASMExprImpl implements NASMStr { 14 | 15 | public NASMStrImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitStr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getString() { 33 | return findNotNullChildByType(STRING); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMStrlenImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMStrlenImpl extends ASTWrapperPsiElement implements NASMStrlen { 15 | 16 | public NASMStrlenImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitStrlen(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public NASMIdentifier getIdentifier() { 33 | return findNotNullChildByClass(NASMIdentifier.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public PsiElement getId() { 39 | return findChildByType(ID); 40 | } 41 | 42 | @Override 43 | @Nullable 44 | public PsiElement getString() { 45 | return findChildByType(STRING); 46 | } 47 | 48 | @Override 49 | @NotNull 50 | public PsiElement getStrlenTag() { 51 | return findNotNullChildByType(STRLEN_TAG); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMStructureFieldImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMStructureFieldImpl extends NASMExprImpl implements NASMStructureField { 14 | 15 | public NASMStructureFieldImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitStructureField(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public PsiElement getIdExtension() { 33 | return findNotNullChildByType(ID_EXTENSION); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMStructureImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.intellij.extapi.psi.ASTWrapperPsiElement; 12 | import com.nasmlanguage.psi.*; 13 | 14 | public class NASMStructureImpl extends ASTWrapperPsiElement implements NASMStructure { 15 | 16 | public NASMStructureImpl(@NotNull ASTNode node) { 17 | super(node); 18 | } 19 | 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitStructure(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @Nullable 32 | public NASMIStruc getIStruc() { 33 | return findChildByClass(NASMIStruc.class); 34 | } 35 | 36 | @Override 37 | @Nullable 38 | public NASMStruc getStruc() { 39 | return findChildByClass(NASMStruc.class); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /nasm/gen/com/nasmlanguage/psi/impl/NASMTokenConcatExprImpl.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package com.nasmlanguage.psi.impl; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.lang.ASTNode; 7 | import com.intellij.psi.PsiElement; 8 | import com.intellij.psi.PsiElementVisitor; 9 | import com.intellij.psi.util.PsiTreeUtil; 10 | import static com.nasmlanguage.psi.NASMTypes.*; 11 | import com.nasmlanguage.psi.*; 12 | 13 | public class NASMTokenConcatExprImpl extends NASMExprImpl implements NASMTokenConcatExpr { 14 | 15 | public NASMTokenConcatExprImpl(@NotNull ASTNode node) { 16 | super(node); 17 | } 18 | 19 | @Override 20 | public void accept(@NotNull NASMVisitor visitor) { 21 | visitor.visitTokenConcatExpr(this); 22 | } 23 | 24 | @Override 25 | public void accept(@NotNull PsiElementVisitor visitor) { 26 | if (visitor instanceof NASMVisitor) accept((NASMVisitor)visitor); 27 | else super.accept(visitor); 28 | } 29 | 30 | @Override 31 | @NotNull 32 | public List getExprList() { 33 | return PsiTreeUtil.getChildrenOfTypeAsList(this, NASMExpr.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/NASMChooseByNameContributor.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage; 2 | 3 | import java.util.*; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | import com.intellij.navigation.*; 7 | import com.intellij.openapi.project.Project; 8 | import com.intellij.psi.PsiElement; 9 | 10 | import com.nasmlanguage.psi.NASMIdentifier; 11 | 12 | public class NASMChooseByNameContributor implements ChooseByNameContributor { 13 | @NotNull 14 | @Override 15 | public String[] getNames(Project project, boolean includeNonProjectItems) { 16 | List identifiers = NASMUtil.findIdentifierReferencesInProject(project); 17 | List names = new ArrayList<>(identifiers.size()); 18 | for (NASMIdentifier identifier : identifiers) { 19 | PsiElement idElement = identifier.getId(); 20 | if (idElement != null) { 21 | String identifierString = idElement.getText(); 22 | if (identifierString != null && identifierString.length() > 0) { 23 | names.add(identifierString); 24 | } 25 | } 26 | } 27 | return names.toArray(new String[names.size()]); 28 | } 29 | 30 | @NotNull 31 | @Override 32 | public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) { 33 | List identifiers = NASMUtil.findIdentifierReferencesByIdInProject(project, name); 34 | return identifiers.toArray(new NavigationItem[identifiers.size()]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/NASMCompletionContributor.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage; 2 | 3 | import com.intellij.codeInsight.completion.*; 4 | import com.intellij.codeInsight.lookup.LookupElementBuilder; 5 | import com.intellij.patterns.PlatformPatterns; 6 | import com.intellij.util.ProcessingContext; 7 | import com.nasmlanguage.psi.NASMTypes; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class NASMCompletionContributor extends DefaultCompletionContributor { 11 | 12 | public NASMCompletionContributor() { 13 | //noinspection Convert2Diamond 14 | extend(CompletionType.BASIC, 15 | PlatformPatterns.psiElement(NASMTypes.IDENTIFIER).withLanguage(NASMLanguage.INSTANCE), 16 | new CompletionProvider() { 17 | @Override 18 | protected void addCompletions(@NotNull CompletionParameters parameters, 19 | @NotNull ProcessingContext context, 20 | @NotNull CompletionResultSet resultSet) { 21 | resultSet.addElement(LookupElementBuilder.create("mov")); 22 | } 23 | } 24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/NASMIcons.java: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | NASM Assembly Language Plugin 4 | Copyright (c) 2017-2020 Aidan Khoury. All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | --*/ 25 | 26 | package com.nasmlanguage; 27 | 28 | import com.intellij.openapi.util.IconLoader; 29 | import javax.swing.Icon; 30 | 31 | public class NASMIcons { 32 | public static final Icon ASM_FILE = IconLoader.getIcon("/com/nasmlanguage/icons/FileType_asm.svg", NASMIcons.class); 33 | } 34 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/NASMNamesValidator.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage; 2 | 3 | import com.intellij.lang.refactoring.NamesValidator; 4 | import com.intellij.openapi.project.Project; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import java.util.regex.Pattern; 8 | 9 | public class NASMNamesValidator implements NamesValidator { 10 | private static final Pattern LBL_IDENTIFIER_PATTERN = Pattern.compile("([a-zA-Z$._?#@~]+[a-zA-Z0-9_]*)"); 11 | 12 | @Override 13 | public boolean isKeyword(@NotNull final String name, final Project project) { 14 | // TODO: Check if given name is a mnemonic? 15 | return false; 16 | } 17 | 18 | @Override 19 | public boolean isIdentifier(@NotNull final String name, final Project project) { 20 | return LBL_IDENTIFIER_PATTERN.matcher(name).matches(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/NASMRefactoringSupportProvider.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage; 2 | 3 | import com.intellij.lang.refactoring.RefactoringSupportProvider; 4 | import com.intellij.psi.PsiElement; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class NASMRefactoringSupportProvider extends RefactoringSupportProvider { 8 | @Override 9 | public boolean isAvailable(@NotNull PsiElement context) { 10 | // TODO: Add proper refactoring support. 11 | return false; 12 | } 13 | 14 | @Override 15 | public boolean isInplaceRenameAvailable(@NotNull PsiElement element, PsiElement context) { 16 | // TODO: Add proper refactoring support. 17 | return false; 18 | } 19 | 20 | @Override 21 | public boolean isMemberInplaceRenameAvailable(@NotNull PsiElement element, PsiElement context) { 22 | // TODO: Add proper refactoring support. 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/icons/FileType_asm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/icons/FileType_asm@2x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/parser/NASMParserUtil.java: -------------------------------------------------------------------------------- 1 | package com.nasmlanguage.parser; 2 | 3 | import com.intellij.lang.parser.GeneratedParserUtilBase; 4 | 5 | public class NASMParserUtil extends GeneratedParserUtilBase { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /nasm/src/main/java/com/nasmlanguage/psi/NASMNamedElement.java: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | NASM Assembly Language Plugin 4 | Copyright (c) 2017-2020 Aidan Khoury. All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | --*/ 25 | 26 | package com.nasmlanguage.psi; 27 | 28 | import com.intellij.psi.PsiNameIdentifierOwner; 29 | 30 | public interface NASMNamedElement extends PsiNameIdentifierOwner { 31 | } 32 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenCentral() 4 | gradlePluginPortal() 5 | } 6 | plugins { 7 | kotlin("jvm") version "2.0.20" 8 | } 9 | } 10 | plugins { 11 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" 12 | } 13 | 14 | rootProject.name = "jitwatch4i" 15 | include("core") 16 | include("nasm") 17 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/JitWatch4iToolWindowFactory.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui; 2 | 3 | import com.intellij.openapi.project.DumbAware; 4 | import com.intellij.openapi.project.Project; 5 | import com.intellij.openapi.wm.ToolWindow; 6 | import com.intellij.openapi.wm.ToolWindowFactory; 7 | import com.intellij.ui.content.ContentManager; 8 | import org.adoptopenjdk.jitwatch.logger.LoggerFactory; 9 | import org.adoptopenjdk.jitwatch.ui.main.JITWatchUI; 10 | import org.adoptopenjdk.jitwatch.util.IntelliJLoggerBackend; 11 | import org.jetbrains.annotations.NotNull; 12 | 13 | final class JitWatch4iToolWindowFactory implements ToolWindowFactory, DumbAware { 14 | 15 | @Override 16 | public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) { 17 | ContentManager contentManager = toolWindow.getContentManager(); 18 | LoggerFactory.setLoggerBackend(new IntelliJLoggerBackend()); 19 | JITWatchUI jitWatchUI = new JITWatchUI(project, contentManager); 20 | jitWatchUI.start(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/code/IViewer.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.code; 2 | 3 | import com.intellij.openapi.editor.LogicalPosition; 4 | import com.intellij.psi.PsiFile; 5 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 6 | 7 | public interface IViewer 8 | { 9 | void setContentFromMember(IMetaMember member, boolean reload); 10 | void syncEditorToViewer(LogicalPosition caretPosition); 11 | Integer findLine(IMetaMember metaMember, int sourceLine); 12 | Integer findLine(IMetaMember metaMember, int bytecodeOffset, int sourceLine); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/code/JavaTypeUtils.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.code; 2 | 3 | public class JavaTypeUtils 4 | { 5 | public static String normalizeTypeName(String javaTypeName) 6 | { 7 | if (javaTypeName.contains("$")) 8 | { 9 | javaTypeName = javaTypeName.replaceAll("\\$", "."); 10 | } 11 | return javaTypeName; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/code/JitRunConfigurationEditor.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.code; 2 | 3 | import com.intellij.execution.configurations.RunConfigurationBase; 4 | import com.intellij.openapi.options.SettingsEditor; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import javax.swing.*; 8 | import java.awt.*; 9 | 10 | public class JitRunConfigurationEditor> extends SettingsEditor 11 | { 12 | private final JPanel editorPanel; 13 | private final JCheckBox enabledCheckbox; 14 | 15 | public JitRunConfigurationEditor() 16 | { 17 | editorPanel = new JPanel(new BorderLayout()); 18 | enabledCheckbox = new JCheckBox("Log compilation"); 19 | editorPanel.add(enabledCheckbox, BorderLayout.NORTH); 20 | } 21 | 22 | @Override 23 | public void applyEditorTo(@NotNull T s) 24 | { 25 | JitWatchSettings settings = JitWatchSettings.Companion.getOrCreate(s); 26 | settings.setEnabled(enabledCheckbox.isSelected()); 27 | } 28 | 29 | @Override 30 | public void resetEditorFrom(@NotNull T s) 31 | { 32 | JitWatchSettings settings = JitWatchSettings.Companion.getOrCreate(s); 33 | enabledCheckbox.setSelected(settings.isEnabled()); 34 | } 35 | 36 | @Override 37 | public @NotNull JComponent createEditor() 38 | { 39 | return editorPanel; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/code/PsiMetaMemberWrapper.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.code; 2 | 3 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class PsiMetaMemberWrapper 9 | { 10 | private final IMetaMember member; 11 | private List paramTypeNames; 12 | private String returnTypeName; 13 | 14 | public PsiMetaMemberWrapper(IMetaMember member) 15 | { 16 | this.member = member; 17 | } 18 | 19 | public String getMemberName() 20 | { 21 | return member.getMemberName(); 22 | } 23 | 24 | public List getParamTypeNames() 25 | { 26 | if (paramTypeNames == null) 27 | { 28 | paramTypeNames = new ArrayList<>(); 29 | String[] origParamTypeNames = member.getParamTypeNames(); 30 | 31 | if (origParamTypeNames != null) 32 | { 33 | for (String paramTypeName : origParamTypeNames) 34 | { 35 | paramTypeNames.add(paramTypeName.replaceAll("\\$", ".")); 36 | } 37 | } 38 | } 39 | return paramTypeNames; 40 | } 41 | 42 | public String getReturnTypeName() 43 | { 44 | if (returnTypeName == null) 45 | { 46 | returnTypeName = member.getReturnTypeName().replaceAll("\\$", "."); 47 | } 48 | return returnTypeName; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/code/languages/JitWatchLanguageSupport.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.code.languages; 2 | 3 | import com.intellij.openapi.project.Project; 4 | import com.intellij.psi.PsiClass; 5 | import com.intellij.psi.PsiElement; 6 | import com.intellij.psi.PsiFile; 7 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 8 | import org.adoptopenjdk.jitwatch.model.MetaClass; 9 | 10 | import java.util.List; 11 | 12 | public interface JitWatchLanguageSupport 13 | { 14 | List getAllClasses(PsiFile file); 15 | 16 | ClassT findClass(Project project, MetaClass metaClass); 17 | 18 | List getAllMethods(ClassT cls); 19 | 20 | MethodT findMethodAtOffset(PsiFile file, int offset); 21 | 22 | String getClassVMName(ClassT cls); 23 | 24 | ClassT getContainingClass(MethodT method); 25 | 26 | boolean matchesSignature(MethodT method, String memberName, List paramTypeNames, String returnTypeName); 27 | 28 | PsiElement findMemberElement(Project project, PsiClass psiClass, IMetaMember member); 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/main/ICompilationChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.main; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | 10 | public interface ICompilationChangeListener 11 | { 12 | void compilationChanged(IMetaMember member); 13 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/main/IMemberSelectedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.main; 7 | 8 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 9 | 10 | public interface IMemberSelectedListener 11 | { 12 | void selectMember(IMetaMember member, boolean updateTree, boolean updateTriView); 13 | 14 | void selectCompilation(IMetaMember member, int compilationIndex); 15 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/main/IPrevNextCompilationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.main; 7 | 8 | public interface IPrevNextCompilationListener 9 | { 10 | void selectPrevCompilation(); 11 | void selectNextCompilation(); 12 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/main/IStageAccessProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.main; 7 | 8 | import org.adoptopenjdk.jitwatch.core.JITWatchConfig; 9 | import org.adoptopenjdk.jitwatch.model.IMetaMember; 10 | 11 | public interface IStageAccessProxy 12 | { 13 | // void openTriView(IMetaMember member); 14 | 15 | // void openTriView(IMetaMember member, int highlightBCI); 16 | 17 | // void openBrowser(String title, String html, String stylesheet); 18 | 19 | // void openTextViewer(String title, String contents, boolean lineNumbers, boolean highlighting); 20 | 21 | // void openCompileChain(IMetaMember member); 22 | 23 | void openInlinedIntoReport(IMetaMember member); 24 | 25 | JITWatchConfig getConfig(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/parserchooser/IParserSelectedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.parserchooser; 7 | 8 | import org.adoptopenjdk.jitwatch.parser.ParserType; 9 | 10 | public interface IParserSelectedListener 11 | { 12 | void parserSelected(ParserType parserType); 13 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/AbstractReportRowBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report; 7 | 8 | import org.adoptopenjdk.jitwatch.report.Report; 9 | 10 | public abstract class AbstractReportRowBean implements IReportRowBean 11 | { 12 | protected final Report report; 13 | 14 | public AbstractReportRowBean(Report report) 15 | { 16 | this.report = report; 17 | } 18 | 19 | public Report getReport() 20 | { 21 | return report; 22 | } 23 | 24 | public String getText() 25 | { 26 | return report.getText(); 27 | } 28 | 29 | public int getBytecodeOffset() 30 | { 31 | return report.getBytecodeOffset(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/IReportRowBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report; 7 | 8 | import org.adoptopenjdk.jitwatch.report.Report; 9 | 10 | public interface IReportRowBean 11 | { 12 | Report getReport(); 13 | 14 | String getText(); 15 | 16 | int getBytecodeOffset(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/IReportTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report; 7 | 8 | import java.util.List; 9 | 10 | public interface IReportTable 11 | { 12 | void setRows(List rows); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/ReportStageType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report; 7 | 8 | public enum ReportStageType 9 | { 10 | SUGGESTION, ELIMINATED_ALLOCATION, ELIDED_LOCK, INLINING 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/cell/ButtonCellModule.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.report.cell; 2 | 3 | import org.adoptopenjdk.jitwatch.report.Report; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | 8 | public class ButtonCellModule 9 | { 10 | private final JPanel panel; 11 | private final JButton button; 12 | 13 | public ButtonCellModule() 14 | { 15 | panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 0)); 16 | panel.setOpaque(true); 17 | button = new JButton(); 18 | button.setOpaque(true); 19 | panel.add(button); 20 | } 21 | 22 | public void setReport(Report report) 23 | { 24 | int bci = report.getBytecodeOffset(); 25 | button.setText("View BCI " + bci); 26 | button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 27 | button.setToolTipText("Click to view BCI " + bci); 28 | } 29 | 30 | public JPanel getPanel() 31 | { 32 | return panel; 33 | } 34 | 35 | public JButton getButton() 36 | { 37 | return button; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/cell/ButtonCellRenderer.java: -------------------------------------------------------------------------------- 1 | package org.adoptopenjdk.jitwatch.ui.report.cell; 2 | 3 | import org.adoptopenjdk.jitwatch.report.Report; 4 | 5 | import javax.swing.*; 6 | import javax.swing.table.TableCellRenderer; 7 | import java.awt.*; 8 | 9 | public class ButtonCellRenderer implements TableCellRenderer 10 | { 11 | private final ButtonCellModule buttonCellModule; 12 | 13 | public ButtonCellRenderer() 14 | { 15 | buttonCellModule = new ButtonCellModule(); 16 | } 17 | 18 | @Override 19 | public Component getTableCellRendererComponent(JTable table, Object value, 20 | boolean isSelected, boolean hasFocus, int row, int column) 21 | { 22 | if (value instanceof Report) 23 | { 24 | buttonCellModule.setReport((Report) value); 25 | } 26 | 27 | return buttonCellModule.getPanel(); 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/cell/IntegerTableCellRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report.cell; 7 | 8 | import javax.swing.table.DefaultTableCellRenderer; 9 | 10 | public class IntegerTableCellRenderer extends DefaultTableCellRenderer 11 | { 12 | @Override 13 | public void setValue(Object value) 14 | { 15 | if (value instanceof Integer) 16 | { 17 | setText(value.toString()); 18 | } 19 | else 20 | { 21 | setText(""); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/cell/TextTableCellRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report.cell; 7 | 8 | import javax.swing.table.DefaultTableCellRenderer; 9 | 10 | public class TextTableCellRenderer extends DefaultTableCellRenderer 11 | { 12 | @Override 13 | public void setValue(Object value) 14 | { 15 | setText(value != null ? value.toString() : ""); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/report/suggestion/SuggestionRowBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2016 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.report.suggestion; 7 | 8 | import org.adoptopenjdk.jitwatch.report.Report; 9 | import org.adoptopenjdk.jitwatch.ui.report.AbstractReportRowBean; 10 | 11 | public class SuggestionRowBean extends AbstractReportRowBean 12 | { 13 | public SuggestionRowBean(Report report) 14 | { 15 | super(report); 16 | } 17 | 18 | public int getScore() 19 | { 20 | return report.getScore(); 21 | } 22 | 23 | public String getType() 24 | { 25 | switch (report.getType()) 26 | { 27 | case BRANCH: 28 | return "Branch"; 29 | case INLINE_FAILURE: 30 | return "Inlining"; 31 | case CODE_CACHE: 32 | return "Code Cache"; 33 | case ELIMINATED_ALLOCATION_DIRECT: 34 | case ELIMINATED_ALLOCATION_INLINE: 35 | return "Eliminated Allocation"; 36 | default: 37 | return "Unknown"; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/resize/IRedrawable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.resize; 7 | 8 | public interface IRedrawable 9 | { 10 | void redraw(); 11 | } -------------------------------------------------------------------------------- /src/main/java/org/adoptopenjdk/jitwatch/ui/toplist/TopListWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2015 Chris Newland. 3 | * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD 4 | * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki 5 | */ 6 | package org.adoptopenjdk.jitwatch.ui.toplist; 7 | 8 | import java.util.Arrays; 9 | 10 | import org.adoptopenjdk.jitwatch.toplist.ITopListVisitable; 11 | 12 | public class TopListWrapper 13 | { 14 | private String title; 15 | private ITopListVisitable visitable; 16 | private String[] columns; 17 | 18 | public TopListWrapper(String title, ITopListVisitable visitable, String[] columns) 19 | { 20 | this.title = title; 21 | this.visitable = visitable; 22 | // Fixed after SonarQube critical warning: Security - Array is stored directly 23 | this.columns = Arrays.copyOf(columns, columns.length); 24 | } 25 | 26 | public String getTitle() 27 | { 28 | return title; 29 | } 30 | 31 | public ITopListVisitable getVisitable() 32 | { 33 | return visitable; 34 | } 35 | 36 | public String[] getColumns() 37 | { 38 | return Arrays.copyOf(columns, columns.length); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/i18n/lang_pl.properties: -------------------------------------------------------------------------------- 1 | START=Początek -------------------------------------------------------------------------------- /src/main/resources/i18n/lang_pt_BR.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/src/main/resources/i18n/lang_pt_BR.properties -------------------------------------------------------------------------------- /src/main/resources/images/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/src/main/resources/images/camera.png -------------------------------------------------------------------------------- /src/main/resources/images/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains/jitwatch4i/54e8a02b7fe1e839ec7b1d142b49dbc63cec722f/src/main/resources/images/tick.png -------------------------------------------------------------------------------- /src/main/resources/style.css: -------------------------------------------------------------------------------- 1 | .root { 2 | -fx-font: 11px "JetBrains Mono", "Droid Sans Mono", "DejaVu Sans Mono", monospace; 3 | } 4 | 5 | .mnemonic-underline { 6 | -fx-stroke: -fx-text-base-color; 7 | } 8 | 9 | .eliminated-allocation .text { 10 | -fx-strikethrough: true; 11 | } 12 | 13 | .tooltip .text { 14 | -fx-strikethrough: false; 15 | -fx-font-family: "JetBrains Mono", monospace; 16 | -fx-font-size: 11px; 17 | } 18 | 19 | Button { 20 | -fx-font: 11px "JetBrains Mono", "Droid Sans Mono", "DejaVu Sans Mono", monospace; 21 | -fx-base: #eeeeff; 22 | -fx-padding: 3 4 4 3; 23 | } 24 | 25 | .chart-title { 26 | -fx-text-fill: blue; 27 | -fx-font-size: 16px; 28 | -fx-font-family: "JetBrains Mono", sans-serif; 29 | } 30 | 31 | .readonly-label { 32 | -fx-border-color: black; 33 | -fx-border-width: 1px; 34 | -fx-alignment: LEFT; 35 | -fx-background-color: white; 36 | -fx-padding: 4px; 37 | -fx-font-family: "JetBrains Mono", "Droid Sans Mono", "DejaVu Sans Mono", monospace; 38 | } 39 | --------------------------------------------------------------------------------