From 9fb97fd53fa5ec6b04479156378cbb826ecdafdf Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sat, 20 Aug 2016 14:17:03 +0300 Subject: [PATCH] Refactoring --- .../org/teavm/classlib/impl/JCLPlugin.java | 2 +- .../classlib/impl/ServiceLoaderSupport.java | 6 +- .../java/lang/ClassLoaderNativeGenerator.java | 8 +- .../java/lang/LongNativeGenerator.java | 6 +- .../java/lang/MathNativeGenerator.java | 6 +- .../java/lang/SystemNativeGenerator.java | 6 +- .../classlib/java/lang/TClassLoader.java | 2 +- .../org/teavm/classlib/java/lang/TLong.java | 2 +- .../org/teavm/classlib/java/lang/TMath.java | 2 +- .../org/teavm/classlib/java/lang/TSystem.java | 2 +- .../lang/reflect/ArrayNativeGenerator.java | 6 +- .../classlib/java/lang/reflect/TArray.java | 2 +- .../java/org/teavm/ast/NativeMethodNode.java | 2 +- .../teavm/ast/decompilation/Decompiler.java | 6 +- .../ExpressionSideEffectDecomposer.java | 2 +- .../ast/optimization/OptimizingVisitor.java | 1 - .../backend/javascript/JavaScriptTarget.java | 358 ++++++++++++++++++ .../NullPointerExceptionTransformer.java | 4 +- .../javascript/RuntimeSupport.java | 4 +- .../javascript}/TeaVMJavaScriptHost.java | 6 +- .../javascript}/codegen/AliasProvider.java | 4 +- .../codegen/DefaultAliasProvider.java | 4 +- .../codegen/DefaultNamingStrategy.java | 10 +- .../javascript}/codegen/LocationProvider.java | 4 +- .../codegen/MinifyingAliasProvider.java | 4 +- .../codegen/NameFrequencyConsumer.java | 4 +- .../javascript}/codegen/NamingException.java | 4 +- .../javascript}/codegen/NamingOrderer.java | 4 +- .../javascript}/codegen/NamingStrategy.java | 4 +- .../javascript}/codegen/SourceWriter.java | 4 +- .../codegen/SourceWriterBuilder.java | 4 +- .../rendering}/NameFrequencyEstimator.java | 6 +- .../javascript/rendering}/Precedence.java | 4 +- .../javascript/rendering}/Renderer.java | 20 +- .../rendering}/RenderingContext.java | 8 +- .../rendering}/RenderingException.java | 4 +- .../javascript/rendering}/TryCatchFinder.java | 4 +- .../javascript/spi/GeneratedBy.java | 4 +- .../javascript/spi/Generator.java | 6 +- .../javascript/spi/GeneratorContext.java | 4 +- .../javascript/spi/InjectedBy.java | 4 +- .../javascript/spi/Injector.java | 4 +- .../javascript/spi/InjectorContext.java | 8 +- .../org/teavm/{ => backend}/wasm/Example.java | 2 +- .../teavm/{ => backend}/wasm/WasmRuntime.java | 2 +- .../teavm/{ => backend}/wasm/WasmTarget.java | 72 ++-- .../wasm/binary/AddressMode.java | 2 +- .../wasm/binary/BinaryWriter.java | 2 +- .../{ => backend}/wasm/binary/DataArray.java | 2 +- .../wasm/binary/DataPrimitives.java | 2 +- .../wasm/binary/DataStructure.java | 2 +- .../{ => backend}/wasm/binary/DataType.java | 2 +- .../{ => backend}/wasm/binary/DataValue.java | 2 +- .../wasm/binary/MetadataWriter.java | 2 +- .../wasm/generate/WasmClassGenerator.java | 14 +- .../wasm/generate/WasmDependencyListener.java | 2 +- .../wasm/generate/WasmGenerationContext.java | 4 +- .../wasm/generate/WasmGenerationVisitor.java | 82 ++-- .../wasm/generate/WasmGenerator.java | 27 +- .../wasm/generate/WasmGeneratorUtil.java | 4 +- .../wasm/generate/WasmMangling.java | 3 +- .../wasm/generate/WasmStringPool.java | 12 +- .../wasm/intrinsics/AllocatorIntrinsic.java | 10 +- .../wasm/intrinsics/ClassIntrinsic.java | 4 +- .../intrinsics/PlatformClassIntrinsic.java | 6 +- .../PlatformClassMetadataIntrinsic.java | 4 +- .../wasm/intrinsics/PlatformIntrinsic.java | 4 +- .../intrinsics/PlatformObjectIntrinsic.java | 18 +- .../wasm/intrinsics/WasmAddressIntrinsic.java | 34 +- .../wasm/intrinsics/WasmIntrinsic.java | 4 +- .../wasm/intrinsics/WasmIntrinsicManager.java | 6 +- .../wasm/intrinsics/WasmRuntimeIntrinsic.java | 22 +- .../intrinsics/WasmStructureIntrinsic.java | 8 +- .../wasm/model/WasmFunction.java | 4 +- .../{ => backend}/wasm/model/WasmLocal.java | 2 +- .../wasm/model/WasmMemorySegment.java | 2 +- .../{ => backend}/wasm/model/WasmModule.java | 2 +- .../{ => backend}/wasm/model/WasmType.java | 2 +- .../wasm/model/expression/WasmBlock.java | 2 +- .../wasm/model/expression/WasmBranch.java | 2 +- .../wasm/model/expression/WasmBreak.java | 2 +- .../wasm/model/expression/WasmCall.java | 2 +- .../model/expression/WasmConditional.java | 2 +- .../wasm/model/expression/WasmConversion.java | 4 +- .../WasmDefaultExpressionVisitor.java | 2 +- .../wasm/model/expression/WasmDrop.java | 2 +- .../wasm/model/expression/WasmExpression.java | 2 +- .../expression/WasmExpressionVisitor.java | 2 +- .../model/expression/WasmFloat32Constant.java | 2 +- .../model/expression/WasmFloat64Constant.java | 2 +- .../model/expression/WasmFloatBinary.java | 2 +- .../expression/WasmFloatBinaryOperation.java | 2 +- .../wasm/model/expression/WasmFloatType.java | 2 +- .../wasm/model/expression/WasmFloatUnary.java | 2 +- .../expression/WasmFloatUnaryOperation.java | 2 +- .../wasm/model/expression/WasmGetLocal.java | 4 +- .../model/expression/WasmIndirectCall.java | 4 +- .../model/expression/WasmInt32Constant.java | 2 +- .../model/expression/WasmInt32Subtype.java | 2 +- .../model/expression/WasmInt64Constant.java | 2 +- .../model/expression/WasmInt64Subtype.java | 2 +- .../wasm/model/expression/WasmIntBinary.java | 2 +- .../expression/WasmIntBinaryOperation.java | 2 +- .../wasm/model/expression/WasmIntType.java | 2 +- .../wasm/model/expression/WasmIntUnary.java | 2 +- .../expression/WasmIntUnaryOperation.java | 2 +- .../model/expression/WasmLoadFloat32.java | 2 +- .../model/expression/WasmLoadFloat64.java | 2 +- .../wasm/model/expression/WasmLoadInt32.java | 2 +- .../wasm/model/expression/WasmLoadInt64.java | 2 +- .../wasm/model/expression/WasmReturn.java | 2 +- .../wasm/model/expression/WasmSetLocal.java | 4 +- .../model/expression/WasmStoreFloat32.java | 2 +- .../model/expression/WasmStoreFloat64.java | 2 +- .../wasm/model/expression/WasmStoreInt32.java | 2 +- .../wasm/model/expression/WasmStoreInt64.java | 2 +- .../wasm/model/expression/WasmSwitch.java | 2 +- .../model/expression/WasmUnreachable.java | 2 +- .../wasm/patches/ClassPatch.java | 2 +- .../wasm/patches/ObjectPatch.java | 2 +- .../wasm/render/WasmRenderer.java | 14 +- .../wasm/render/WasmRenderingVisitor.java | 80 ++-- .../wasm/render/WasmSignature.java | 4 +- .../wasm/render/WasmSignatureCollector.java | 8 +- .../information/DebugInformationBuilder.java | 5 +- .../information/DebugInformationEmitter.java | 2 +- .../DummyDebugInformationEmitter.java | 2 +- .../teavm/dependency/DependencyChecker.java | 2 +- .../dependency/DependencyClassSource.java | 2 +- .../teavm/javascript/AsyncInvocationType.java | 21 - .../teavm/model/CopyClassHolderSource.java | 2 +- .../model/PreOptimizingClassHolderSource.java | 4 +- .../optimization/ArrayUnwrapMotion.java | 4 +- .../optimization/ClassInitElimination.java | 2 +- .../ConstantConditionElimination.java | 2 +- .../optimization/Devirtualization.java | 4 +- .../optimization/EmptyBlockElimination.java | 4 +- .../optimization/GlobalValueNumbering.java | 4 +- .../{ => model}/optimization/Inlining.java | 2 +- .../optimization/LoopInvariantAnalyzer.java | 2 +- .../optimization/LoopInvariantMotion.java | 4 +- .../optimization/LoopInversion.java | 2 +- .../optimization/LoopInversionImpl.java | 2 +- .../optimization/MethodOptimization.java | 4 +- .../RedundantJumpElimination.java | 2 +- .../UnreachableBasicBlockElimination.java | 2 +- .../UnreachableBasicBlockEliminator.java | 4 +- .../UnusedVariableElimination.java | 4 +- .../optimization/VariableEscapeAnalyzer.java | 4 +- .../VariableUsageGraphBuilder.java | 4 +- .../teavm/model/util/AsyncMethodFinder.java | 2 +- .../model/util/MissingItemsProcessor.java | 2 +- .../parsing/ClasspathClassHolderSource.java | 6 +- .../main/java/org/teavm/parsing/Parser.java | 2 +- .../resource/ClasspathResourceReader.java | 4 +- .../resource/MapperClassHolderSource.java | 4 +- .../resource/ResourceClassHolderMapper.java | 4 +- .../parsing/resource/ResourceParser.java | 0 .../resource/ResourceReader.java | 4 +- core/src/main/java/org/teavm/vm/TeaVM.java | 26 +- .../vm/spi/AbstractRendererListener.java | 2 +- .../org/teavm/vm/spi/RendererListener.java | 2 +- .../teavm/{ => backend}/javascript/runtime.js | 0 core/teavm-core.iml | 2 +- .../java/org/teavm/html4j/HTML4JPlugin.java | 2 +- .../teavm/html4j/JavaScriptBodyGenerator.java | 14 +- .../html4j/JavaScriptBodyTransformer.java | 2 +- .../java/org/teavm/html4j/JavaScriptConv.java | 2 +- .../teavm/html4j/JavaScriptConvGenerator.java | 6 +- .../html4j/JavaScriptResourceInterceptor.java | 4 +- .../teavm/html4j/ResourcesInterceptor.java | 4 +- .../java/org/teavm/jso/impl/AstWriter.java | 18 +- .../src/main/java/org/teavm/jso/impl/JS.java | 4 +- .../org/teavm/jso/impl/JSAliasRenderer.java | 4 +- .../org/teavm/jso/impl/JSBodyAstEmitter.java | 8 +- .../teavm/jso/impl/JSBodyBloatedEmitter.java | 6 +- .../org/teavm/jso/impl/JSBodyEmitter.java | 6 +- .../org/teavm/jso/impl/JSBodyGenerator.java | 10 +- .../org/teavm/jso/impl/JSClassProcessor.java | 4 +- .../org/teavm/jso/impl/JSNativeGenerator.java | 14 +- .../java/org/teavm/jso/impl/JSOPlugin.java | 2 +- .../org/teavm/jso/plugin/AstWriterTest.java | 16 +- .../java/org/teavm/platform/Platform.java | 4 +- .../org/teavm/platform/PlatformQueue.java | 2 +- .../platform/plugin/AsyncMethodGenerator.java | 6 +- .../platform/plugin/AsyncMethodProcessor.java | 2 +- .../plugin/BuildTimeClassResource.java | 2 +- .../plugin/BuildTimeResourceArray.java | 2 +- .../platform/plugin/BuildTimeResourceMap.java | 2 +- .../plugin/BuildTimeResourceProxyBuilder.java | 2 +- .../plugin/BuildTimeResourceWriterMethod.java | 2 +- .../plugin/BuildTimeStaticFieldResource.java | 2 +- ...ScopedMetadataProviderNativeGenerator.java | 8 +- .../MetadataProviderNativeGenerator.java | 6 +- .../plugin/MetadataProviderTransformer.java | 2 +- .../platform/plugin/PlatformGenerator.java | 10 +- .../plugin/PlatformQueueGenerator.java | 4 +- .../plugin/ResourceAccessorGenerator.java | 6 +- .../plugin/ResourceAccessorInjector.java | 4 +- .../plugin/ResourceAccessorTransformer.java | 2 +- .../teavm/platform/plugin/ResourceWriter.java | 2 +- .../platform/plugin/ResourceWriterHelper.java | 2 +- .../org/teavm/dependency/ClassValueTest.java | 2 +- .../test/java/org/teavm/tests/JSOTest.java | 2 +- .../java/org/teavm/tooling/TeaVMTool.java | 10 +- .../java/org/teavm/junit/TeaVMTestRunner.java | 4 +- 206 files changed, 898 insertions(+), 603 deletions(-) rename core/src/main/java/org/teavm/{javascript => ast/optimization}/ExpressionSideEffectDecomposer.java (99%) create mode 100644 core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java rename core/src/main/java/org/teavm/{ => backend}/javascript/NullPointerExceptionTransformer.java (96%) rename core/src/main/java/org/teavm/{ => backend}/javascript/RuntimeSupport.java (91%) rename core/src/main/java/org/teavm/{javascript/backend => backend/javascript}/TeaVMJavaScriptHost.java (87%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/AliasProvider.java (92%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/DefaultAliasProvider.java (97%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/DefaultNamingStrategy.java (95%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/LocationProvider.java (89%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/MinifyingAliasProvider.java (97%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/NameFrequencyConsumer.java (92%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/NamingException.java (91%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/NamingOrderer.java (97%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/NamingStrategy.java (93%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/SourceWriter.java (98%) rename core/src/main/java/org/teavm/{ => backend/javascript}/codegen/SourceWriterBuilder.java (94%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/NameFrequencyEstimator.java (98%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/Precedence.java (93%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/Renderer.java (99%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/RenderingContext.java (82%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/RenderingException.java (92%) rename core/src/main/java/org/teavm/{javascript => backend/javascript/rendering}/TryCatchFinder.java (97%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/GeneratedBy.java (92%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/Generator.java (85%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/GeneratorContext.java (93%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/InjectedBy.java (91%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/Injector.java (91%) rename core/src/main/java/org/teavm/{ => backend}/javascript/spi/InjectorContext.java (87%) rename core/src/main/java/org/teavm/{ => backend}/wasm/Example.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/WasmRuntime.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/WasmTarget.java (88%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/AddressMode.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/BinaryWriter.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/DataArray.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/DataPrimitives.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/DataStructure.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/DataType.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/DataValue.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/binary/MetadataWriter.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmClassGenerator.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmDependencyListener.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmGenerationContext.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmGenerationVisitor.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmGenerator.java (86%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmGeneratorUtil.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmMangling.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/generate/WasmStringPool.java (90%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/AllocatorIntrinsic.java (87%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/ClassIntrinsic.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/PlatformClassIntrinsic.java (90%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/PlatformClassMetadataIntrinsic.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/PlatformIntrinsic.java (92%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/PlatformObjectIntrinsic.java (80%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/WasmAddressIntrinsic.java (84%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/WasmIntrinsic.java (89%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/WasmIntrinsicManager.java (78%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/WasmRuntimeIntrinsic.java (79%) rename core/src/main/java/org/teavm/{ => backend}/wasm/intrinsics/WasmStructureIntrinsic.java (89%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/WasmFunction.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/WasmLocal.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/WasmMemorySegment.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/WasmModule.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/WasmType.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmBlock.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmBranch.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmBreak.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmCall.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmConditional.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmConversion.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmDefaultExpressionVisitor.java (99%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmDrop.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmExpression.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmExpressionVisitor.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloat32Constant.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloat64Constant.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloatBinary.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloatBinaryOperation.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloatType.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloatUnary.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmFloatUnaryOperation.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmGetLocal.java (92%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIndirectCall.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmInt32Constant.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmInt32Subtype.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmInt64Constant.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmInt64Subtype.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIntBinary.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIntBinaryOperation.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIntType.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIntUnary.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmIntUnaryOperation.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmLoadFloat32.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmLoadFloat64.java (96%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmLoadInt32.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmLoadInt64.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmReturn.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmSetLocal.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmStoreFloat32.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmStoreFloat64.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmStoreInt32.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmStoreInt64.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmSwitch.java (97%) rename core/src/main/java/org/teavm/{ => backend}/wasm/model/expression/WasmUnreachable.java (94%) rename core/src/main/java/org/teavm/{ => backend}/wasm/patches/ClassPatch.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/patches/ObjectPatch.java (98%) rename core/src/main/java/org/teavm/{ => backend}/wasm/render/WasmRenderer.java (95%) rename core/src/main/java/org/teavm/{ => backend}/wasm/render/WasmRenderingVisitor.java (88%) rename core/src/main/java/org/teavm/{ => backend}/wasm/render/WasmSignature.java (93%) rename core/src/main/java/org/teavm/{ => backend}/wasm/render/WasmSignatureCollector.java (84%) delete mode 100644 core/src/main/java/org/teavm/javascript/AsyncInvocationType.java rename core/src/main/java/org/teavm/{ => model}/optimization/ArrayUnwrapMotion.java (97%) rename core/src/main/java/org/teavm/{ => model}/optimization/ClassInitElimination.java (98%) rename core/src/main/java/org/teavm/{ => model}/optimization/ConstantConditionElimination.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/Devirtualization.java (97%) rename core/src/main/java/org/teavm/{ => model}/optimization/EmptyBlockElimination.java (96%) rename core/src/main/java/org/teavm/{ => model}/optimization/GlobalValueNumbering.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/Inlining.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/LoopInvariantAnalyzer.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/LoopInvariantMotion.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/LoopInversion.java (96%) rename core/src/main/java/org/teavm/{ => model}/optimization/LoopInversionImpl.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/MethodOptimization.java (91%) rename core/src/main/java/org/teavm/{ => model}/optimization/RedundantJumpElimination.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/UnreachableBasicBlockElimination.java (96%) rename core/src/main/java/org/teavm/{ => model}/optimization/UnreachableBasicBlockEliminator.java (97%) rename core/src/main/java/org/teavm/{ => model}/optimization/UnusedVariableElimination.java (99%) rename core/src/main/java/org/teavm/{ => model}/optimization/VariableEscapeAnalyzer.java (98%) rename core/src/main/java/org/teavm/{ => model}/optimization/VariableUsageGraphBuilder.java (98%) rename core/src/main/java/org/teavm/{ => parsing}/resource/ClasspathResourceReader.java (95%) rename core/src/main/java/org/teavm/{ => parsing}/resource/MapperClassHolderSource.java (93%) rename core/src/main/java/org/teavm/{ => parsing}/resource/ResourceClassHolderMapper.java (96%) create mode 100644 core/src/main/java/org/teavm/parsing/resource/ResourceParser.java rename core/src/main/java/org/teavm/{ => parsing}/resource/ResourceReader.java (91%) rename core/src/main/resources/org/teavm/{ => backend}/javascript/runtime.js (100%) diff --git a/classlib/src/main/java/org/teavm/classlib/impl/JCLPlugin.java b/classlib/src/main/java/org/teavm/classlib/impl/JCLPlugin.java index 198b36c4f..1070ae8cd 100644 --- a/classlib/src/main/java/org/teavm/classlib/impl/JCLPlugin.java +++ b/classlib/src/main/java/org/teavm/classlib/impl/JCLPlugin.java @@ -24,7 +24,7 @@ import java.util.ServiceLoader; import org.teavm.classlib.impl.lambda.LambdaMetafactorySubstitutor; import org.teavm.classlib.impl.unicode.CLDRReader; import org.teavm.classlib.java.lang.reflect.AnnotationDependencyListener; -import org.teavm.javascript.backend.TeaVMJavaScriptHost; +import org.teavm.backend.javascript.TeaVMJavaScriptHost; import org.teavm.model.MethodReference; import org.teavm.platform.PlatformClass; import org.teavm.vm.spi.TeaVMHost; diff --git a/classlib/src/main/java/org/teavm/classlib/impl/ServiceLoaderSupport.java b/classlib/src/main/java/org/teavm/classlib/impl/ServiceLoaderSupport.java index 9865ec171..9c3cf64e9 100644 --- a/classlib/src/main/java/org/teavm/classlib/impl/ServiceLoaderSupport.java +++ b/classlib/src/main/java/org/teavm/classlib/impl/ServiceLoaderSupport.java @@ -27,13 +27,13 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.AbstractDependencyListener; import org.teavm.dependency.DependencyAgent; import org.teavm.dependency.DependencyNode; import org.teavm.dependency.MethodDependency; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.CallLocation; import org.teavm.model.MethodDescriptor; import org.teavm.model.MethodReference; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/ClassLoaderNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/ClassLoaderNativeGenerator.java index 83cad8cd1..c7362bf6a 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/ClassLoaderNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/ClassLoaderNativeGenerator.java @@ -9,10 +9,10 @@ import java.util.ServiceLoader; import java.util.Set; import org.apache.commons.io.IOUtils; import org.teavm.classlib.ResourceSupplier; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.Renderer; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.Renderer; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; /** diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/LongNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/LongNativeGenerator.java index 4ac039270..95b76e5e4 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/LongNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/LongNativeGenerator.java @@ -16,9 +16,9 @@ package org.teavm.classlib.java.lang; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.MethodReference; /** diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java index 25931041d..37f5af6a7 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java @@ -16,9 +16,9 @@ package org.teavm.classlib.java.lang; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.MethodReference; /** diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/SystemNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/SystemNativeGenerator.java index 5e633f728..f19484553 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/SystemNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/SystemNativeGenerator.java @@ -16,10 +16,10 @@ package org.teavm.classlib.java.lang; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.*; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.CallLocation; import org.teavm.model.FieldReference; import org.teavm.model.MethodReference; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TClassLoader.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TClassLoader.java index ce89727dd..b7b310512 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TClassLoader.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TClassLoader.java @@ -18,7 +18,7 @@ package org.teavm.classlib.java.lang; import java.io.ByteArrayInputStream; import java.io.InputStream; import org.teavm.classlib.impl.Base64; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.jso.JSIndexer; import org.teavm.jso.JSObject; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TLong.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TLong.java index c9bc22278..425fd73c2 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TLong.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TLong.java @@ -15,7 +15,7 @@ */ package org.teavm.classlib.java.lang; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; public class TLong extends TNumber implements TComparable { public static final long MIN_VALUE = -0x8000000000000000L; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java index 14b343a03..1033a4b58 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java @@ -15,7 +15,7 @@ */ package org.teavm.classlib.java.lang; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; /** * diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java index 28bbae9c8..0624ac602 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java @@ -20,7 +20,7 @@ import org.teavm.classlib.java.io.TInputStream; import org.teavm.classlib.java.io.TPrintStream; import org.teavm.classlib.java.lang.reflect.TArray; import org.teavm.dependency.PluggableDependency; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; /** * diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/ArrayNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/ArrayNativeGenerator.java index 647226fba..070e31ed7 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/ArrayNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/ArrayNativeGenerator.java @@ -16,10 +16,10 @@ package org.teavm.classlib.java.lang.reflect; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.*; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.CallLocation; import org.teavm.model.ClassReader; import org.teavm.model.MethodDescriptor; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java index 305860d14..d7cd3c7b0 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java @@ -18,7 +18,7 @@ package org.teavm.classlib.java.lang.reflect; import org.teavm.classlib.java.lang.*; import org.teavm.dependency.PluggableDependency; import org.teavm.interop.DelegateTo; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; import org.teavm.platform.PlatformClass; import org.teavm.runtime.Allocator; import org.teavm.runtime.RuntimeClass; diff --git a/core/src/main/java/org/teavm/ast/NativeMethodNode.java b/core/src/main/java/org/teavm/ast/NativeMethodNode.java index 93082f062..ec925906a 100644 --- a/core/src/main/java/org/teavm/ast/NativeMethodNode.java +++ b/core/src/main/java/org/teavm/ast/NativeMethodNode.java @@ -18,7 +18,7 @@ package org.teavm.ast; import java.util.Collections; import java.util.List; import java.util.Set; -import org.teavm.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.Generator; import org.teavm.model.MethodReference; public class NativeMethodNode extends MethodNode { diff --git a/core/src/main/java/org/teavm/ast/decompilation/Decompiler.java b/core/src/main/java/org/teavm/ast/decompilation/Decompiler.java index c2b38e6c1..a89701b7e 100644 --- a/core/src/main/java/org/teavm/ast/decompilation/Decompiler.java +++ b/core/src/main/java/org/teavm/ast/decompilation/Decompiler.java @@ -50,9 +50,9 @@ import org.teavm.common.GraphIndexer; import org.teavm.common.Loop; import org.teavm.common.LoopGraph; import org.teavm.common.RangeTree; -import org.teavm.javascript.spi.GeneratedBy; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.model.AnnotationHolder; import org.teavm.model.ClassHolder; import org.teavm.model.ClassHolderSource; diff --git a/core/src/main/java/org/teavm/javascript/ExpressionSideEffectDecomposer.java b/core/src/main/java/org/teavm/ast/optimization/ExpressionSideEffectDecomposer.java similarity index 99% rename from core/src/main/java/org/teavm/javascript/ExpressionSideEffectDecomposer.java rename to core/src/main/java/org/teavm/ast/optimization/ExpressionSideEffectDecomposer.java index 2d43a3dbd..b6a1cf0b3 100644 --- a/core/src/main/java/org/teavm/javascript/ExpressionSideEffectDecomposer.java +++ b/core/src/main/java/org/teavm/ast/optimization/ExpressionSideEffectDecomposer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.ast.optimization; import java.util.List; import org.teavm.ast.BinaryExpr; diff --git a/core/src/main/java/org/teavm/ast/optimization/OptimizingVisitor.java b/core/src/main/java/org/teavm/ast/optimization/OptimizingVisitor.java index bbc7e43d5..1dc4f20e4 100644 --- a/core/src/main/java/org/teavm/ast/optimization/OptimizingVisitor.java +++ b/core/src/main/java/org/teavm/ast/optimization/OptimizingVisitor.java @@ -58,7 +58,6 @@ import org.teavm.ast.UnaryOperation; import org.teavm.ast.UnwrapArrayExpr; import org.teavm.ast.VariableExpr; import org.teavm.ast.WhileStatement; -import org.teavm.javascript.ExpressionSideEffectDecomposer; class OptimizingVisitor implements StatementVisitor, ExprVisitor { private Expr resultExpr; diff --git a/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java b/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java new file mode 100644 index 000000000..62ac865be --- /dev/null +++ b/core/src/main/java/org/teavm/backend/javascript/JavaScriptTarget.java @@ -0,0 +1,358 @@ +/* + * Copyright 2016 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.backend.javascript; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.teavm.ast.ClassNode; +import org.teavm.ast.cache.EmptyRegularMethodNodeCache; +import org.teavm.ast.cache.MethodNodeCache; +import org.teavm.ast.decompilation.Decompiler; +import org.teavm.backend.javascript.rendering.Renderer; +import org.teavm.backend.javascript.rendering.RenderingException; +import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.codegen.AliasProvider; +import org.teavm.backend.javascript.codegen.DefaultAliasProvider; +import org.teavm.backend.javascript.codegen.DefaultNamingStrategy; +import org.teavm.backend.javascript.codegen.MinifyingAliasProvider; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriterBuilder; +import org.teavm.debugging.information.DebugInformationEmitter; +import org.teavm.debugging.information.SourceLocation; +import org.teavm.dependency.DependencyChecker; +import org.teavm.dependency.DependencyListener; +import org.teavm.dependency.MethodDependency; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.model.BasicBlock; +import org.teavm.model.CallLocation; +import org.teavm.model.ClassHolder; +import org.teavm.model.ClassHolderTransformer; +import org.teavm.model.ElementModifier; +import org.teavm.model.TextLocation; +import org.teavm.model.ListableClassHolderSource; +import org.teavm.model.MethodHolder; +import org.teavm.model.MethodReference; +import org.teavm.model.Program; +import org.teavm.model.ValueType; +import org.teavm.model.Variable; +import org.teavm.model.instructions.ConstructInstruction; +import org.teavm.model.instructions.InvocationType; +import org.teavm.model.instructions.InvokeInstruction; +import org.teavm.model.instructions.RaiseInstruction; +import org.teavm.model.instructions.StringConstantInstruction; +import org.teavm.model.util.AsyncMethodFinder; +import org.teavm.model.util.ProgramUtils; +import org.teavm.vm.BuildTarget; +import org.teavm.vm.TeaVMEntryPoint; +import org.teavm.vm.TeaVMTarget; +import org.teavm.vm.TeaVMTargetController; +import org.teavm.vm.spi.RendererListener; +import org.teavm.vm.spi.TeaVMHostExtension; + +public class JavaScriptTarget implements TeaVMTarget, TeaVMJavaScriptHost { + private TeaVMTargetController controller; + private boolean minifying = true; + private final Map methodGenerators = new HashMap<>(); + private final Map methodInjectors = new HashMap<>(); + private final List rendererListeners = new ArrayList<>(); + private DebugInformationEmitter debugEmitter; + private MethodNodeCache astCache = new EmptyRegularMethodNodeCache(); + private final Set asyncMethods = new HashSet<>(); + private final Set asyncFamilyMethods = new HashSet<>(); + + @Override + public List getTransformers() { + return Collections.emptyList(); + } + + @Override + public List getDependencyListeners() { + return Collections.emptyList(); + } + + @Override + public void setController(TeaVMTargetController controller) { + this.controller = controller; + } + + @Override + public void add(RendererListener listener) { + rendererListeners.add(listener); + } + + @Override + public void add(MethodReference methodRef, Generator generator) { + methodGenerators.put(methodRef, generator); + } + + @Override + public void add(MethodReference methodRef, Injector injector) { + methodInjectors.put(methodRef, injector); + } + + /** + * Reports whether this TeaVM instance uses obfuscation when generating the JavaScript code. + * + * @see #setMinifying(boolean) + * @return whether TeaVM produces obfuscated code. + */ + public boolean isMinifying() { + return minifying; + } + + /** + * Specifies whether this TeaVM instance uses obfuscation when generating the JavaScript code. + * + * @see #isMinifying() + * @param minifying whether TeaVM should obfuscate code. + */ + public void setMinifying(boolean minifying) { + this.minifying = minifying; + } + + public MethodNodeCache getAstCache() { + return astCache; + } + + public void setAstCache(MethodNodeCache methodAstCache) { + this.astCache = methodAstCache; + } + + public DebugInformationEmitter getDebugEmitter() { + return debugEmitter; + } + + public void setDebugEmitter(DebugInformationEmitter debugEmitter) { + this.debugEmitter = debugEmitter; + } + + @Override + public boolean requiresRegisterAllocation() { + return true; + } + + @Override + public List getHostExtensions() { + return Collections.singletonList(this); + } + + @Override + public void contributeDependencies(DependencyChecker dependencyChecker) { + dependencyChecker.linkMethod(new MethodReference(Class.class.getName(), "getClass", + ValueType.object("org.teavm.platform.PlatformClass"), ValueType.parse(Class.class)), null).use(); + dependencyChecker.linkMethod(new MethodReference(String.class, "", char[].class, void.class), + null).use(); + dependencyChecker.linkMethod(new MethodReference(String.class, "getChars", int.class, int.class, char[].class, + int.class, void.class), null).use(); + + MethodDependency internDep = dependencyChecker.linkMethod(new MethodReference(String.class, "intern", + String.class), null); + internDep.getVariable(0).propagate(dependencyChecker.getType("java.lang.String")); + internDep.use(); + + dependencyChecker.linkMethod(new MethodReference(String.class, "length", int.class), null).use(); + dependencyChecker.linkMethod(new MethodReference(Object.class, "clone", Object.class), null).use(); + dependencyChecker.linkMethod(new MethodReference(Thread.class, "currentThread", Thread.class), null).use(); + dependencyChecker.linkMethod(new MethodReference(Thread.class, "getMainThread", Thread.class), null).use(); + dependencyChecker.linkMethod( + new MethodReference(Thread.class, "setCurrentThread", Thread.class, void.class), null).use(); + MethodDependency exceptionCons = dependencyChecker.linkMethod(new MethodReference( + NoClassDefFoundError.class, "", String.class, void.class), null); + + exceptionCons.getVariable(0).propagate(dependencyChecker.getType(NoClassDefFoundError.class.getName())); + exceptionCons.getVariable(1).propagate(dependencyChecker.getType("java.lang.String")); + exceptionCons = dependencyChecker.linkMethod(new MethodReference(NoSuchFieldError.class, "", + String.class, void.class), null); + exceptionCons.use(); + exceptionCons.getVariable(0).propagate(dependencyChecker.getType(NoSuchFieldError.class.getName())); + exceptionCons.getVariable(1).propagate(dependencyChecker.getType("java.lang.String")); + exceptionCons = dependencyChecker.linkMethod(new MethodReference(NoSuchMethodError.class, "", + String.class, void.class), null); + exceptionCons.use(); + exceptionCons.getVariable(0).propagate(dependencyChecker.getType(NoSuchMethodError.class.getName())); + exceptionCons.getVariable(1).propagate(dependencyChecker.getType("java.lang.String")); + } + + @Override + public void emit(ListableClassHolderSource classes, OutputStream output, BuildTarget target) { + try (Writer writer = new OutputStreamWriter(output, "UTF-8")) { + emit(classes, writer, target); + } catch (IOException e) { + throw new RenderingException(e); + } + } + + private void emit(ListableClassHolderSource classes, Writer writer, BuildTarget target) { + List clsNodes = modelToAst(classes); + if (controller.wasCancelled()) { + return; + } + + AliasProvider aliasProvider = minifying ? new MinifyingAliasProvider() : new DefaultAliasProvider(); + DefaultNamingStrategy naming = new DefaultNamingStrategy(aliasProvider, controller.getUnprocessedClassSource()); + SourceWriterBuilder builder = new SourceWriterBuilder(naming); + builder.setMinified(minifying); + SourceWriter sourceWriter = builder.build(writer); + + Renderer renderer = new Renderer(sourceWriter, classes, controller.getClassLoader(), controller.getServices(), + asyncMethods, asyncFamilyMethods, controller.getDiagnostics()); + renderer.setProperties(controller.getProperties()); + renderer.setMinifying(minifying); + if (debugEmitter != null) { + for (String className : classes.getClassNames()) { + ClassHolder cls = classes.get(className); + for (MethodHolder method : cls.getMethods()) { + if (method.getProgram() != null) { + emitCFG(debugEmitter, method.getProgram()); + } + } + if (controller.wasCancelled()) { + return; + } + } + renderer.setDebugEmitter(debugEmitter); + } + renderer.getDebugEmitter().setLocationProvider(sourceWriter); + for (Map.Entry entry : methodInjectors.entrySet()) { + renderer.addInjector(entry.getKey(), entry.getValue()); + } + try { + for (RendererListener listener : rendererListeners) { + listener.begin(renderer, target); + } + sourceWriter.append("\"use strict\";").newLine(); + renderer.renderRuntime(); + renderer.render(clsNodes); + renderer.renderStringPool(); + for (Map.Entry entry : controller.getEntryPoints().entrySet()) { + sourceWriter.append("var ").append(entry.getKey()).ws().append("=").ws(); + MethodReference ref = entry.getValue().getReference(); + sourceWriter.append(naming.getFullNameFor(ref)); + sourceWriter.append(";").newLine(); + } + for (Map.Entry entry : controller.getExportedClasses().entrySet()) { + sourceWriter.append("var ").append(entry.getKey()).ws().append("=").ws() + .appendClass(entry.getValue()).append(";").newLine(); + } + for (RendererListener listener : rendererListeners) { + listener.complete(); + } + } catch (IOException e) { + throw new RenderingException("IO Error occured", e); + } + } + + private List modelToAst(ListableClassHolderSource classes) { + AsyncMethodFinder asyncFinder = new AsyncMethodFinder(controller.getDependencyInfo().getCallGraph(), + controller.getDiagnostics()); + asyncFinder.find(classes); + asyncMethods.addAll(asyncFinder.getAsyncMethods()); + asyncFamilyMethods.addAll(asyncFinder.getAsyncFamilyMethods()); + + Decompiler decompiler = new Decompiler(classes, controller.getClassLoader(), asyncMethods, asyncFamilyMethods); + decompiler.setRegularMethodCache(controller.isIncremental() ? astCache : null); + + for (Map.Entry entry : methodGenerators.entrySet()) { + decompiler.addGenerator(entry.getKey(), entry.getValue()); + } + for (MethodReference injectedMethod : methodInjectors.keySet()) { + decompiler.addMethodToSkip(injectedMethod); + } + List classOrder = decompiler.getClassOrdering(classes.getClassNames()); + List classNodes = new ArrayList<>(); + for (String className : classOrder) { + ClassHolder cls = classes.get(className); + for (MethodHolder method : cls.getMethods()) { + preprocessNativeMethod(method); + if (controller.wasCancelled()) { + break; + } + } + classNodes.add(decompiler.decompile(cls)); + } + return classNodes; + } + + private void preprocessNativeMethod(MethodHolder method) { + if (!method.getModifiers().contains(ElementModifier.NATIVE) + || methodGenerators.get(method.getReference()) != null + || methodInjectors.get(method.getReference()) != null + || method.getAnnotations().get(GeneratedBy.class.getName()) != null + || method.getAnnotations().get(InjectedBy.class.getName()) != null) { + return; + } + method.getModifiers().remove(ElementModifier.NATIVE); + + Program program = new Program(); + method.setProgram(program); + BasicBlock block = program.createBasicBlock(); + Variable exceptionVar = program.createVariable(); + ConstructInstruction newExceptionInsn = new ConstructInstruction(); + newExceptionInsn.setType(NoSuchMethodError.class.getName()); + newExceptionInsn.setReceiver(exceptionVar); + block.getInstructions().add(newExceptionInsn); + + Variable constVar = program.createVariable(); + StringConstantInstruction constInsn = new StringConstantInstruction(); + constInsn.setConstant("Native method implementation not found: " + method.getReference()); + constInsn.setReceiver(constVar); + block.getInstructions().add(constInsn); + + InvokeInstruction initExceptionInsn = new InvokeInstruction(); + initExceptionInsn.setInstance(exceptionVar); + initExceptionInsn.setMethod(new MethodReference(NoSuchMethodError.class, "", String.class, void.class)); + initExceptionInsn.setType(InvocationType.SPECIAL); + initExceptionInsn.getArguments().add(constVar); + block.getInstructions().add(initExceptionInsn); + + RaiseInstruction raiseInsn = new RaiseInstruction(); + raiseInsn.setException(exceptionVar); + block.getInstructions().add(raiseInsn); + + controller.getDiagnostics().error(new CallLocation(method.getReference()), + "Native method {{m0}} has no implementation", method.getReference()); + } + + private void emitCFG(DebugInformationEmitter emitter, Program program) { + Map cfg = ProgramUtils.getLocationCFG(program); + for (Map.Entry entry : cfg.entrySet()) { + SourceLocation location = map(entry.getKey()); + SourceLocation[] successors = new SourceLocation[entry.getValue().length]; + for (int i = 0; i < entry.getValue().length; ++i) { + successors[i] = map(entry.getValue()[i]); + } + emitter.addSuccessors(location, successors); + } + } + + private static SourceLocation map(TextLocation location) { + if (location == null) { + return null; + } + return new SourceLocation(location.getFileName(), location.getLine()); + } +} diff --git a/core/src/main/java/org/teavm/javascript/NullPointerExceptionTransformer.java b/core/src/main/java/org/teavm/backend/javascript/NullPointerExceptionTransformer.java similarity index 96% rename from core/src/main/java/org/teavm/javascript/NullPointerExceptionTransformer.java rename to core/src/main/java/org/teavm/backend/javascript/NullPointerExceptionTransformer.java index 368bb2de0..7ebdd12ad 100644 --- a/core/src/main/java/org/teavm/javascript/NullPointerExceptionTransformer.java +++ b/core/src/main/java/org/teavm/backend/javascript/NullPointerExceptionTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript; import org.teavm.diagnostics.Diagnostics; import org.teavm.model.*; diff --git a/core/src/main/java/org/teavm/javascript/RuntimeSupport.java b/core/src/main/java/org/teavm/backend/javascript/RuntimeSupport.java similarity index 91% rename from core/src/main/java/org/teavm/javascript/RuntimeSupport.java rename to core/src/main/java/org/teavm/backend/javascript/RuntimeSupport.java index ae9ba47db..ab1920207 100644 --- a/core/src/main/java/org/teavm/javascript/RuntimeSupport.java +++ b/core/src/main/java/org/teavm/backend/javascript/RuntimeSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript; public final class RuntimeSupport { private RuntimeSupport() { diff --git a/core/src/main/java/org/teavm/javascript/backend/TeaVMJavaScriptHost.java b/core/src/main/java/org/teavm/backend/javascript/TeaVMJavaScriptHost.java similarity index 87% rename from core/src/main/java/org/teavm/javascript/backend/TeaVMJavaScriptHost.java rename to core/src/main/java/org/teavm/backend/javascript/TeaVMJavaScriptHost.java index 31665137b..39f1b1b8c 100644 --- a/core/src/main/java/org/teavm/javascript/backend/TeaVMJavaScriptHost.java +++ b/core/src/main/java/org/teavm/backend/javascript/TeaVMJavaScriptHost.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.backend; +package org.teavm.backend.javascript; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.Injector; import org.teavm.model.MethodReference; import org.teavm.vm.spi.RendererListener; import org.teavm.vm.spi.TeaVMHostExtension; diff --git a/core/src/main/java/org/teavm/codegen/AliasProvider.java b/core/src/main/java/org/teavm/backend/javascript/codegen/AliasProvider.java similarity index 92% rename from core/src/main/java/org/teavm/codegen/AliasProvider.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/AliasProvider.java index 212f4bdaf..b4f141f79 100644 --- a/core/src/main/java/org/teavm/codegen/AliasProvider.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/AliasProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import org.teavm.model.FieldReference; import org.teavm.model.MethodDescriptor; diff --git a/core/src/main/java/org/teavm/codegen/DefaultAliasProvider.java b/core/src/main/java/org/teavm/backend/javascript/codegen/DefaultAliasProvider.java similarity index 97% rename from core/src/main/java/org/teavm/codegen/DefaultAliasProvider.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/DefaultAliasProvider.java index 9075398ae..2ba1fd934 100644 --- a/core/src/main/java/org/teavm/codegen/DefaultAliasProvider.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/DefaultAliasProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import java.util.HashMap; import java.util.HashSet; diff --git a/core/src/main/java/org/teavm/codegen/DefaultNamingStrategy.java b/core/src/main/java/org/teavm/backend/javascript/codegen/DefaultNamingStrategy.java similarity index 95% rename from core/src/main/java/org/teavm/codegen/DefaultNamingStrategy.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/DefaultNamingStrategy.java index 0bedb03ef..d1d7f0338 100644 --- a/core/src/main/java/org/teavm/codegen/DefaultNamingStrategy.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/DefaultNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import java.util.HashMap; import java.util.Map; @@ -41,11 +41,7 @@ public class DefaultNamingStrategy implements NamingStrategy { @Override public String getNameFor(MethodDescriptor method) { - return getNameFor(method, 'M'); - } - - private String getNameFor(MethodDescriptor method, char classifier) { - String key = classifier + method.toString(); + String key = method.toString(); String alias = aliases.get(key); if (alias == null) { alias = aliasProvider.getMethodAlias(method); diff --git a/core/src/main/java/org/teavm/codegen/LocationProvider.java b/core/src/main/java/org/teavm/backend/javascript/codegen/LocationProvider.java similarity index 89% rename from core/src/main/java/org/teavm/codegen/LocationProvider.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/LocationProvider.java index 18d5e9db6..50745fad0 100644 --- a/core/src/main/java/org/teavm/codegen/LocationProvider.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/LocationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; /** * diff --git a/core/src/main/java/org/teavm/codegen/MinifyingAliasProvider.java b/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java similarity index 97% rename from core/src/main/java/org/teavm/codegen/MinifyingAliasProvider.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java index b7965aaf1..3710047d5 100644 --- a/core/src/main/java/org/teavm/codegen/MinifyingAliasProvider.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import java.util.Arrays; import java.util.HashSet; diff --git a/core/src/main/java/org/teavm/codegen/NameFrequencyConsumer.java b/core/src/main/java/org/teavm/backend/javascript/codegen/NameFrequencyConsumer.java similarity index 92% rename from core/src/main/java/org/teavm/codegen/NameFrequencyConsumer.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/NameFrequencyConsumer.java index 558e2eab8..d770a177e 100644 --- a/core/src/main/java/org/teavm/codegen/NameFrequencyConsumer.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/NameFrequencyConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import org.teavm.model.FieldReference; import org.teavm.model.MethodDescriptor; diff --git a/core/src/main/java/org/teavm/codegen/NamingException.java b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingException.java similarity index 91% rename from core/src/main/java/org/teavm/codegen/NamingException.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/NamingException.java index 291c58e41..a7d359081 100644 --- a/core/src/main/java/org/teavm/codegen/NamingException.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; /** * diff --git a/core/src/main/java/org/teavm/codegen/NamingOrderer.java b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingOrderer.java similarity index 97% rename from core/src/main/java/org/teavm/codegen/NamingOrderer.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/NamingOrderer.java index 674493370..d2fa5df72 100644 --- a/core/src/main/java/org/teavm/codegen/NamingOrderer.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingOrderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import java.util.*; import org.teavm.model.FieldReference; diff --git a/core/src/main/java/org/teavm/codegen/NamingStrategy.java b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingStrategy.java similarity index 93% rename from core/src/main/java/org/teavm/codegen/NamingStrategy.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/NamingStrategy.java index 8108ed403..f0554cd1b 100644 --- a/core/src/main/java/org/teavm/codegen/NamingStrategy.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/NamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import org.teavm.model.FieldReference; import org.teavm.model.MethodDescriptor; diff --git a/core/src/main/java/org/teavm/codegen/SourceWriter.java b/core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriter.java similarity index 98% rename from core/src/main/java/org/teavm/codegen/SourceWriter.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriter.java index c6c25814e..1effd2742 100644 --- a/core/src/main/java/org/teavm/codegen/SourceWriter.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; import java.io.IOException; import org.teavm.model.FieldReference; diff --git a/core/src/main/java/org/teavm/codegen/SourceWriterBuilder.java b/core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriterBuilder.java similarity index 94% rename from core/src/main/java/org/teavm/codegen/SourceWriterBuilder.java rename to core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriterBuilder.java index 35796b388..1b51b8d5d 100644 --- a/core/src/main/java/org/teavm/codegen/SourceWriterBuilder.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/SourceWriterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.codegen; +package org.teavm.backend.javascript.codegen; /** * diff --git a/core/src/main/java/org/teavm/javascript/NameFrequencyEstimator.java b/core/src/main/java/org/teavm/backend/javascript/rendering/NameFrequencyEstimator.java similarity index 98% rename from core/src/main/java/org/teavm/javascript/NameFrequencyEstimator.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/NameFrequencyEstimator.java index 1ff965eb1..44b44de63 100644 --- a/core/src/main/java/org/teavm/javascript/NameFrequencyEstimator.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/NameFrequencyEstimator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; import java.util.List; import java.util.Set; @@ -60,7 +60,7 @@ import org.teavm.ast.UnaryExpr; import org.teavm.ast.UnwrapArrayExpr; import org.teavm.ast.VariableExpr; import org.teavm.ast.WhileStatement; -import org.teavm.codegen.NameFrequencyConsumer; +import org.teavm.backend.javascript.codegen.NameFrequencyConsumer; import org.teavm.model.ClassReader; import org.teavm.model.ClassReaderSource; import org.teavm.model.ElementModifier; diff --git a/core/src/main/java/org/teavm/javascript/Precedence.java b/core/src/main/java/org/teavm/backend/javascript/rendering/Precedence.java similarity index 93% rename from core/src/main/java/org/teavm/javascript/Precedence.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/Precedence.java index 91d942869..d28825597 100644 --- a/core/src/main/java/org/teavm/javascript/Precedence.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/Precedence.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; public enum Precedence { COMMA, diff --git a/core/src/main/java/org/teavm/javascript/Renderer.java b/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java similarity index 99% rename from core/src/main/java/org/teavm/javascript/Renderer.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java index ea7ef265c..8d664f90b 100644 --- a/core/src/main/java/org/teavm/javascript/Renderer.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; import java.io.IOException; import java.lang.reflect.Constructor; @@ -75,19 +75,19 @@ import org.teavm.ast.UnwrapArrayExpr; import org.teavm.ast.VariableExpr; import org.teavm.ast.VariableNode; import org.teavm.ast.WhileStatement; -import org.teavm.codegen.NamingException; -import org.teavm.codegen.NamingOrderer; -import org.teavm.codegen.NamingStrategy; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.NamingException; +import org.teavm.backend.javascript.codegen.NamingOrderer; +import org.teavm.backend.javascript.codegen.NamingStrategy; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.common.ServiceRepository; import org.teavm.debugging.information.DebugInformationEmitter; import org.teavm.debugging.information.DeferredCallSite; import org.teavm.debugging.information.DummyDebugInformationEmitter; import org.teavm.diagnostics.Diagnostics; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.InjectedBy; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.AnnotationHolder; import org.teavm.model.ClassHolder; import org.teavm.model.ClassReader; diff --git a/core/src/main/java/org/teavm/javascript/RenderingContext.java b/core/src/main/java/org/teavm/backend/javascript/rendering/RenderingContext.java similarity index 82% rename from core/src/main/java/org/teavm/javascript/RenderingContext.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/RenderingContext.java index edf9181d0..d2eea7af1 100644 --- a/core/src/main/java/org/teavm/javascript/RenderingContext.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/RenderingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; import java.util.Properties; -import org.teavm.codegen.NamingStrategy; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.NamingStrategy; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.common.ServiceRepository; import org.teavm.model.ListableClassReaderSource; diff --git a/core/src/main/java/org/teavm/javascript/RenderingException.java b/core/src/main/java/org/teavm/backend/javascript/rendering/RenderingException.java similarity index 92% rename from core/src/main/java/org/teavm/javascript/RenderingException.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/RenderingException.java index a1fedf9d2..035a02daa 100644 --- a/core/src/main/java/org/teavm/javascript/RenderingException.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/RenderingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; public class RenderingException extends RuntimeException { private static final long serialVersionUID = 631804556597569547L; diff --git a/core/src/main/java/org/teavm/javascript/TryCatchFinder.java b/core/src/main/java/org/teavm/backend/javascript/rendering/TryCatchFinder.java similarity index 97% rename from core/src/main/java/org/teavm/javascript/TryCatchFinder.java rename to core/src/main/java/org/teavm/backend/javascript/rendering/TryCatchFinder.java index 8d567b824..d426d3789 100644 --- a/core/src/main/java/org/teavm/javascript/TryCatchFinder.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/TryCatchFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript; +package org.teavm.backend.javascript.rendering; import java.util.List; import org.teavm.ast.AssignmentStatement; diff --git a/core/src/main/java/org/teavm/javascript/spi/GeneratedBy.java b/core/src/main/java/org/teavm/backend/javascript/spi/GeneratedBy.java similarity index 92% rename from core/src/main/java/org/teavm/javascript/spi/GeneratedBy.java rename to core/src/main/java/org/teavm/backend/javascript/spi/GeneratedBy.java index 94a323832..9f1c3919b 100644 --- a/core/src/main/java/org/teavm/javascript/spi/GeneratedBy.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/GeneratedBy.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/core/src/main/java/org/teavm/javascript/spi/Generator.java b/core/src/main/java/org/teavm/backend/javascript/spi/Generator.java similarity index 85% rename from core/src/main/java/org/teavm/javascript/spi/Generator.java rename to core/src/main/java/org/teavm/backend/javascript/spi/Generator.java index ad6389d12..0b0b3fc99 100644 --- a/core/src/main/java/org/teavm/javascript/spi/Generator.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/Generator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.model.MethodReference; /** diff --git a/core/src/main/java/org/teavm/javascript/spi/GeneratorContext.java b/core/src/main/java/org/teavm/backend/javascript/spi/GeneratorContext.java similarity index 93% rename from core/src/main/java/org/teavm/javascript/spi/GeneratorContext.java rename to core/src/main/java/org/teavm/backend/javascript/spi/GeneratorContext.java index 90d1ff82f..a8c39149a 100644 --- a/core/src/main/java/org/teavm/javascript/spi/GeneratorContext.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/GeneratorContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.util.Properties; import org.teavm.common.ServiceRepository; diff --git a/core/src/main/java/org/teavm/javascript/spi/InjectedBy.java b/core/src/main/java/org/teavm/backend/javascript/spi/InjectedBy.java similarity index 91% rename from core/src/main/java/org/teavm/javascript/spi/InjectedBy.java rename to core/src/main/java/org/teavm/backend/javascript/spi/InjectedBy.java index fc9508058..032206ea2 100644 --- a/core/src/main/java/org/teavm/javascript/spi/InjectedBy.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/InjectedBy.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/core/src/main/java/org/teavm/javascript/spi/Injector.java b/core/src/main/java/org/teavm/backend/javascript/spi/Injector.java similarity index 91% rename from core/src/main/java/org/teavm/javascript/spi/Injector.java rename to core/src/main/java/org/teavm/backend/javascript/spi/Injector.java index 07dec9afa..002a20358 100644 --- a/core/src/main/java/org/teavm/javascript/spi/Injector.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.io.IOException; import org.teavm.model.MethodReference; diff --git a/core/src/main/java/org/teavm/javascript/spi/InjectorContext.java b/core/src/main/java/org/teavm/backend/javascript/spi/InjectorContext.java similarity index 87% rename from core/src/main/java/org/teavm/javascript/spi/InjectorContext.java rename to core/src/main/java/org/teavm/backend/javascript/spi/InjectorContext.java index a525354e6..a56438030 100644 --- a/core/src/main/java/org/teavm/javascript/spi/InjectorContext.java +++ b/core/src/main/java/org/teavm/backend/javascript/spi/InjectorContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.javascript.spi; +package org.teavm.backend.javascript.spi; import java.io.IOException; import java.util.Properties; import org.teavm.ast.Expr; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.common.ServiceRepository; -import org.teavm.javascript.Precedence; +import org.teavm.backend.javascript.rendering.Precedence; import org.teavm.model.ListableClassReaderSource; import org.teavm.model.ValueType; diff --git a/core/src/main/java/org/teavm/wasm/Example.java b/core/src/main/java/org/teavm/backend/wasm/Example.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/Example.java rename to core/src/main/java/org/teavm/backend/wasm/Example.java index 54480a1ab..a6ff26462 100644 --- a/core/src/main/java/org/teavm/wasm/Example.java +++ b/core/src/main/java/org/teavm/backend/wasm/Example.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm; +package org.teavm.backend.wasm; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/wasm/WasmRuntime.java b/core/src/main/java/org/teavm/backend/wasm/WasmRuntime.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/WasmRuntime.java rename to core/src/main/java/org/teavm/backend/wasm/WasmRuntime.java index de954c511..6b4252926 100644 --- a/core/src/main/java/org/teavm/wasm/WasmRuntime.java +++ b/core/src/main/java/org/teavm/backend/wasm/WasmRuntime.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm; +package org.teavm.backend.wasm; import org.teavm.interop.Address; import org.teavm.interop.Import; diff --git a/core/src/main/java/org/teavm/wasm/WasmTarget.java b/core/src/main/java/org/teavm/backend/wasm/WasmTarget.java similarity index 88% rename from core/src/main/java/org/teavm/wasm/WasmTarget.java rename to core/src/main/java/org/teavm/backend/wasm/WasmTarget.java index a271a0fd1..afd53b334 100644 --- a/core/src/main/java/org/teavm/wasm/WasmTarget.java +++ b/core/src/main/java/org/teavm/backend/wasm/WasmTarget.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm; +package org.teavm.backend.wasm; import java.io.IOException; import java.io.OutputStream; @@ -65,41 +65,41 @@ import org.teavm.vm.TeaVMEntryPoint; import org.teavm.vm.TeaVMTarget; import org.teavm.vm.TeaVMTargetController; import org.teavm.vm.spi.TeaVMHostExtension; -import org.teavm.wasm.binary.BinaryWriter; -import org.teavm.wasm.generate.WasmClassGenerator; -import org.teavm.wasm.generate.WasmDependencyListener; -import org.teavm.wasm.generate.WasmGenerationContext; -import org.teavm.wasm.generate.WasmGenerator; -import org.teavm.wasm.generate.WasmMangling; -import org.teavm.wasm.generate.WasmStringPool; -import org.teavm.wasm.intrinsics.AllocatorIntrinsic; -import org.teavm.wasm.intrinsics.ClassIntrinsic; -import org.teavm.wasm.intrinsics.PlatformClassIntrinsic; -import org.teavm.wasm.intrinsics.PlatformClassMetadataIntrinsic; -import org.teavm.wasm.intrinsics.PlatformIntrinsic; -import org.teavm.wasm.intrinsics.PlatformObjectIntrinsic; -import org.teavm.wasm.intrinsics.WasmAddressIntrinsic; -import org.teavm.wasm.intrinsics.WasmRuntimeIntrinsic; -import org.teavm.wasm.intrinsics.WasmStructureIntrinsic; -import org.teavm.wasm.model.WasmFunction; -import org.teavm.wasm.model.WasmMemorySegment; -import org.teavm.wasm.model.WasmModule; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmBlock; -import org.teavm.wasm.model.expression.WasmBranch; -import org.teavm.wasm.model.expression.WasmCall; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmInt32Constant; -import org.teavm.wasm.model.expression.WasmInt32Subtype; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmLoadInt32; -import org.teavm.wasm.model.expression.WasmReturn; -import org.teavm.wasm.model.expression.WasmStoreInt32; -import org.teavm.wasm.patches.ClassPatch; -import org.teavm.wasm.patches.ObjectPatch; -import org.teavm.wasm.render.WasmRenderer; +import org.teavm.backend.wasm.binary.BinaryWriter; +import org.teavm.backend.wasm.generate.WasmClassGenerator; +import org.teavm.backend.wasm.generate.WasmDependencyListener; +import org.teavm.backend.wasm.generate.WasmGenerationContext; +import org.teavm.backend.wasm.generate.WasmGenerator; +import org.teavm.backend.wasm.generate.WasmMangling; +import org.teavm.backend.wasm.generate.WasmStringPool; +import org.teavm.backend.wasm.intrinsics.AllocatorIntrinsic; +import org.teavm.backend.wasm.intrinsics.ClassIntrinsic; +import org.teavm.backend.wasm.intrinsics.PlatformClassIntrinsic; +import org.teavm.backend.wasm.intrinsics.PlatformClassMetadataIntrinsic; +import org.teavm.backend.wasm.intrinsics.PlatformIntrinsic; +import org.teavm.backend.wasm.intrinsics.PlatformObjectIntrinsic; +import org.teavm.backend.wasm.intrinsics.WasmAddressIntrinsic; +import org.teavm.backend.wasm.intrinsics.WasmRuntimeIntrinsic; +import org.teavm.backend.wasm.intrinsics.WasmStructureIntrinsic; +import org.teavm.backend.wasm.model.WasmFunction; +import org.teavm.backend.wasm.model.WasmMemorySegment; +import org.teavm.backend.wasm.model.WasmModule; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmBlock; +import org.teavm.backend.wasm.model.expression.WasmBranch; +import org.teavm.backend.wasm.model.expression.WasmCall; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.model.expression.WasmInt32Subtype; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.model.expression.WasmReturn; +import org.teavm.backend.wasm.model.expression.WasmStoreInt32; +import org.teavm.backend.wasm.patches.ClassPatch; +import org.teavm.backend.wasm.patches.ObjectPatch; +import org.teavm.backend.wasm.render.WasmRenderer; public class WasmTarget implements TeaVMTarget { private TeaVMTargetController controller; diff --git a/core/src/main/java/org/teavm/wasm/binary/AddressMode.java b/core/src/main/java/org/teavm/backend/wasm/binary/AddressMode.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/binary/AddressMode.java rename to core/src/main/java/org/teavm/backend/wasm/binary/AddressMode.java index d7e0ae9f3..15afad40a 100644 --- a/core/src/main/java/org/teavm/wasm/binary/AddressMode.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/AddressMode.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public enum AddressMode { ADDRESS_32, diff --git a/core/src/main/java/org/teavm/wasm/binary/BinaryWriter.java b/core/src/main/java/org/teavm/backend/wasm/binary/BinaryWriter.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/binary/BinaryWriter.java rename to core/src/main/java/org/teavm/backend/wasm/binary/BinaryWriter.java index 7a4aa2b12..7b9c18be6 100644 --- a/core/src/main/java/org/teavm/wasm/binary/BinaryWriter.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/BinaryWriter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/wasm/binary/DataArray.java b/core/src/main/java/org/teavm/backend/wasm/binary/DataArray.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/binary/DataArray.java rename to core/src/main/java/org/teavm/backend/wasm/binary/DataArray.java index 9fd06c12b..7be302d88 100644 --- a/core/src/main/java/org/teavm/wasm/binary/DataArray.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/DataArray.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public class DataArray extends DataType { private DataType componentType; diff --git a/core/src/main/java/org/teavm/wasm/binary/DataPrimitives.java b/core/src/main/java/org/teavm/backend/wasm/binary/DataPrimitives.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/binary/DataPrimitives.java rename to core/src/main/java/org/teavm/backend/wasm/binary/DataPrimitives.java index 267823b76..13f23e085 100644 --- a/core/src/main/java/org/teavm/wasm/binary/DataPrimitives.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/DataPrimitives.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public final class DataPrimitives { private DataPrimitives() { diff --git a/core/src/main/java/org/teavm/wasm/binary/DataStructure.java b/core/src/main/java/org/teavm/backend/wasm/binary/DataStructure.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/binary/DataStructure.java rename to core/src/main/java/org/teavm/backend/wasm/binary/DataStructure.java index c4017fec2..5e6534fb1 100644 --- a/core/src/main/java/org/teavm/wasm/binary/DataStructure.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/DataStructure.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public class DataStructure extends DataType { private byte alignment; diff --git a/core/src/main/java/org/teavm/wasm/binary/DataType.java b/core/src/main/java/org/teavm/backend/wasm/binary/DataType.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/binary/DataType.java rename to core/src/main/java/org/teavm/backend/wasm/binary/DataType.java index c34efc019..fae8172fc 100644 --- a/core/src/main/java/org/teavm/wasm/binary/DataType.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/DataType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public abstract class DataType { public abstract DataValue createValue(); diff --git a/core/src/main/java/org/teavm/wasm/binary/DataValue.java b/core/src/main/java/org/teavm/backend/wasm/binary/DataValue.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/binary/DataValue.java rename to core/src/main/java/org/teavm/backend/wasm/binary/DataValue.java index 48bacbf7c..cc4ed1e17 100644 --- a/core/src/main/java/org/teavm/wasm/binary/DataValue.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/DataValue.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; public abstract class DataValue { private DataType type; diff --git a/core/src/main/java/org/teavm/wasm/binary/MetadataWriter.java b/core/src/main/java/org/teavm/backend/wasm/binary/MetadataWriter.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/binary/MetadataWriter.java rename to core/src/main/java/org/teavm/backend/wasm/binary/MetadataWriter.java index 2219e234d..0fc766ea9 100644 --- a/core/src/main/java/org/teavm/wasm/binary/MetadataWriter.java +++ b/core/src/main/java/org/teavm/backend/wasm/binary/MetadataWriter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.binary; +package org.teavm.backend.wasm.binary; import java.util.Arrays; import java.util.HashMap; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmClassGenerator.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmClassGenerator.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/generate/WasmClassGenerator.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmClassGenerator.java index 3be1beb81..94d975f69 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmClassGenerator.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmClassGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import com.carrotsearch.hppc.ObjectIntMap; import com.carrotsearch.hppc.ObjectIntOpenHashMap; @@ -37,12 +37,12 @@ import org.teavm.model.classes.VirtualTable; import org.teavm.model.classes.VirtualTableEntry; import org.teavm.model.classes.VirtualTableProvider; import org.teavm.runtime.RuntimeClass; -import org.teavm.wasm.binary.BinaryWriter; -import org.teavm.wasm.binary.DataArray; -import org.teavm.wasm.binary.DataPrimitives; -import org.teavm.wasm.binary.DataStructure; -import org.teavm.wasm.binary.DataType; -import org.teavm.wasm.binary.DataValue; +import org.teavm.backend.wasm.binary.BinaryWriter; +import org.teavm.backend.wasm.binary.DataArray; +import org.teavm.backend.wasm.binary.DataPrimitives; +import org.teavm.backend.wasm.binary.DataStructure; +import org.teavm.backend.wasm.binary.DataType; +import org.teavm.backend.wasm.binary.DataValue; public class WasmClassGenerator { private ClassReaderSource classSource; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmDependencyListener.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmDependencyListener.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/generate/WasmDependencyListener.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmDependencyListener.java index 97b3e67a8..c929edbaa 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmDependencyListener.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmDependencyListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import org.teavm.dependency.AbstractDependencyListener; import org.teavm.dependency.DependencyAgent; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmGenerationContext.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationContext.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/generate/WasmGenerationContext.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationContext.java index cee817eef..12debb171 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmGenerationContext.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationContext.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import java.util.ArrayList; import java.util.HashMap; @@ -32,7 +32,7 @@ import org.teavm.model.MethodReference; import org.teavm.model.ValueType; import org.teavm.model.classes.TagRegistry; import org.teavm.model.classes.VirtualTableProvider; -import org.teavm.wasm.intrinsics.WasmIntrinsic; +import org.teavm.backend.wasm.intrinsics.WasmIntrinsic; public class WasmGenerationContext { private ClassReaderSource classSource; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmGenerationVisitor.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/generate/WasmGenerationVisitor.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java index eac0c5294..3a82063e3 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmGenerationVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerationVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import java.util.Arrays; import java.util.Collections; @@ -72,46 +72,46 @@ import org.teavm.model.classes.VirtualTableEntry; import org.teavm.runtime.Allocator; import org.teavm.runtime.RuntimeArray; import org.teavm.runtime.RuntimeClass; -import org.teavm.wasm.WasmRuntime; -import org.teavm.wasm.intrinsics.WasmIntrinsic; -import org.teavm.wasm.intrinsics.WasmIntrinsicManager; -import org.teavm.wasm.model.WasmFunction; -import org.teavm.wasm.model.WasmLocal; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmBlock; -import org.teavm.wasm.model.expression.WasmBranch; -import org.teavm.wasm.model.expression.WasmBreak; -import org.teavm.wasm.model.expression.WasmCall; -import org.teavm.wasm.model.expression.WasmConditional; -import org.teavm.wasm.model.expression.WasmConversion; -import org.teavm.wasm.model.expression.WasmDrop; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmFloat32Constant; -import org.teavm.wasm.model.expression.WasmFloat64Constant; -import org.teavm.wasm.model.expression.WasmFloatBinary; -import org.teavm.wasm.model.expression.WasmFloatBinaryOperation; -import org.teavm.wasm.model.expression.WasmFloatType; -import org.teavm.wasm.model.expression.WasmGetLocal; -import org.teavm.wasm.model.expression.WasmIndirectCall; -import org.teavm.wasm.model.expression.WasmInt32Constant; -import org.teavm.wasm.model.expression.WasmInt32Subtype; -import org.teavm.wasm.model.expression.WasmInt64Constant; -import org.teavm.wasm.model.expression.WasmInt64Subtype; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmLoadFloat32; -import org.teavm.wasm.model.expression.WasmLoadFloat64; -import org.teavm.wasm.model.expression.WasmLoadInt32; -import org.teavm.wasm.model.expression.WasmLoadInt64; -import org.teavm.wasm.model.expression.WasmReturn; -import org.teavm.wasm.model.expression.WasmSetLocal; -import org.teavm.wasm.model.expression.WasmStoreFloat32; -import org.teavm.wasm.model.expression.WasmStoreFloat64; -import org.teavm.wasm.model.expression.WasmStoreInt32; -import org.teavm.wasm.model.expression.WasmStoreInt64; -import org.teavm.wasm.model.expression.WasmSwitch; -import org.teavm.wasm.model.expression.WasmUnreachable; +import org.teavm.backend.wasm.WasmRuntime; +import org.teavm.backend.wasm.intrinsics.WasmIntrinsic; +import org.teavm.backend.wasm.intrinsics.WasmIntrinsicManager; +import org.teavm.backend.wasm.model.WasmFunction; +import org.teavm.backend.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmBlock; +import org.teavm.backend.wasm.model.expression.WasmBranch; +import org.teavm.backend.wasm.model.expression.WasmBreak; +import org.teavm.backend.wasm.model.expression.WasmCall; +import org.teavm.backend.wasm.model.expression.WasmConditional; +import org.teavm.backend.wasm.model.expression.WasmConversion; +import org.teavm.backend.wasm.model.expression.WasmDrop; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmFloat32Constant; +import org.teavm.backend.wasm.model.expression.WasmFloat64Constant; +import org.teavm.backend.wasm.model.expression.WasmFloatBinary; +import org.teavm.backend.wasm.model.expression.WasmFloatBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmFloatType; +import org.teavm.backend.wasm.model.expression.WasmGetLocal; +import org.teavm.backend.wasm.model.expression.WasmIndirectCall; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.model.expression.WasmInt32Subtype; +import org.teavm.backend.wasm.model.expression.WasmInt64Constant; +import org.teavm.backend.wasm.model.expression.WasmInt64Subtype; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat32; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat64; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.model.expression.WasmLoadInt64; +import org.teavm.backend.wasm.model.expression.WasmReturn; +import org.teavm.backend.wasm.model.expression.WasmSetLocal; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat32; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat64; +import org.teavm.backend.wasm.model.expression.WasmStoreInt32; +import org.teavm.backend.wasm.model.expression.WasmStoreInt64; +import org.teavm.backend.wasm.model.expression.WasmSwitch; +import org.teavm.backend.wasm.model.expression.WasmUnreachable; class WasmGenerationVisitor implements StatementVisitor, ExprVisitor { private static FieldReference tagField = new FieldReference(RuntimeClass.class.getName(), "tag"); diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmGenerator.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerator.java similarity index 86% rename from core/src/main/java/org/teavm/wasm/generate/WasmGenerator.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerator.java index 2573fcd8c..196577f46 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmGenerator.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGenerator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import org.teavm.ast.RegularMethodNode; import org.teavm.ast.VariableNode; @@ -24,21 +24,20 @@ import org.teavm.model.ElementModifier; import org.teavm.model.FieldReference; import org.teavm.model.MethodHolder; import org.teavm.model.MethodReference; -import org.teavm.model.Program; import org.teavm.model.ValueType; import org.teavm.runtime.RuntimeClass; -import org.teavm.wasm.model.WasmFunction; -import org.teavm.wasm.model.WasmLocal; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmCall; -import org.teavm.wasm.model.expression.WasmConditional; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmInt32Constant; -import org.teavm.wasm.model.expression.WasmInt32Subtype; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.model.WasmFunction; +import org.teavm.backend.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmCall; +import org.teavm.backend.wasm.model.expression.WasmConditional; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.model.expression.WasmInt32Subtype; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; public class WasmGenerator { private Decompiler decompiler; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmGeneratorUtil.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGeneratorUtil.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/generate/WasmGeneratorUtil.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmGeneratorUtil.java index b3657fbc6..0fc4b00e7 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmGeneratorUtil.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmGeneratorUtil.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import org.teavm.ast.OperationType; import org.teavm.model.ValueType; import org.teavm.model.util.VariableType; -import org.teavm.wasm.model.WasmType; +import org.teavm.backend.wasm.model.WasmType; public final class WasmGeneratorUtil { private WasmGeneratorUtil() { diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmMangling.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmMangling.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/generate/WasmMangling.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmMangling.java index 40627157d..26dff00f9 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmMangling.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmMangling.java @@ -13,11 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import java.util.Arrays; import java.util.stream.Collectors; -import org.teavm.model.MethodDescriptor; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; diff --git a/core/src/main/java/org/teavm/wasm/generate/WasmStringPool.java b/core/src/main/java/org/teavm/backend/wasm/generate/WasmStringPool.java similarity index 90% rename from core/src/main/java/org/teavm/wasm/generate/WasmStringPool.java rename to core/src/main/java/org/teavm/backend/wasm/generate/WasmStringPool.java index 6ce7d7100..133a010bc 100644 --- a/core/src/main/java/org/teavm/wasm/generate/WasmStringPool.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/WasmStringPool.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.generate; +package org.teavm.backend.wasm.generate; import java.util.HashMap; import java.util.Map; import org.teavm.model.ValueType; -import org.teavm.wasm.binary.BinaryWriter; -import org.teavm.wasm.binary.DataArray; -import org.teavm.wasm.binary.DataPrimitives; -import org.teavm.wasm.binary.DataStructure; -import org.teavm.wasm.binary.DataValue; +import org.teavm.backend.wasm.binary.BinaryWriter; +import org.teavm.backend.wasm.binary.DataArray; +import org.teavm.backend.wasm.binary.DataPrimitives; +import org.teavm.backend.wasm.binary.DataStructure; +import org.teavm.backend.wasm.binary.DataValue; public class WasmStringPool { private WasmClassGenerator classGenerator; diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/AllocatorIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/AllocatorIntrinsic.java similarity index 87% rename from core/src/main/java/org/teavm/wasm/intrinsics/AllocatorIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/AllocatorIntrinsic.java index 371d4493d..a25585a16 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/AllocatorIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/AllocatorIntrinsic.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import java.util.stream.Collectors; import org.teavm.ast.InvocationExpr; import org.teavm.interop.Address; import org.teavm.model.MethodReference; import org.teavm.runtime.Allocator; -import org.teavm.wasm.WasmRuntime; -import org.teavm.wasm.generate.WasmMangling; -import org.teavm.wasm.model.expression.WasmCall; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.WasmRuntime; +import org.teavm.backend.wasm.generate.WasmMangling; +import org.teavm.backend.wasm.model.expression.WasmCall; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class AllocatorIntrinsic implements WasmIntrinsic { @Override diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/ClassIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/ClassIntrinsic.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/intrinsics/ClassIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/ClassIntrinsic.java index e35d56450..b8584d4e2 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/ClassIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/ClassIntrinsic.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.MethodDescriptor; import org.teavm.model.MethodReference; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class ClassIntrinsic implements WasmIntrinsic { @Override diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassIntrinsic.java similarity index 90% rename from core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassIntrinsic.java index 73101d718..ebc143f30 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassIntrinsic.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.MethodReference; -import org.teavm.wasm.model.expression.WasmBlock; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmBlock; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class PlatformClassIntrinsic implements WasmIntrinsic { private static final String PLATFORM_CLASS_NAME = "org.teavm.platform.PlatformClass"; diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassMetadataIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassMetadataIntrinsic.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassMetadataIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassMetadataIntrinsic.java index 41ce79004..81d7cf9fb 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformClassMetadataIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformClassMetadataIntrinsic.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.ast.QualificationExpr; import org.teavm.model.FieldReference; import org.teavm.model.MethodReference; import org.teavm.runtime.RuntimeClass; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class PlatformClassMetadataIntrinsic implements WasmIntrinsic { private static final String PLATFORM_CLASS_METADATA_NAME = "org.teavm.platform.PlatformClassMetadata"; diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformIntrinsic.java similarity index 92% rename from core/src/main/java/org/teavm/wasm/intrinsics/PlatformIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformIntrinsic.java index b1bdefca4..cfb2032be 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformIntrinsic.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.MethodReference; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class PlatformIntrinsic implements WasmIntrinsic { private static final String PLATFORM = "org.teavm.platform.Platform"; diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformObjectIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformObjectIntrinsic.java similarity index 80% rename from core/src/main/java/org/teavm/wasm/intrinsics/PlatformObjectIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformObjectIntrinsic.java index 3f25f8273..2008032c0 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/PlatformObjectIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/PlatformObjectIntrinsic.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.FieldReference; import org.teavm.model.MethodReference; import org.teavm.runtime.RuntimeObject; -import org.teavm.wasm.generate.WasmClassGenerator; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmInt32Constant; -import org.teavm.wasm.model.expression.WasmInt32Subtype; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.generate.WasmClassGenerator; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.model.expression.WasmInt32Subtype; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; public class PlatformObjectIntrinsic implements WasmIntrinsic { private static final String PLATFORM_OBJECT = "org.teavm.platform.PlatformObject"; diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/WasmAddressIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmAddressIntrinsic.java similarity index 84% rename from core/src/main/java/org/teavm/wasm/intrinsics/WasmAddressIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmAddressIntrinsic.java index dd85623ac..da5f75457 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/WasmAddressIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmAddressIntrinsic.java @@ -13,28 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.interop.Address; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmConversion; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmInt32Subtype; -import org.teavm.wasm.model.expression.WasmInt64Subtype; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmLoadFloat32; -import org.teavm.wasm.model.expression.WasmLoadFloat64; -import org.teavm.wasm.model.expression.WasmLoadInt32; -import org.teavm.wasm.model.expression.WasmLoadInt64; -import org.teavm.wasm.model.expression.WasmStoreFloat32; -import org.teavm.wasm.model.expression.WasmStoreFloat64; -import org.teavm.wasm.model.expression.WasmStoreInt32; -import org.teavm.wasm.model.expression.WasmStoreInt64; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmConversion; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmInt32Subtype; +import org.teavm.backend.wasm.model.expression.WasmInt64Subtype; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat32; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat64; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.model.expression.WasmLoadInt64; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat32; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat64; +import org.teavm.backend.wasm.model.expression.WasmStoreInt32; +import org.teavm.backend.wasm.model.expression.WasmStoreInt64; public class WasmAddressIntrinsic implements WasmIntrinsic { @Override diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsic.java similarity index 89% rename from core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsic.java index 306c24e15..565450c38 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsic.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.MethodReference; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public interface WasmIntrinsic { boolean isApplicable(MethodReference methodReference); diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsicManager.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsicManager.java similarity index 78% rename from core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsicManager.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsicManager.java index b14fabefa..469cb5a50 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/WasmIntrinsicManager.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmIntrinsicManager.java @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.Expr; -import org.teavm.wasm.generate.WasmClassGenerator; -import org.teavm.wasm.generate.WasmGenerationContext; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public interface WasmIntrinsicManager { WasmExpression generate(Expr expr); diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/WasmRuntimeIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmRuntimeIntrinsic.java similarity index 79% rename from core/src/main/java/org/teavm/wasm/intrinsics/WasmRuntimeIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmRuntimeIntrinsic.java index 0f5aac4fd..66868d888 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/WasmRuntimeIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmRuntimeIntrinsic.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.InvocationExpr; import org.teavm.model.MethodReference; -import org.teavm.wasm.WasmRuntime; -import org.teavm.wasm.generate.WasmGeneratorUtil; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmFloatBinary; -import org.teavm.wasm.model.expression.WasmFloatBinaryOperation; -import org.teavm.wasm.model.expression.WasmFloatType; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.WasmRuntime; +import org.teavm.backend.wasm.generate.WasmGeneratorUtil; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmFloatBinary; +import org.teavm.backend.wasm.model.expression.WasmFloatBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmFloatType; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; public class WasmRuntimeIntrinsic implements WasmIntrinsic { @Override diff --git a/core/src/main/java/org/teavm/wasm/intrinsics/WasmStructureIntrinsic.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmStructureIntrinsic.java similarity index 89% rename from core/src/main/java/org/teavm/wasm/intrinsics/WasmStructureIntrinsic.java rename to core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmStructureIntrinsic.java index 527dc3224..a9b028c4c 100644 --- a/core/src/main/java/org/teavm/wasm/intrinsics/WasmStructureIntrinsic.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/WasmStructureIntrinsic.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.intrinsics; +package org.teavm.backend.wasm.intrinsics; import org.teavm.ast.ConstantExpr; import org.teavm.ast.InvocationExpr; import org.teavm.interop.Address; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; -import org.teavm.wasm.generate.WasmClassGenerator; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.generate.WasmClassGenerator; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; public class WasmStructureIntrinsic implements WasmIntrinsic { private WasmClassGenerator classGenerator; diff --git a/core/src/main/java/org/teavm/wasm/model/WasmFunction.java b/core/src/main/java/org/teavm/backend/wasm/model/WasmFunction.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/WasmFunction.java rename to core/src/main/java/org/teavm/backend/wasm/model/WasmFunction.java index f8cbf43b8..9900c581d 100644 --- a/core/src/main/java/org/teavm/wasm/model/WasmFunction.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/WasmFunction.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model; +package org.teavm.backend.wasm.model; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class WasmFunction { WasmModule module; diff --git a/core/src/main/java/org/teavm/wasm/model/WasmLocal.java b/core/src/main/java/org/teavm/backend/wasm/model/WasmLocal.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/WasmLocal.java rename to core/src/main/java/org/teavm/backend/wasm/model/WasmLocal.java index 2462eb481..189e6eabd 100644 --- a/core/src/main/java/org/teavm/wasm/model/WasmLocal.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/WasmLocal.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model; +package org.teavm.backend.wasm.model; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/WasmMemorySegment.java b/core/src/main/java/org/teavm/backend/wasm/model/WasmMemorySegment.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/WasmMemorySegment.java rename to core/src/main/java/org/teavm/backend/wasm/model/WasmMemorySegment.java index e49f3041b..f3eb6161c 100644 --- a/core/src/main/java/org/teavm/wasm/model/WasmMemorySegment.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/WasmMemorySegment.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model; +package org.teavm.backend.wasm.model; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/wasm/model/WasmModule.java b/core/src/main/java/org/teavm/backend/wasm/model/WasmModule.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/model/WasmModule.java rename to core/src/main/java/org/teavm/backend/wasm/model/WasmModule.java index 5fb9629e7..e9de2dbe6 100644 --- a/core/src/main/java/org/teavm/wasm/model/WasmModule.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/WasmModule.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model; +package org.teavm.backend.wasm.model; import java.util.ArrayList; import java.util.Collections; diff --git a/core/src/main/java/org/teavm/wasm/model/WasmType.java b/core/src/main/java/org/teavm/backend/wasm/model/WasmType.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/model/WasmType.java rename to core/src/main/java/org/teavm/backend/wasm/model/WasmType.java index 8902cd721..ce90180fd 100644 --- a/core/src/main/java/org/teavm/wasm/model/WasmType.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/WasmType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model; +package org.teavm.backend.wasm.model; public enum WasmType { INT32, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmBlock.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBlock.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmBlock.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBlock.java index 477b497b1..8f039f5a7 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmBlock.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBlock.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmBranch.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBranch.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmBranch.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBranch.java index 222747e8f..268176bf1 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmBranch.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBranch.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmBreak.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBreak.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmBreak.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBreak.java index 881328814..57e954bf1 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmBreak.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmBreak.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmCall.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmCall.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmCall.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmCall.java index 0836ece8e..c5d6be891 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmCall.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmCall.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmConditional.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConditional.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmConditional.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConditional.java index 4a436bdac..2f0d35586 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmConditional.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConditional.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmConversion.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConversion.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmConversion.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConversion.java index 37afeea24..df2a0a169 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmConversion.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmConversion.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; -import org.teavm.wasm.model.WasmType; +import org.teavm.backend.wasm.model.WasmType; public class WasmConversion extends WasmExpression { private WasmType sourceType; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmDefaultExpressionVisitor.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDefaultExpressionVisitor.java similarity index 99% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmDefaultExpressionVisitor.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDefaultExpressionVisitor.java index 9fcac845f..c48fc3154 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmDefaultExpressionVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDefaultExpressionVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmDefaultExpressionVisitor implements WasmExpressionVisitor { @Override diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmDrop.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDrop.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmDrop.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDrop.java index 935acdf93..fe15a9fa2 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmDrop.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmDrop.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmExpression.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpression.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmExpression.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpression.java index 3b8c893f3..97cb0b3f2 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmExpression.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpression.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import org.teavm.model.TextLocation; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmExpressionVisitor.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpressionVisitor.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmExpressionVisitor.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpressionVisitor.java index 10fb97cc3..309a7fece 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmExpressionVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmExpressionVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public interface WasmExpressionVisitor { void visit(WasmBlock expression); diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloat32Constant.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat32Constant.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloat32Constant.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat32Constant.java index e5d19b923..28a242ec3 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloat32Constant.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat32Constant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmFloat32Constant extends WasmExpression { private float value; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloat64Constant.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat64Constant.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloat64Constant.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat64Constant.java index 9601dc00d..b07544d58 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloat64Constant.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloat64Constant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmFloat64Constant extends WasmExpression { private double value; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinary.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinary.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinary.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinary.java index b389982ff..c1ef9d849 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinary.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinary.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinaryOperation.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinaryOperation.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinaryOperation.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinaryOperation.java index ed82a5b3b..fedf45113 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatBinaryOperation.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatBinaryOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmFloatBinaryOperation { ADD, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatType.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatType.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloatType.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatType.java index 3638acd17..f0263c6ec 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatType.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmFloatType { FLOAT32, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnary.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnary.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnary.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnary.java index 40e2f9e48..27defe01b 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnary.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnary.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnaryOperation.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnaryOperation.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnaryOperation.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnaryOperation.java index 42c455b0c..96bcd00f4 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmFloatUnaryOperation.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmFloatUnaryOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmFloatUnaryOperation { ABS, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmGetLocal.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmGetLocal.java similarity index 92% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmGetLocal.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmGetLocal.java index f7bf64e0a..e9aaae942 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmGetLocal.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmGetLocal.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; -import org.teavm.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmLocal; public class WasmGetLocal extends WasmExpression { private WasmLocal local; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIndirectCall.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIndirectCall.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIndirectCall.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIndirectCall.java index 0bd881d7d..83eea147c 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIndirectCall.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIndirectCall.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import org.teavm.wasm.model.WasmType; +import org.teavm.backend.wasm.model.WasmType; public class WasmIndirectCall extends WasmExpression { private List parameterTypes = new ArrayList<>(); diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Constant.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Constant.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Constant.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Constant.java index 821053f0f..11154f054 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Constant.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Constant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmInt32Constant extends WasmExpression { private int value; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Subtype.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Subtype.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Subtype.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Subtype.java index 3954fcc93..08cc47db8 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt32Subtype.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt32Subtype.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmInt32Subtype { INT8, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Constant.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Constant.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Constant.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Constant.java index 1b8ee6e46..ce5c7c103 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Constant.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Constant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmInt64Constant extends WasmExpression { private long value; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Subtype.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Subtype.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Subtype.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Subtype.java index ae42cf265..4df457c71 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmInt64Subtype.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmInt64Subtype.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmInt64Subtype { INT8, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinary.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinary.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinary.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinary.java index fcdad965d..a3b9f7248 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinary.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinary.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinaryOperation.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinaryOperation.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinaryOperation.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinaryOperation.java index 340bd9fda..fa17bc79a 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntBinaryOperation.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntBinaryOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmIntBinaryOperation { ADD, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntType.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntType.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIntType.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntType.java index b36f6a475..c43e71447 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntType.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmIntType { INT32, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnary.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnary.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnary.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnary.java index d12a647f5..df0107b35 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnary.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnary.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnaryOperation.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnaryOperation.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnaryOperation.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnaryOperation.java index 77a7d0666..aa5afce61 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmIntUnaryOperation.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmIntUnaryOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public enum WasmIntUnaryOperation { CLZ, diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat32.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat32.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat32.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat32.java index b717be4cd..a845ffd5b 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat32.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat32.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat64.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat64.java similarity index 96% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat64.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat64.java index 466e65381..c594ca36c 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadFloat64.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadFloat64.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt32.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt32.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt32.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt32.java index ac6e8338f..ad470429a 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt32.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt32.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt64.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt64.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt64.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt64.java index 1933c4a24..ba1315c39 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmLoadInt64.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmLoadInt64.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmReturn.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmReturn.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmReturn.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmReturn.java index 7242863ec..97c468328 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmReturn.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmReturn.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmReturn extends WasmExpression { private WasmExpression value; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmSetLocal.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSetLocal.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmSetLocal.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSetLocal.java index b295adc65..8b14c983d 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmSetLocal.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSetLocal.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; -import org.teavm.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmLocal; public class WasmSetLocal extends WasmExpression { private WasmLocal local; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat32.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat32.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat32.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat32.java index f99151ca1..fb743f48c 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat32.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat32.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat64.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat64.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat64.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat64.java index 867ce13fa..812ee9177 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreFloat64.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreFloat64.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt32.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt32.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt32.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt32.java index bdb5f4331..edd6d750f 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt32.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt32.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt64.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt64.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt64.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt64.java index 5e53e43f1..f05c2a6da 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmStoreInt64.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmStoreInt64.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.Objects; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmSwitch.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSwitch.java similarity index 97% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmSwitch.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSwitch.java index 157c61697..fc91aa605 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmSwitch.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmSwitch.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/org/teavm/wasm/model/expression/WasmUnreachable.java b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmUnreachable.java similarity index 94% rename from core/src/main/java/org/teavm/wasm/model/expression/WasmUnreachable.java rename to core/src/main/java/org/teavm/backend/wasm/model/expression/WasmUnreachable.java index ca760cfef..ac697ba3c 100644 --- a/core/src/main/java/org/teavm/wasm/model/expression/WasmUnreachable.java +++ b/core/src/main/java/org/teavm/backend/wasm/model/expression/WasmUnreachable.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.model.expression; +package org.teavm.backend.wasm.model.expression; public class WasmUnreachable extends WasmExpression { public WasmUnreachable() { diff --git a/core/src/main/java/org/teavm/wasm/patches/ClassPatch.java b/core/src/main/java/org/teavm/backend/wasm/patches/ClassPatch.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/patches/ClassPatch.java rename to core/src/main/java/org/teavm/backend/wasm/patches/ClassPatch.java index 16b979a63..92dfd6595 100644 --- a/core/src/main/java/org/teavm/wasm/patches/ClassPatch.java +++ b/core/src/main/java/org/teavm/backend/wasm/patches/ClassPatch.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.patches; +package org.teavm.backend.wasm.patches; import org.teavm.diagnostics.Diagnostics; import org.teavm.model.BasicBlock; diff --git a/core/src/main/java/org/teavm/wasm/patches/ObjectPatch.java b/core/src/main/java/org/teavm/backend/wasm/patches/ObjectPatch.java similarity index 98% rename from core/src/main/java/org/teavm/wasm/patches/ObjectPatch.java rename to core/src/main/java/org/teavm/backend/wasm/patches/ObjectPatch.java index 517409d43..89e7ef459 100644 --- a/core/src/main/java/org/teavm/wasm/patches/ObjectPatch.java +++ b/core/src/main/java/org/teavm/backend/wasm/patches/ObjectPatch.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.patches; +package org.teavm.backend.wasm.patches; import org.teavm.diagnostics.Diagnostics; import org.teavm.interop.Address; diff --git a/core/src/main/java/org/teavm/wasm/render/WasmRenderer.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmRenderer.java similarity index 95% rename from core/src/main/java/org/teavm/wasm/render/WasmRenderer.java rename to core/src/main/java/org/teavm/backend/wasm/render/WasmRenderer.java index d58150a14..926bf674e 100644 --- a/core/src/main/java/org/teavm/wasm/render/WasmRenderer.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmRenderer.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.render; +package org.teavm.backend.wasm.render; import java.util.List; -import org.teavm.wasm.model.WasmFunction; -import org.teavm.wasm.model.WasmLocal; -import org.teavm.wasm.model.WasmMemorySegment; -import org.teavm.wasm.model.WasmModule; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.WasmFunction; +import org.teavm.backend.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmMemorySegment; +import org.teavm.backend.wasm.model.WasmModule; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmExpression; public class WasmRenderer { private WasmRenderingVisitor visitor = new WasmRenderingVisitor(); diff --git a/core/src/main/java/org/teavm/wasm/render/WasmRenderingVisitor.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmRenderingVisitor.java similarity index 88% rename from core/src/main/java/org/teavm/wasm/render/WasmRenderingVisitor.java rename to core/src/main/java/org/teavm/backend/wasm/render/WasmRenderingVisitor.java index 635a42f9b..c27d250aa 100644 --- a/core/src/main/java/org/teavm/wasm/render/WasmRenderingVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmRenderingVisitor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.render; +package org.teavm.backend.wasm.render; import java.util.ArrayList; import java.util.HashMap; @@ -21,45 +21,45 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.teavm.wasm.model.WasmLocal; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmBlock; -import org.teavm.wasm.model.expression.WasmBranch; -import org.teavm.wasm.model.expression.WasmBreak; -import org.teavm.wasm.model.expression.WasmCall; -import org.teavm.wasm.model.expression.WasmConditional; -import org.teavm.wasm.model.expression.WasmConversion; -import org.teavm.wasm.model.expression.WasmDrop; -import org.teavm.wasm.model.expression.WasmExpression; -import org.teavm.wasm.model.expression.WasmExpressionVisitor; -import org.teavm.wasm.model.expression.WasmFloat32Constant; -import org.teavm.wasm.model.expression.WasmFloat64Constant; -import org.teavm.wasm.model.expression.WasmFloatBinary; -import org.teavm.wasm.model.expression.WasmFloatBinaryOperation; -import org.teavm.wasm.model.expression.WasmFloatType; -import org.teavm.wasm.model.expression.WasmFloatUnary; -import org.teavm.wasm.model.expression.WasmFloatUnaryOperation; -import org.teavm.wasm.model.expression.WasmGetLocal; -import org.teavm.wasm.model.expression.WasmIndirectCall; -import org.teavm.wasm.model.expression.WasmInt32Constant; -import org.teavm.wasm.model.expression.WasmInt64Constant; -import org.teavm.wasm.model.expression.WasmIntBinary; -import org.teavm.wasm.model.expression.WasmIntBinaryOperation; -import org.teavm.wasm.model.expression.WasmIntType; -import org.teavm.wasm.model.expression.WasmIntUnary; -import org.teavm.wasm.model.expression.WasmIntUnaryOperation; -import org.teavm.wasm.model.expression.WasmLoadFloat32; -import org.teavm.wasm.model.expression.WasmLoadFloat64; -import org.teavm.wasm.model.expression.WasmLoadInt32; -import org.teavm.wasm.model.expression.WasmLoadInt64; -import org.teavm.wasm.model.expression.WasmReturn; -import org.teavm.wasm.model.expression.WasmSetLocal; -import org.teavm.wasm.model.expression.WasmStoreFloat32; -import org.teavm.wasm.model.expression.WasmStoreFloat64; -import org.teavm.wasm.model.expression.WasmStoreInt32; -import org.teavm.wasm.model.expression.WasmStoreInt64; -import org.teavm.wasm.model.expression.WasmSwitch; -import org.teavm.wasm.model.expression.WasmUnreachable; +import org.teavm.backend.wasm.model.WasmLocal; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmBlock; +import org.teavm.backend.wasm.model.expression.WasmBranch; +import org.teavm.backend.wasm.model.expression.WasmBreak; +import org.teavm.backend.wasm.model.expression.WasmCall; +import org.teavm.backend.wasm.model.expression.WasmConditional; +import org.teavm.backend.wasm.model.expression.WasmConversion; +import org.teavm.backend.wasm.model.expression.WasmDrop; +import org.teavm.backend.wasm.model.expression.WasmExpression; +import org.teavm.backend.wasm.model.expression.WasmExpressionVisitor; +import org.teavm.backend.wasm.model.expression.WasmFloat32Constant; +import org.teavm.backend.wasm.model.expression.WasmFloat64Constant; +import org.teavm.backend.wasm.model.expression.WasmFloatBinary; +import org.teavm.backend.wasm.model.expression.WasmFloatBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmFloatType; +import org.teavm.backend.wasm.model.expression.WasmFloatUnary; +import org.teavm.backend.wasm.model.expression.WasmFloatUnaryOperation; +import org.teavm.backend.wasm.model.expression.WasmGetLocal; +import org.teavm.backend.wasm.model.expression.WasmIndirectCall; +import org.teavm.backend.wasm.model.expression.WasmInt32Constant; +import org.teavm.backend.wasm.model.expression.WasmInt64Constant; +import org.teavm.backend.wasm.model.expression.WasmIntBinary; +import org.teavm.backend.wasm.model.expression.WasmIntBinaryOperation; +import org.teavm.backend.wasm.model.expression.WasmIntType; +import org.teavm.backend.wasm.model.expression.WasmIntUnary; +import org.teavm.backend.wasm.model.expression.WasmIntUnaryOperation; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat32; +import org.teavm.backend.wasm.model.expression.WasmLoadFloat64; +import org.teavm.backend.wasm.model.expression.WasmLoadInt32; +import org.teavm.backend.wasm.model.expression.WasmLoadInt64; +import org.teavm.backend.wasm.model.expression.WasmReturn; +import org.teavm.backend.wasm.model.expression.WasmSetLocal; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat32; +import org.teavm.backend.wasm.model.expression.WasmStoreFloat64; +import org.teavm.backend.wasm.model.expression.WasmStoreInt32; +import org.teavm.backend.wasm.model.expression.WasmStoreInt64; +import org.teavm.backend.wasm.model.expression.WasmSwitch; +import org.teavm.backend.wasm.model.expression.WasmUnreachable; class WasmRenderingVisitor implements WasmExpressionVisitor { private Set usedIdentifiers = new HashSet<>(); diff --git a/core/src/main/java/org/teavm/wasm/render/WasmSignature.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmSignature.java similarity index 93% rename from core/src/main/java/org/teavm/wasm/render/WasmSignature.java rename to core/src/main/java/org/teavm/backend/wasm/render/WasmSignature.java index 2a9d22a60..637615ab9 100644 --- a/core/src/main/java/org/teavm/wasm/render/WasmSignature.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmSignature.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.render; +package org.teavm.backend.wasm.render; import java.util.Arrays; -import org.teavm.wasm.model.WasmType; +import org.teavm.backend.wasm.model.WasmType; class WasmSignature { WasmType[] types; diff --git a/core/src/main/java/org/teavm/wasm/render/WasmSignatureCollector.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmSignatureCollector.java similarity index 84% rename from core/src/main/java/org/teavm/wasm/render/WasmSignatureCollector.java rename to core/src/main/java/org/teavm/backend/wasm/render/WasmSignatureCollector.java index 17d12df7a..cc3c6212d 100644 --- a/core/src/main/java/org/teavm/wasm/render/WasmSignatureCollector.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmSignatureCollector.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.wasm.render; +package org.teavm.backend.wasm.render; -import org.teavm.wasm.model.WasmType; -import org.teavm.wasm.model.expression.WasmDefaultExpressionVisitor; -import org.teavm.wasm.model.expression.WasmIndirectCall; +import org.teavm.backend.wasm.model.WasmType; +import org.teavm.backend.wasm.model.expression.WasmDefaultExpressionVisitor; +import org.teavm.backend.wasm.model.expression.WasmIndirectCall; class WasmSignatureCollector extends WasmDefaultExpressionVisitor { WasmRenderingVisitor renderingVisitor; diff --git a/core/src/main/java/org/teavm/debugging/information/DebugInformationBuilder.java b/core/src/main/java/org/teavm/debugging/information/DebugInformationBuilder.java index 23c5ceda4..847f0bc0e 100644 --- a/core/src/main/java/org/teavm/debugging/information/DebugInformationBuilder.java +++ b/core/src/main/java/org/teavm/debugging/information/DebugInformationBuilder.java @@ -16,7 +16,7 @@ package org.teavm.debugging.information; import java.util.*; -import org.teavm.codegen.LocationProvider; +import org.teavm.backend.javascript.codegen.LocationProvider; import org.teavm.common.RecordArray; import org.teavm.common.RecordArrayBuilder; import org.teavm.model.MethodDescriptor; @@ -152,7 +152,7 @@ public class DebugInformationBuilder implements DebugInformationEmitter { @Override public DeferredCallSite emitCallSite() { final RecordArrayBuilder.Record record = add(callSiteMapping, DebuggerCallSite.NONE); - DeferredCallSite callSite = new DeferredCallSite() { + return new DeferredCallSite() { @Override public void setVirtualMethod(MethodReference method) { record.set(2, DebuggerCallSite.VIRTUAL); @@ -181,7 +181,6 @@ public class DebugInformationBuilder implements DebugInformationEmitter { return exactMethodIndex; } }; - return callSite; } @Override diff --git a/core/src/main/java/org/teavm/debugging/information/DebugInformationEmitter.java b/core/src/main/java/org/teavm/debugging/information/DebugInformationEmitter.java index 132fcea1c..0a66addc0 100644 --- a/core/src/main/java/org/teavm/debugging/information/DebugInformationEmitter.java +++ b/core/src/main/java/org/teavm/debugging/information/DebugInformationEmitter.java @@ -15,7 +15,7 @@ */ package org.teavm.debugging.information; -import org.teavm.codegen.LocationProvider; +import org.teavm.backend.javascript.codegen.LocationProvider; import org.teavm.model.MethodDescriptor; public interface DebugInformationEmitter { diff --git a/core/src/main/java/org/teavm/debugging/information/DummyDebugInformationEmitter.java b/core/src/main/java/org/teavm/debugging/information/DummyDebugInformationEmitter.java index c06f955b2..256fa0779 100644 --- a/core/src/main/java/org/teavm/debugging/information/DummyDebugInformationEmitter.java +++ b/core/src/main/java/org/teavm/debugging/information/DummyDebugInformationEmitter.java @@ -15,7 +15,7 @@ */ package org.teavm.debugging.information; -import org.teavm.codegen.LocationProvider; +import org.teavm.backend.javascript.codegen.LocationProvider; import org.teavm.model.MethodDescriptor; import org.teavm.model.MethodReference; diff --git a/core/src/main/java/org/teavm/dependency/DependencyChecker.java b/core/src/main/java/org/teavm/dependency/DependencyChecker.java index f8f68a223..7bbe4e27c 100644 --- a/core/src/main/java/org/teavm/dependency/DependencyChecker.java +++ b/core/src/main/java/org/teavm/dependency/DependencyChecker.java @@ -52,7 +52,7 @@ import org.teavm.model.ReferenceCache; import org.teavm.model.ValueType; import org.teavm.model.util.ModelUtils; import org.teavm.model.util.ProgramUtils; -import org.teavm.optimization.UnreachableBasicBlockEliminator; +import org.teavm.model.optimization.UnreachableBasicBlockEliminator; import org.teavm.parsing.Parser; public class DependencyChecker implements DependencyInfo { diff --git a/core/src/main/java/org/teavm/dependency/DependencyClassSource.java b/core/src/main/java/org/teavm/dependency/DependencyClassSource.java index 0bdcbb574..2c840024b 100644 --- a/core/src/main/java/org/teavm/dependency/DependencyClassSource.java +++ b/core/src/main/java/org/teavm/dependency/DependencyClassSource.java @@ -28,7 +28,7 @@ import org.teavm.model.ClassReader; import org.teavm.model.ClassReaderSource; import org.teavm.model.MethodHolder; import org.teavm.model.util.ModelUtils; -import org.teavm.optimization.UnreachableBasicBlockEliminator; +import org.teavm.model.optimization.UnreachableBasicBlockEliminator; class DependencyClassSource implements ClassHolderSource { private ClassReaderSource innerSource; diff --git a/core/src/main/java/org/teavm/javascript/AsyncInvocationType.java b/core/src/main/java/org/teavm/javascript/AsyncInvocationType.java deleted file mode 100644 index 058d5804d..000000000 --- a/core/src/main/java/org/teavm/javascript/AsyncInvocationType.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.teavm.javascript; - -public enum AsyncInvocationType { - COMPLETE, - ERROR -} diff --git a/core/src/main/java/org/teavm/model/CopyClassHolderSource.java b/core/src/main/java/org/teavm/model/CopyClassHolderSource.java index c6421f25f..461e24758 100644 --- a/core/src/main/java/org/teavm/model/CopyClassHolderSource.java +++ b/core/src/main/java/org/teavm/model/CopyClassHolderSource.java @@ -16,7 +16,7 @@ package org.teavm.model; import org.teavm.model.util.ModelUtils; -import org.teavm.resource.MapperClassHolderSource; +import org.teavm.parsing.resource.MapperClassHolderSource; public class CopyClassHolderSource implements ClassHolderSource { private ClassReaderSource innerSource; diff --git a/core/src/main/java/org/teavm/model/PreOptimizingClassHolderSource.java b/core/src/main/java/org/teavm/model/PreOptimizingClassHolderSource.java index 1e200542b..51ccf505a 100644 --- a/core/src/main/java/org/teavm/model/PreOptimizingClassHolderSource.java +++ b/core/src/main/java/org/teavm/model/PreOptimizingClassHolderSource.java @@ -17,8 +17,8 @@ package org.teavm.model; import java.util.LinkedHashMap; import java.util.Map; -import org.teavm.optimization.GlobalValueNumbering; -import org.teavm.optimization.UnusedVariableElimination; +import org.teavm.model.optimization.GlobalValueNumbering; +import org.teavm.model.optimization.UnusedVariableElimination; public class PreOptimizingClassHolderSource implements ClassHolderSource { private ClassHolderSource innerClassSource; diff --git a/core/src/main/java/org/teavm/optimization/ArrayUnwrapMotion.java b/core/src/main/java/org/teavm/model/optimization/ArrayUnwrapMotion.java similarity index 97% rename from core/src/main/java/org/teavm/optimization/ArrayUnwrapMotion.java rename to core/src/main/java/org/teavm/model/optimization/ArrayUnwrapMotion.java index ab21cd421..974c32fc5 100644 --- a/core/src/main/java/org/teavm/optimization/ArrayUnwrapMotion.java +++ b/core/src/main/java/org/teavm/model/optimization/ArrayUnwrapMotion.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/org/teavm/optimization/ClassInitElimination.java b/core/src/main/java/org/teavm/model/optimization/ClassInitElimination.java similarity index 98% rename from core/src/main/java/org/teavm/optimization/ClassInitElimination.java rename to core/src/main/java/org/teavm/model/optimization/ClassInitElimination.java index d0159aff3..5ac8c0bbc 100644 --- a/core/src/main/java/org/teavm/optimization/ClassInitElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/ClassInitElimination.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.ArrayDeque; import java.util.Deque; diff --git a/core/src/main/java/org/teavm/optimization/ConstantConditionElimination.java b/core/src/main/java/org/teavm/model/optimization/ConstantConditionElimination.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/ConstantConditionElimination.java rename to core/src/main/java/org/teavm/model/optimization/ConstantConditionElimination.java index b1a283d27..3aaa7c9f6 100644 --- a/core/src/main/java/org/teavm/optimization/ConstantConditionElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/ConstantConditionElimination.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.BasicBlock; import org.teavm.model.Instruction; diff --git a/core/src/main/java/org/teavm/optimization/Devirtualization.java b/core/src/main/java/org/teavm/model/optimization/Devirtualization.java similarity index 97% rename from core/src/main/java/org/teavm/optimization/Devirtualization.java rename to core/src/main/java/org/teavm/model/optimization/Devirtualization.java index 82422325c..d9fcc971a 100644 --- a/core/src/main/java/org/teavm/optimization/Devirtualization.java +++ b/core/src/main/java/org/teavm/model/optimization/Devirtualization.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.HashSet; import java.util.Set; diff --git a/core/src/main/java/org/teavm/optimization/EmptyBlockElimination.java b/core/src/main/java/org/teavm/model/optimization/EmptyBlockElimination.java similarity index 96% rename from core/src/main/java/org/teavm/optimization/EmptyBlockElimination.java rename to core/src/main/java/org/teavm/model/optimization/EmptyBlockElimination.java index 77355c90b..81901005d 100644 --- a/core/src/main/java/org/teavm/optimization/EmptyBlockElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/EmptyBlockElimination.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.BasicBlock; import org.teavm.model.MethodReader; diff --git a/core/src/main/java/org/teavm/optimization/GlobalValueNumbering.java b/core/src/main/java/org/teavm/model/optimization/GlobalValueNumbering.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/GlobalValueNumbering.java rename to core/src/main/java/org/teavm/model/optimization/GlobalValueNumbering.java index d555e54be..1e7363718 100644 --- a/core/src/main/java/org/teavm/optimization/GlobalValueNumbering.java +++ b/core/src/main/java/org/teavm/model/optimization/GlobalValueNumbering.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.*; import java.util.function.UnaryOperator; diff --git a/core/src/main/java/org/teavm/optimization/Inlining.java b/core/src/main/java/org/teavm/model/optimization/Inlining.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/Inlining.java rename to core/src/main/java/org/teavm/model/optimization/Inlining.java index 9757fb238..8a8bf56bd 100644 --- a/core/src/main/java/org/teavm/optimization/Inlining.java +++ b/core/src/main/java/org/teavm/model/optimization/Inlining.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/optimization/LoopInvariantAnalyzer.java b/core/src/main/java/org/teavm/model/optimization/LoopInvariantAnalyzer.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/LoopInvariantAnalyzer.java rename to core/src/main/java/org/teavm/model/optimization/LoopInvariantAnalyzer.java index 899eae69a..4fd6846fc 100644 --- a/core/src/main/java/org/teavm/optimization/LoopInvariantAnalyzer.java +++ b/core/src/main/java/org/teavm/model/optimization/LoopInvariantAnalyzer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.InvokeDynamicInstruction; import org.teavm.model.instructions.ArrayLengthInstruction; diff --git a/core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java b/core/src/main/java/org/teavm/model/optimization/LoopInvariantMotion.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java rename to core/src/main/java/org/teavm/model/optimization/LoopInvariantMotion.java index 23a4e6daf..4aa22b8ad 100644 --- a/core/src/main/java/org/teavm/optimization/LoopInvariantMotion.java +++ b/core/src/main/java/org/teavm/model/optimization/LoopInvariantMotion.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/optimization/LoopInversion.java b/core/src/main/java/org/teavm/model/optimization/LoopInversion.java similarity index 96% rename from core/src/main/java/org/teavm/optimization/LoopInversion.java rename to core/src/main/java/org/teavm/model/optimization/LoopInversion.java index 5b9d93fd1..257030687 100644 --- a/core/src/main/java/org/teavm/optimization/LoopInversion.java +++ b/core/src/main/java/org/teavm/model/optimization/LoopInversion.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.MethodReader; import org.teavm.model.Program; diff --git a/core/src/main/java/org/teavm/optimization/LoopInversionImpl.java b/core/src/main/java/org/teavm/model/optimization/LoopInversionImpl.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/LoopInversionImpl.java rename to core/src/main/java/org/teavm/model/optimization/LoopInversionImpl.java index 65b91d417..cbb69bcfd 100644 --- a/core/src/main/java/org/teavm/optimization/LoopInversionImpl.java +++ b/core/src/main/java/org/teavm/model/optimization/LoopInversionImpl.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import com.carrotsearch.hppc.IntIntMap; import com.carrotsearch.hppc.IntIntOpenHashMap; diff --git a/core/src/main/java/org/teavm/optimization/MethodOptimization.java b/core/src/main/java/org/teavm/model/optimization/MethodOptimization.java similarity index 91% rename from core/src/main/java/org/teavm/optimization/MethodOptimization.java rename to core/src/main/java/org/teavm/model/optimization/MethodOptimization.java index 9b8e59650..4ffffa9a9 100644 --- a/core/src/main/java/org/teavm/optimization/MethodOptimization.java +++ b/core/src/main/java/org/teavm/model/optimization/MethodOptimization.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.MethodReader; import org.teavm.model.Program; diff --git a/core/src/main/java/org/teavm/optimization/RedundantJumpElimination.java b/core/src/main/java/org/teavm/model/optimization/RedundantJumpElimination.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/RedundantJumpElimination.java rename to core/src/main/java/org/teavm/model/optimization/RedundantJumpElimination.java index a6ccda2c9..f7758e740 100644 --- a/core/src/main/java/org/teavm/optimization/RedundantJumpElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/RedundantJumpElimination.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/src/main/java/org/teavm/optimization/UnreachableBasicBlockElimination.java b/core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockElimination.java similarity index 96% rename from core/src/main/java/org/teavm/optimization/UnreachableBasicBlockElimination.java rename to core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockElimination.java index 960f05a70..6df87b910 100644 --- a/core/src/main/java/org/teavm/optimization/UnreachableBasicBlockElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockElimination.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.MethodReader; import org.teavm.model.Program; diff --git a/core/src/main/java/org/teavm/optimization/UnreachableBasicBlockEliminator.java b/core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockEliminator.java similarity index 97% rename from core/src/main/java/org/teavm/optimization/UnreachableBasicBlockEliminator.java rename to core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockEliminator.java index d0930fafb..5eab5e13b 100644 --- a/core/src/main/java/org/teavm/optimization/UnreachableBasicBlockEliminator.java +++ b/core/src/main/java/org/teavm/model/optimization/UnreachableBasicBlockEliminator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.common.IntegerStack; import org.teavm.model.BasicBlock; diff --git a/core/src/main/java/org/teavm/optimization/UnusedVariableElimination.java b/core/src/main/java/org/teavm/model/optimization/UnusedVariableElimination.java similarity index 99% rename from core/src/main/java/org/teavm/optimization/UnusedVariableElimination.java rename to core/src/main/java/org/teavm/model/optimization/UnusedVariableElimination.java index 56f60a72a..4a23d50b0 100644 --- a/core/src/main/java/org/teavm/optimization/UnusedVariableElimination.java +++ b/core/src/main/java/org/teavm/model/optimization/UnusedVariableElimination.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.common.Graph; import org.teavm.model.*; diff --git a/core/src/main/java/org/teavm/optimization/VariableEscapeAnalyzer.java b/core/src/main/java/org/teavm/model/optimization/VariableEscapeAnalyzer.java similarity index 98% rename from core/src/main/java/org/teavm/optimization/VariableEscapeAnalyzer.java rename to core/src/main/java/org/teavm/model/optimization/VariableEscapeAnalyzer.java index ae8b048b5..6c8762045 100644 --- a/core/src/main/java/org/teavm/optimization/VariableEscapeAnalyzer.java +++ b/core/src/main/java/org/teavm/model/optimization/VariableEscapeAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.model.*; import org.teavm.model.instructions.*; diff --git a/core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java b/core/src/main/java/org/teavm/model/optimization/VariableUsageGraphBuilder.java similarity index 98% rename from core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java rename to core/src/main/java/org/teavm/model/optimization/VariableUsageGraphBuilder.java index 702cdc332..7752773f1 100644 --- a/core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java +++ b/core/src/main/java/org/teavm/model/optimization/VariableUsageGraphBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.optimization; +package org.teavm.model.optimization; import org.teavm.common.Graph; import org.teavm.common.GraphBuilder; diff --git a/core/src/main/java/org/teavm/model/util/AsyncMethodFinder.java b/core/src/main/java/org/teavm/model/util/AsyncMethodFinder.java index 38065da05..7588d9675 100644 --- a/core/src/main/java/org/teavm/model/util/AsyncMethodFinder.java +++ b/core/src/main/java/org/teavm/model/util/AsyncMethodFinder.java @@ -21,7 +21,7 @@ import org.teavm.callgraph.CallGraphNode; import org.teavm.callgraph.CallSite; import org.teavm.diagnostics.Diagnostics; import org.teavm.interop.Async; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.interop.Sync; import org.teavm.model.*; import org.teavm.model.instructions.*; diff --git a/core/src/main/java/org/teavm/model/util/MissingItemsProcessor.java b/core/src/main/java/org/teavm/model/util/MissingItemsProcessor.java index 252bc2ff3..71db2aea7 100644 --- a/core/src/main/java/org/teavm/model/util/MissingItemsProcessor.java +++ b/core/src/main/java/org/teavm/model/util/MissingItemsProcessor.java @@ -22,7 +22,7 @@ import org.teavm.dependency.DependencyInfo; import org.teavm.diagnostics.Diagnostics; import org.teavm.model.*; import org.teavm.model.instructions.*; -import org.teavm.optimization.UnreachableBasicBlockEliminator; +import org.teavm.model.optimization.UnreachableBasicBlockEliminator; /** * diff --git a/core/src/main/java/org/teavm/parsing/ClasspathClassHolderSource.java b/core/src/main/java/org/teavm/parsing/ClasspathClassHolderSource.java index e9826dbb8..b167fdb91 100644 --- a/core/src/main/java/org/teavm/parsing/ClasspathClassHolderSource.java +++ b/core/src/main/java/org/teavm/parsing/ClasspathClassHolderSource.java @@ -18,9 +18,9 @@ package org.teavm.parsing; import java.util.Date; import org.teavm.model.ClassHolder; import org.teavm.model.ClassHolderSource; -import org.teavm.resource.ClasspathResourceReader; -import org.teavm.resource.MapperClassHolderSource; -import org.teavm.resource.ResourceClassHolderMapper; +import org.teavm.parsing.resource.ClasspathResourceReader; +import org.teavm.parsing.resource.MapperClassHolderSource; +import org.teavm.parsing.resource.ResourceClassHolderMapper; public class ClasspathClassHolderSource implements ClassHolderSource, ClassDateProvider { private MapperClassHolderSource innerClassSource; diff --git a/core/src/main/java/org/teavm/parsing/Parser.java b/core/src/main/java/org/teavm/parsing/Parser.java index 434666e54..dfa8c0ec3 100644 --- a/core/src/main/java/org/teavm/parsing/Parser.java +++ b/core/src/main/java/org/teavm/parsing/Parser.java @@ -33,7 +33,7 @@ import org.teavm.model.*; import org.teavm.model.util.DefinitionExtractor; import org.teavm.model.util.PhiUpdater; import org.teavm.model.util.ProgramUtils; -import org.teavm.optimization.UnreachableBasicBlockEliminator; +import org.teavm.model.optimization.UnreachableBasicBlockEliminator; public class Parser { private ReferenceCache referenceCache; diff --git a/core/src/main/java/org/teavm/resource/ClasspathResourceReader.java b/core/src/main/java/org/teavm/parsing/resource/ClasspathResourceReader.java similarity index 95% rename from core/src/main/java/org/teavm/resource/ClasspathResourceReader.java rename to core/src/main/java/org/teavm/parsing/resource/ClasspathResourceReader.java index 1d13c4310..ba20ffa45 100644 --- a/core/src/main/java/org/teavm/resource/ClasspathResourceReader.java +++ b/core/src/main/java/org/teavm/parsing/resource/ClasspathResourceReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.resource; +package org.teavm.parsing.resource; import java.io.IOException; import java.io.InputStream; diff --git a/core/src/main/java/org/teavm/resource/MapperClassHolderSource.java b/core/src/main/java/org/teavm/parsing/resource/MapperClassHolderSource.java similarity index 93% rename from core/src/main/java/org/teavm/resource/MapperClassHolderSource.java rename to core/src/main/java/org/teavm/parsing/resource/MapperClassHolderSource.java index ce68d9240..d45c1d5a0 100644 --- a/core/src/main/java/org/teavm/resource/MapperClassHolderSource.java +++ b/core/src/main/java/org/teavm/parsing/resource/MapperClassHolderSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.resource; +package org.teavm.parsing.resource; import org.teavm.common.CachedMapper; import org.teavm.common.Mapper; diff --git a/core/src/main/java/org/teavm/resource/ResourceClassHolderMapper.java b/core/src/main/java/org/teavm/parsing/resource/ResourceClassHolderMapper.java similarity index 96% rename from core/src/main/java/org/teavm/resource/ResourceClassHolderMapper.java rename to core/src/main/java/org/teavm/parsing/resource/ResourceClassHolderMapper.java index b0a268fe3..ddab1814f 100644 --- a/core/src/main/java/org/teavm/resource/ResourceClassHolderMapper.java +++ b/core/src/main/java/org/teavm/parsing/resource/ResourceClassHolderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.resource; +package org.teavm.parsing.resource; import java.io.IOException; import java.io.InputStream; diff --git a/core/src/main/java/org/teavm/parsing/resource/ResourceParser.java b/core/src/main/java/org/teavm/parsing/resource/ResourceParser.java new file mode 100644 index 000000000..e69de29bb diff --git a/core/src/main/java/org/teavm/resource/ResourceReader.java b/core/src/main/java/org/teavm/parsing/resource/ResourceReader.java similarity index 91% rename from core/src/main/java/org/teavm/resource/ResourceReader.java rename to core/src/main/java/org/teavm/parsing/resource/ResourceReader.java index 1aa113eb0..2540bf854 100644 --- a/core/src/main/java/org/teavm/resource/ResourceReader.java +++ b/core/src/main/java/org/teavm/parsing/resource/ResourceReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Alexey Andreev. + * Copyright 2016 Alexey Andreev. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.teavm.resource; +package org.teavm.parsing.resource; import java.io.IOException; import java.io.InputStream; diff --git a/core/src/main/java/org/teavm/vm/TeaVM.java b/core/src/main/java/org/teavm/vm/TeaVM.java index 6a0b09500..298d60c40 100644 --- a/core/src/main/java/org/teavm/vm/TeaVM.java +++ b/core/src/main/java/org/teavm/vm/TeaVM.java @@ -39,7 +39,7 @@ import org.teavm.dependency.Linker; import org.teavm.diagnostics.AccumulationDiagnostics; import org.teavm.diagnostics.Diagnostics; import org.teavm.diagnostics.ProblemProvider; -import org.teavm.javascript.RenderingException; +import org.teavm.backend.javascript.rendering.RenderingException; import org.teavm.model.ClassHolder; import org.teavm.model.ClassHolderSource; import org.teavm.model.ClassHolderTransformer; @@ -56,18 +56,18 @@ import org.teavm.model.util.MissingItemsProcessor; import org.teavm.model.util.ModelUtils; import org.teavm.model.util.ProgramUtils; import org.teavm.model.util.RegisterAllocator; -import org.teavm.optimization.ArrayUnwrapMotion; -import org.teavm.optimization.ClassInitElimination; -import org.teavm.optimization.ConstantConditionElimination; -import org.teavm.optimization.Devirtualization; -import org.teavm.optimization.GlobalValueNumbering; -import org.teavm.optimization.Inlining; -import org.teavm.optimization.LoopInvariantMotion; -import org.teavm.optimization.LoopInversion; -import org.teavm.optimization.MethodOptimization; -import org.teavm.optimization.RedundantJumpElimination; -import org.teavm.optimization.UnreachableBasicBlockElimination; -import org.teavm.optimization.UnusedVariableElimination; +import org.teavm.model.optimization.ArrayUnwrapMotion; +import org.teavm.model.optimization.ClassInitElimination; +import org.teavm.model.optimization.ConstantConditionElimination; +import org.teavm.model.optimization.Devirtualization; +import org.teavm.model.optimization.GlobalValueNumbering; +import org.teavm.model.optimization.Inlining; +import org.teavm.model.optimization.LoopInvariantMotion; +import org.teavm.model.optimization.LoopInversion; +import org.teavm.model.optimization.MethodOptimization; +import org.teavm.model.optimization.RedundantJumpElimination; +import org.teavm.model.optimization.UnreachableBasicBlockElimination; +import org.teavm.model.optimization.UnusedVariableElimination; import org.teavm.vm.spi.TeaVMHost; import org.teavm.vm.spi.TeaVMHostExtension; import org.teavm.vm.spi.TeaVMPlugin; diff --git a/core/src/main/java/org/teavm/vm/spi/AbstractRendererListener.java b/core/src/main/java/org/teavm/vm/spi/AbstractRendererListener.java index 6e38bd9ef..16ca66a16 100644 --- a/core/src/main/java/org/teavm/vm/spi/AbstractRendererListener.java +++ b/core/src/main/java/org/teavm/vm/spi/AbstractRendererListener.java @@ -16,7 +16,7 @@ package org.teavm.vm.spi; import java.io.IOException; -import org.teavm.javascript.RenderingContext; +import org.teavm.backend.javascript.rendering.RenderingContext; import org.teavm.vm.BuildTarget; /** diff --git a/core/src/main/java/org/teavm/vm/spi/RendererListener.java b/core/src/main/java/org/teavm/vm/spi/RendererListener.java index 03affe7fb..d45ca564f 100644 --- a/core/src/main/java/org/teavm/vm/spi/RendererListener.java +++ b/core/src/main/java/org/teavm/vm/spi/RendererListener.java @@ -16,7 +16,7 @@ package org.teavm.vm.spi; import java.io.IOException; -import org.teavm.javascript.RenderingContext; +import org.teavm.backend.javascript.rendering.RenderingContext; import org.teavm.vm.BuildTarget; /** diff --git a/core/src/main/resources/org/teavm/javascript/runtime.js b/core/src/main/resources/org/teavm/backend/javascript/runtime.js similarity index 100% rename from core/src/main/resources/org/teavm/javascript/runtime.js rename to core/src/main/resources/org/teavm/backend/javascript/runtime.js diff --git a/core/teavm-core.iml b/core/teavm-core.iml index 5e9574f5f..2f70fa9a3 100644 --- a/core/teavm-core.iml +++ b/core/teavm-core.iml @@ -6,7 +6,7 @@ - + diff --git a/html4j/src/main/java/org/teavm/html4j/HTML4JPlugin.java b/html4j/src/main/java/org/teavm/html4j/HTML4JPlugin.java index a1aef2047..5b676ba9e 100644 --- a/html4j/src/main/java/org/teavm/html4j/HTML4JPlugin.java +++ b/html4j/src/main/java/org/teavm/html4j/HTML4JPlugin.java @@ -15,7 +15,7 @@ */ package org.teavm.html4j; -import org.teavm.javascript.backend.TeaVMJavaScriptHost; +import org.teavm.backend.javascript.TeaVMJavaScriptHost; import org.teavm.vm.spi.TeaVMHost; import org.teavm.vm.spi.TeaVMPlugin; diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyGenerator.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyGenerator.java index 16d612d95..f38cbad0e 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyGenerator.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyGenerator.java @@ -18,17 +18,13 @@ package org.teavm.html4j; import java.io.IOException; import java.util.List; import net.java.html.js.JavaScriptBody; -import org.teavm.codegen.NamingStrategy; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.Renderer; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.NamingStrategy; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.Renderer; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.*; -/** - * - * @author Alexey Andreev - */ public class JavaScriptBodyGenerator implements Generator { @Override public void generate(GeneratorContext context, SourceWriter writer, MethodReference methodRef) throws IOException { diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyTransformer.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyTransformer.java index b9013949a..50def6608 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyTransformer.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptBodyTransformer.java @@ -17,7 +17,7 @@ package org.teavm.html4j; import net.java.html.js.JavaScriptBody; import org.teavm.diagnostics.Diagnostics; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; import org.teavm.model.*; /** diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java index 14467161b..2c4f53846 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java @@ -15,7 +15,7 @@ */ package org.teavm.html4j; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; /** * diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java index d6efb07c7..500923af8 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java @@ -16,9 +16,9 @@ package org.teavm.html4j; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.*; /** diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptResourceInterceptor.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptResourceInterceptor.java index 15953bc74..3a0d3f4ad 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptResourceInterceptor.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptResourceInterceptor.java @@ -20,8 +20,8 @@ import java.io.InputStream; import java.io.StringWriter; import net.java.html.js.JavaScriptResource; import org.apache.commons.io.IOUtils; -import org.teavm.javascript.RenderingContext; -import org.teavm.javascript.RenderingException; +import org.teavm.backend.javascript.rendering.RenderingContext; +import org.teavm.backend.javascript.rendering.RenderingException; import org.teavm.model.AnnotationReader; import org.teavm.model.ClassReader; import org.teavm.vm.BuildTarget; diff --git a/html4j/src/main/java/org/teavm/html4j/ResourcesInterceptor.java b/html4j/src/main/java/org/teavm/html4j/ResourcesInterceptor.java index 6c7cc0715..5e504b273 100644 --- a/html4j/src/main/java/org/teavm/html4j/ResourcesInterceptor.java +++ b/html4j/src/main/java/org/teavm/html4j/ResourcesInterceptor.java @@ -22,8 +22,8 @@ import java.util.Base64; import java.util.HashSet; import java.util.Set; import org.apache.commons.io.IOUtils; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.RenderingContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.RenderingContext; import org.teavm.vm.BuildTarget; import org.teavm.vm.spi.AbstractRendererListener; diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/AstWriter.java b/jso/impl/src/main/java/org/teavm/jso/impl/AstWriter.java index bb3b67e71..17d0ebe6d 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/AstWriter.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/AstWriter.java @@ -69,13 +69,9 @@ import org.mozilla.javascript.ast.UnaryExpression; import org.mozilla.javascript.ast.VariableDeclaration; import org.mozilla.javascript.ast.VariableInitializer; import org.mozilla.javascript.ast.WhileLoop; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.model.MethodReference; -/** - * - * @author Alexey Andreev - */ public class AstWriter { public static final int PRECEDENCE_MEMBER = 2; public static final int PRECEDENCE_FUNCTION = 3; @@ -119,18 +115,6 @@ public class AstWriter { } } - public void declareAlias(String name, String alias) { - if (!aliases.add(alias)) { - throw new IllegalArgumentException("Alias " + alias + " is already occupied"); - } - nameMap.put(name, p -> writer.append(alias)); - } - - public void reserveName(String name) { - aliases.add(name); - nameMap.put(name, p -> writer.append(name)); - } - public void declareNameEmitter(String name, NameEmitter emitter) { nameMap.put(name, emitter); } diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JS.java b/jso/impl/src/main/java/org/teavm/jso/impl/JS.java index 98d9d97b6..ec3702466 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JS.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JS.java @@ -18,8 +18,8 @@ package org.teavm.jso.impl; import java.lang.reflect.Array; import java.util.function.Function; import org.teavm.dependency.PluggableDependency; -import org.teavm.javascript.spi.GeneratedBy; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.core.JSArray; diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSAliasRenderer.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSAliasRenderer.java index 546df6b9a..1156000e5 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSAliasRenderer.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSAliasRenderer.java @@ -17,8 +17,8 @@ package org.teavm.jso.impl; import java.io.IOException; import java.util.Map; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.RenderingContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.RenderingContext; import org.teavm.jso.impl.JSDependencyListener.ExposedClass; import org.teavm.model.ClassReader; import org.teavm.model.ClassReaderSource; diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyAstEmitter.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyAstEmitter.java index adae48c7e..1d92cb7f7 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyAstEmitter.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyAstEmitter.java @@ -19,10 +19,10 @@ import java.io.IOException; import org.mozilla.javascript.Node; import org.mozilla.javascript.ast.AstNode; import org.mozilla.javascript.ast.Block; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.Precedence; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.Precedence; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; /** diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyBloatedEmitter.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyBloatedEmitter.java index 72a26288c..37c5882e7 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyBloatedEmitter.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyBloatedEmitter.java @@ -16,9 +16,9 @@ package org.teavm.jso.impl; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; /** diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyEmitter.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyEmitter.java index b2a51273f..7cc561a81 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyEmitter.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyEmitter.java @@ -16,9 +16,9 @@ package org.teavm.jso.impl; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; /** diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyGenerator.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyGenerator.java index b154cd9f8..007c34990 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyGenerator.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSBodyGenerator.java @@ -16,11 +16,11 @@ package org.teavm.jso.impl; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; /** diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java index 67ac20bfb..c4bb40147 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSClassProcessor.java @@ -32,8 +32,8 @@ import org.mozilla.javascript.ast.AstRoot; import org.mozilla.javascript.ast.FunctionNode; import org.teavm.cache.NoCache; import org.teavm.diagnostics.Diagnostics; -import org.teavm.javascript.spi.GeneratedBy; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.interop.Sync; import org.teavm.jso.JSBody; import org.teavm.jso.JSFunctor; diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSNativeGenerator.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSNativeGenerator.java index 8e8386a20..fae7b2fe3 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSNativeGenerator.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSNativeGenerator.java @@ -19,16 +19,16 @@ import java.io.IOException; import org.teavm.ast.ConstantExpr; import org.teavm.ast.Expr; import org.teavm.ast.InvocationExpr; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.DependencyAgent; import org.teavm.dependency.DependencyPlugin; import org.teavm.dependency.MethodDependency; -import org.teavm.javascript.Precedence; -import org.teavm.javascript.Renderer; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.rendering.Precedence; +import org.teavm.backend.javascript.rendering.Renderer; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.CallLocation; import org.teavm.model.ClassReader; import org.teavm.model.MethodReader; diff --git a/jso/impl/src/main/java/org/teavm/jso/impl/JSOPlugin.java b/jso/impl/src/main/java/org/teavm/jso/impl/JSOPlugin.java index 17a7e03d4..39beea13a 100644 --- a/jso/impl/src/main/java/org/teavm/jso/impl/JSOPlugin.java +++ b/jso/impl/src/main/java/org/teavm/jso/impl/JSOPlugin.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.impl; -import org.teavm.javascript.backend.TeaVMJavaScriptHost; +import org.teavm.backend.javascript.TeaVMJavaScriptHost; import org.teavm.vm.spi.TeaVMHost; import org.teavm.vm.spi.TeaVMPlugin; diff --git a/jso/impl/src/test/java/org/teavm/jso/plugin/AstWriterTest.java b/jso/impl/src/test/java/org/teavm/jso/plugin/AstWriterTest.java index 4ec5ed56d..03a93c987 100644 --- a/jso/impl/src/test/java/org/teavm/jso/plugin/AstWriterTest.java +++ b/jso/impl/src/test/java/org/teavm/jso/plugin/AstWriterTest.java @@ -23,8 +23,8 @@ import org.junit.Test; import org.mozilla.javascript.CompilerEnvirons; import org.mozilla.javascript.Context; import org.mozilla.javascript.ast.AstRoot; -import org.teavm.codegen.SourceWriter; -import org.teavm.codegen.SourceWriterBuilder; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriterBuilder; import org.teavm.jso.impl.AstWriter; import org.teavm.jso.impl.JSParser; @@ -44,18 +44,6 @@ public class AstWriterTest { writer = new AstWriter(sourceWriter); } - @Test - public void renamesVariable() throws IOException { - writer.declareAlias("a", "b"); - assertThat(transform("return a;"), is("return b;")); - } - - @Test - public void renamesDeclaredVariable() throws IOException { - writer.declareAlias("a", "b"); - assertThat(transform("var b; return a + b;"), is("var b_0;return b+b_0;")); - } - @Test public void writesReturn() throws IOException { assertThat(transform("return x;"), is("return x;")); diff --git a/platform/src/main/java/org/teavm/platform/Platform.java b/platform/src/main/java/org/teavm/platform/Platform.java index 6a3fcefba..906b01bfa 100644 --- a/platform/src/main/java/org/teavm/platform/Platform.java +++ b/platform/src/main/java/org/teavm/platform/Platform.java @@ -17,8 +17,8 @@ package org.teavm.platform; import java.lang.annotation.Annotation; import org.teavm.dependency.PluggableDependency; -import org.teavm.javascript.spi.GeneratedBy; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.browser.Window; diff --git a/platform/src/main/java/org/teavm/platform/PlatformQueue.java b/platform/src/main/java/org/teavm/platform/PlatformQueue.java index 6d9e8ca96..affd10e93 100644 --- a/platform/src/main/java/org/teavm/platform/PlatformQueue.java +++ b/platform/src/main/java/org/teavm/platform/PlatformQueue.java @@ -16,7 +16,7 @@ package org.teavm.platform; import org.teavm.dependency.PluggableDependency; -import org.teavm.javascript.spi.InjectedBy; +import org.teavm.backend.javascript.spi.InjectedBy; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.platform.plugin.PlatformQueueGenerator; diff --git a/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodGenerator.java index 2c98c504d..da8ef3cc1 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodGenerator.java @@ -16,12 +16,12 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.DependencyAgent; import org.teavm.dependency.DependencyPlugin; import org.teavm.dependency.MethodDependency; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.CallLocation; import org.teavm.model.ClassReader; import org.teavm.model.ElementModifier; diff --git a/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java b/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java index 6be5350c8..e0361a4c6 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java +++ b/platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java @@ -18,7 +18,7 @@ package org.teavm.platform.plugin; import org.teavm.dependency.PluggableDependency; import org.teavm.diagnostics.Diagnostics; import org.teavm.interop.Async; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; import org.teavm.interop.Sync; import org.teavm.model.*; import org.teavm.platform.async.AsyncCallback; diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeClassResource.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeClassResource.java index b622c0f0a..0504602c5 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeClassResource.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeClassResource.java @@ -16,7 +16,7 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.platform.metadata.ClassResource; /** diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceArray.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceArray.java index c2e9a9267..047e06bb7 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceArray.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceArray.java @@ -18,7 +18,7 @@ package org.teavm.platform.plugin; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.platform.metadata.Resource; import org.teavm.platform.metadata.ResourceArray; diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceMap.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceMap.java index d7cc6e846..5e6c2b7ec 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceMap.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceMap.java @@ -18,7 +18,7 @@ package org.teavm.platform.plugin; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.platform.metadata.Resource; import org.teavm.platform.metadata.ResourceMap; diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceProxyBuilder.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceProxyBuilder.java index b1a3a1082..a9d734372 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceProxyBuilder.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceProxyBuilder.java @@ -17,7 +17,7 @@ package org.teavm.platform.plugin; import java.lang.reflect.Method; import java.util.*; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.platform.metadata.Resource; import org.teavm.platform.metadata.ResourceArray; import org.teavm.platform.metadata.ResourceMap; diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceWriterMethod.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceWriterMethod.java index 0a30410db..9437a4d01 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceWriterMethod.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeResourceWriterMethod.java @@ -15,7 +15,7 @@ */ package org.teavm.platform.plugin; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; /** * diff --git a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeStaticFieldResource.java b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeStaticFieldResource.java index fa848b04c..68045ccd9 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/BuildTimeStaticFieldResource.java +++ b/platform/src/main/java/org/teavm/platform/plugin/BuildTimeStaticFieldResource.java @@ -16,7 +16,7 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.model.FieldReference; import org.teavm.platform.metadata.StaticFieldResource; diff --git a/platform/src/main/java/org/teavm/platform/plugin/ClassScopedMetadataProviderNativeGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/ClassScopedMetadataProviderNativeGenerator.java index 4a455d8c6..c558169de 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ClassScopedMetadataProviderNativeGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ClassScopedMetadataProviderNativeGenerator.java @@ -19,10 +19,10 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.Map; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.Renderer; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.rendering.Renderer; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.*; import org.teavm.platform.metadata.ClassScopedMetadataGenerator; import org.teavm.platform.metadata.ClassScopedMetadataProvider; diff --git a/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderNativeGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderNativeGenerator.java index 7886e13db..74f7ccd02 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderNativeGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderNativeGenerator.java @@ -18,9 +18,9 @@ package org.teavm.platform.plugin; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.*; import org.teavm.platform.metadata.MetadataGenerator; import org.teavm.platform.metadata.MetadataProvider; diff --git a/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderTransformer.java b/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderTransformer.java index 59887e95f..9c3e731a0 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderTransformer.java +++ b/platform/src/main/java/org/teavm/platform/plugin/MetadataProviderTransformer.java @@ -17,7 +17,7 @@ package org.teavm.platform.plugin; import org.teavm.cache.NoCache; import org.teavm.diagnostics.Diagnostics; -import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.backend.javascript.spi.GeneratedBy; import org.teavm.model.AccessLevel; import org.teavm.model.AnnotationHolder; import org.teavm.model.AnnotationReader; diff --git a/platform/src/main/java/org/teavm/platform/plugin/PlatformGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/PlatformGenerator.java index 966df1f92..7b4e6d17f 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/PlatformGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/PlatformGenerator.java @@ -17,14 +17,14 @@ package org.teavm.platform.plugin; import java.io.IOException; import java.lang.annotation.Annotation; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; import org.teavm.dependency.DependencyAgent; import org.teavm.dependency.DependencyPlugin; import org.teavm.dependency.MethodDependency; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.CallLocation; import org.teavm.model.ClassReader; import org.teavm.model.MethodDescriptor; diff --git a/platform/src/main/java/org/teavm/platform/plugin/PlatformQueueGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/PlatformQueueGenerator.java index eacbee35c..dc498d2ed 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/PlatformQueueGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/PlatformQueueGenerator.java @@ -19,8 +19,8 @@ import java.io.IOException; import org.teavm.dependency.DependencyAgent; import org.teavm.dependency.DependencyPlugin; import org.teavm.dependency.MethodDependency; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.CallLocation; import org.teavm.model.MethodReference; import org.teavm.platform.PlatformObject; diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorGenerator.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorGenerator.java index c00ca67da..5e4b48f9b 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorGenerator.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorGenerator.java @@ -16,9 +16,9 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; -import org.teavm.javascript.spi.Generator; -import org.teavm.javascript.spi.GeneratorContext; +import org.teavm.backend.javascript.codegen.SourceWriter; +import org.teavm.backend.javascript.spi.Generator; +import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.MethodReference; /** diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorInjector.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorInjector.java index 85ab10e7e..646126e92 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorInjector.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorInjector.java @@ -18,8 +18,8 @@ package org.teavm.platform.plugin; import java.io.IOException; import org.teavm.ast.ConstantExpr; import org.teavm.ast.Expr; -import org.teavm.javascript.spi.Injector; -import org.teavm.javascript.spi.InjectorContext; +import org.teavm.backend.javascript.spi.Injector; +import org.teavm.backend.javascript.spi.InjectorContext; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorTransformer.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorTransformer.java index 0ef0823ba..0432593ad 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorTransformer.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceAccessorTransformer.java @@ -16,7 +16,7 @@ package org.teavm.platform.plugin; import org.teavm.diagnostics.Diagnostics; -import org.teavm.javascript.backend.TeaVMJavaScriptHost; +import org.teavm.backend.javascript.TeaVMJavaScriptHost; import org.teavm.model.*; import org.teavm.vm.spi.TeaVMHost; diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceWriter.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceWriter.java index b457a5d70..50a0a1870 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceWriter.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceWriter.java @@ -16,7 +16,7 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; /** * diff --git a/platform/src/main/java/org/teavm/platform/plugin/ResourceWriterHelper.java b/platform/src/main/java/org/teavm/platform/plugin/ResourceWriterHelper.java index bb1e622f6..a5a1faa66 100644 --- a/platform/src/main/java/org/teavm/platform/plugin/ResourceWriterHelper.java +++ b/platform/src/main/java/org/teavm/platform/plugin/ResourceWriterHelper.java @@ -16,7 +16,7 @@ package org.teavm.platform.plugin; import java.io.IOException; -import org.teavm.codegen.SourceWriter; +import org.teavm.backend.javascript.codegen.SourceWriter; /** * diff --git a/tests/src/test/java/org/teavm/dependency/ClassValueTest.java b/tests/src/test/java/org/teavm/dependency/ClassValueTest.java index 9a159e068..fc956f1e8 100644 --- a/tests/src/test/java/org/teavm/dependency/ClassValueTest.java +++ b/tests/src/test/java/org/teavm/dependency/ClassValueTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.apache.commons.io.output.ByteArrayOutputStream; import org.junit.Test; -import org.teavm.javascript.backend.JavaScriptTarget; +import org.teavm.backend.javascript.JavaScriptTarget; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; import org.teavm.tooling.TeaVMProblemRenderer; diff --git a/tests/src/test/java/org/teavm/tests/JSOTest.java b/tests/src/test/java/org/teavm/tests/JSOTest.java index cc5dbffdd..f4fd609ec 100644 --- a/tests/src/test/java/org/teavm/tests/JSOTest.java +++ b/tests/src/test/java/org/teavm/tests/JSOTest.java @@ -22,7 +22,7 @@ import java.io.ByteArrayOutputStream; import java.util.List; import org.junit.Test; import org.teavm.diagnostics.Problem; -import org.teavm.javascript.backend.JavaScriptTarget; +import org.teavm.backend.javascript.JavaScriptTarget; import org.teavm.jso.JSBody; import org.teavm.model.MethodReference; import org.teavm.model.ValueType; diff --git a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java index c4388d59c..b4fe2a74c 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -42,8 +42,8 @@ import org.teavm.debugging.information.DebugInformation; import org.teavm.debugging.information.DebugInformationBuilder; import org.teavm.dependency.DependencyInfo; import org.teavm.diagnostics.ProblemProvider; -import org.teavm.javascript.RenderingContext; -import org.teavm.javascript.backend.JavaScriptTarget; +import org.teavm.backend.javascript.rendering.RenderingContext; +import org.teavm.backend.javascript.JavaScriptTarget; import org.teavm.model.ClassHolderSource; import org.teavm.model.ClassHolderTransformer; import org.teavm.model.ClassReader; @@ -64,7 +64,7 @@ import org.teavm.vm.TeaVMEntryPoint; import org.teavm.vm.TeaVMProgressListener; import org.teavm.vm.TeaVMTarget; import org.teavm.vm.spi.AbstractRendererListener; -import org.teavm.wasm.WasmTarget; +import org.teavm.backend.wasm.WasmTarget; public class TeaVMTool implements BaseTeaVMTool { private File targetDirectory = new File("."); @@ -483,7 +483,7 @@ public class TeaVMTool implements BaseTeaVMTool { } if (runtime == RuntimeCopyOperation.SEPARATE) { - resourceToFile("org/teavm/javascript/runtime.js", "runtime.js"); + resourceToFile("org/teavm/backend/javascript/runtime.js", "runtime.js"); } if (mainPageIncluded) { String text; @@ -512,7 +512,7 @@ public class TeaVMTool implements BaseTeaVMTool { @Override public void begin(RenderingContext context, BuildTarget buildTarget) throws IOException { StringWriter writer = new StringWriter(); - resourceToWriter("org/teavm/javascript/runtime.js", writer); + resourceToWriter("org/teavm/backend/javascript/runtime.js", writer); writer.close(); context.getWriter().append(writer.toString()).newLine(); } diff --git a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java index ed9ed92d6..1cc15381d 100644 --- a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java +++ b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java @@ -47,7 +47,7 @@ import org.junit.runners.model.InitializationError; import org.teavm.callgraph.CallGraph; import org.teavm.diagnostics.DefaultProblemTextConsumer; import org.teavm.diagnostics.Problem; -import org.teavm.javascript.backend.JavaScriptTarget; +import org.teavm.backend.javascript.JavaScriptTarget; import org.teavm.model.ClassHolder; import org.teavm.model.ClassHolderSource; import org.teavm.model.MethodDescriptor; @@ -335,7 +335,7 @@ public class TeaVMTestRunner extends Runner { File outputFile = new File(path, "test.js"); result.file = outputFile; - resourceToFile("org/teavm/javascript/runtime.js", new File(path, "runtime.js")); + resourceToFile("org/teavm/backend/javascript/runtime.js", new File(path, "runtime.js")); resourceToFile("teavm-run-test.html", new File(path, "run-test.html")); ClassLoader classLoader = TeaVMTestRunner.class.getClassLoader();