Skip to content

Commit

Permalink
towards-data-module: SMethod moved to sigma.ast
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Oct 6, 2023
1 parent e265ade commit cd36fbf
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.ergoplatform.validation

import sigma.SigmaException
import sigma.ast.MethodsContainer
import sigma.ast.{MethodsContainer, SMethod}
import sigma.ast.TypeCodes.LastConstantCode
import sigma.serialization.{InvalidOpCode, SerializerException}
import sigma.util.Extensions.toUByte
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sigma.ast

import sigma.serialization.CoreByteWriter.ArgInfo
import sigmastate.SMethod
import sigmastate.lang.SigmaPredef.PredefinedFuncRegistry
import sigmastate.lang.StdSigmaBuilder

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package sigmastate
package sigma.ast

import debox.cfor
import sigma.ast._
import sigma.ast.SMethod.{InvokeDescBuilder, MethodCostFunc}
import sigma.ast.global._
import sigma.data.RType
import sigma.reflection.{RClass, RMethod}
import sigma.serialization.CoreByteWriter.ArgInfo
import sigma.validation.ValidationRules.CheckTypeWithMethods
import sigma.{Coll, Evaluation}
import sigmastate.SMethod.{InvokeDescBuilder, MethodCostFunc}
import sigmastate.interpreter._
import sigmastate.lang.SigmaBuilder
import sigmastate.lang.Terms.{MethodCall, OperationId}
Expand Down
2 changes: 1 addition & 1 deletion interpreter/shared/src/main/scala/sigma/ast/methods.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import sigma.data.{Nullable, RType, SigmaConstants}
import sigma.reflection.RClass
import sigma.serialization.CoreByteWriter.ArgInfo
import sigma._
import sigmastate.SMethod.{MethodCallIrBuilder, MethodCostFunc, javaMethodOf}
import SMethod.{MethodCallIrBuilder, MethodCostFunc, javaMethodOf}
import sigmastate.eval._
import sigmastate.interpreter._
import sigmastate.lang.Terms._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sigmastate.eval

import debox.{sp, Buffer => DBuffer, Map => DMap}
import sigma.ast.{FixedCost, JitCost}
import sigma.ast.{FixedCost, JitCost, SMethod}
import sigma.ast.TypeCodes.LastConstantCode
import sigma.ast.global._
import sigma.util.Extensions.{ByteOps, DBufferOps}
Expand All @@ -10,8 +10,6 @@ import sigmastate.lang.Terms.{MethodCall, PropertyCall}
import sigmastate.serialization.ValueCodes.OpCode
import sigmastate.serialization.ValueSerializer
import sigmastate.serialization.ValueSerializer.getSerializer
import sigmastate.SMethod

import scala.reflect.ClassTag

/** Holds a series of profile measurements associated with a key.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sigmastate.interpreter

import sigma.ast.{FixedCost, JitCost, PerItemCost, SType, TypeBasedCost}
import sigmastate.SMethod
import sigma.ast.{FixedCost, JitCost, PerItemCost, SMethod, SType, TypeBasedCost}
import sigma.ast.{FixedCostValueCompanion, PerItemCostValueCompanion, ValueCompanion}
import sigmastate.lang.Terms.MethodCall

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sigmastate.interpreter

import sigmastate.SMethod
import sigma.ast.{CostKind, ValueCompanion}
import sigma.ast.{CostKind, SMethod, ValueCompanion}

/** Each costable operation is described in one of the following ways:
* 1) using [[ValueCompanion]] - operation with separate node class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sigmastate.utils.SigmaByteWriter._
import sigmastate.utils.{SigmaByteReader, SigmaByteWriter}
import sigmastate.utxo.ComplexityTable
import debox.cfor
import sigma.ast.{SType, STypeSubst, Value, ValueCompanion}
import sigma.ast.{SMethod, SType, STypeSubst, Value, ValueCompanion}
import sigma.serialization.CoreByteWriter.{ArgInfo, DataInfo}

case class MethodCallSerializer(cons: (Value[SType], SMethod, IndexedSeq[Value[SType]], STypeSubst) => Value[SType])
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion sc/shared/src/main/scala/sigmastate/lang/SigmaCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ import sigmastate.utxo._
import sigma.ast._
import sigma.ast.global.SValue
import SCollectionMethods.{ExistsMethod, ForallMethod, MapMethod}
import sigma.ast
import sigmastate.{Exponentiate, InterpreterReflection, MultiplyGroup, Xor}

/**
* @param networkPrefix network prefix to decode an ergo address from string (PK op)
* @param builder used to create ErgoTree nodes
* @param lowerMethodCalls if true, then MethodCall nodes are lowered to ErgoTree nodes
* when [[sigmastate.SMethod.irInfo.irBuilder]] is defined. For
* when [[sigma.ast.SMethod.irInfo.irBuilder]] is defined. For
* example, in the `coll.map(x => x+1)` code, the `map` method
* call can be lowered to MapCollection node.
* The lowering if preferable, because it is more compact (1 byte
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package sigmastate.utils

import sigmastate.SMethod
import sigma.ast.SMethod
import sigma.util.PrintExtensions._
import scala.util.Try
import Helpers._ // required for Scala 2.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import sigmastate.interpreter.Interpreter
import sigmastate.lang.Terms._
import sigmastate.serialization.ErgoTreeSerializer
import sigmastate.serialization.ErgoTreeSerializer.DefaultSerializer
import sigmastate.utxo.ComplexityTableStat

import scala.util.Random

Expand Down Expand Up @@ -553,10 +552,6 @@ class IcoExample extends CompilerTestingCommons
printDebug("lookup proof size: " + lookupProof.length)
}

property("ComplexityTableStat") {
printDebug(ComplexityTableStat.complexityTableString)
}

/** This is the last executed test suite, so this method is executed after all tests.
* We output statistics of how PrecompiledScriptProcessor cache was used. */
override protected def afterAll(): Unit = {
Expand Down

0 comments on commit cd36fbf

Please sign in to comment.