Exemple #1
0
        public SymbolicReference MergeEntities()
        {
            MaterializeFields();
            if (IsConstAfterSimplification())
            {
                return(entities[0]);
            }

            if (entities.Length > 1)
            {
                var newEntity = SymbolicReference.Merge(entities);
                entities = new[] { newEntity };
            }

            return(entities[0]);
        }
Exemple #2
0
        // store by address
        public void Store(SymbolicSlot value)
        {
            if (IsConstAfterSimplification() || value.IsConstAfterSimplification())
            {
                return;
            }

            // store like a field because we should create a snapshot in the moment
            // and avoid cycled references in the "values" field
            MaterializeFields();
            value.MaterializeFields();

            if (IsConstAfterSimplification() || value.IsConstAfterSimplification())
            {
                return;
            }

            var mergedEntity = SymbolicReference.Merge(entities, value.entities);

            entities       = new[] { mergedEntity };
            value.entities = new[] { mergedEntity };
        }
Exemple #3
0
        public void StoreField(string name, SymbolicSlot value)
        {
            if (IsConstAfterSimplification() || value.IsConstAfterSimplification())
            {
                return;
            }

            MaterializeFields();
            value.MaterializeFields();

            if (IsConstAfterSimplification() || value.IsConstAfterSimplification())
            {
                return;
            }

            var targetEntity = SymbolicReference.Merge(value.entities);

            for (int i = 0; i < entities.Length; i++)
            {
                var entity = entities[i];
                entity.StoreField(name, targetEntity);
            }
        }