internal void ExtendAsCall(SnapshotBase callerContext, ProgramPointGraph callee, MemoryEntry thisObject, MemoryEntry[] arguments) { checkCanUpdate(); _statistics.Report(Statistic.AsCallExtendings); extendAsCall(callerContext, callee, thisObject, arguments); }
/// <summary> /// Creates snapshot entry containing given value. Created entry doesn't have /// explicit memory storage. But it still can be asked for saving indexes, fields, resolving aliases,... !!! /// </summary> /// <param name="entry">Value wrapped in snapshot entry</param> /// <returns>Created value entry</returns> protected abstract ReadWriteSnapshotEntryBase createSnapshotEntry(MemoryEntry entry);
/// <summary> /// Extend snapshot as a call to function/method callee from given callerContext /// </summary> /// <param name="callerContext">The caller context.</param> /// <param name="callee">Program point graph of the callee (identification of function or method that was called).</param> /// <param name="thisObject">The this object.</param> /// <param name="arguments">The arguments.</param> protected abstract void extendAsCall(SnapshotBase callerContext, ProgramPointGraph callee, MemoryEntry thisObject, MemoryEntry[] arguments);
/// <summary> /// Write at index of value (that is not array, string, undefined or anyvalue) /// </summary> /// <param name="indexed">Value which index is written</param> /// <param name="index">Index used for given value</param> /// <param name="writtenValue">Value that is written at specified index</param> /// <returns>Values that should be written back into value container</returns> public abstract IEnumerable <Value> WriteValueIndex(Value indexed, MemberIdentifier index, MemoryEntry writtenValue);
/// <summary> /// Creates snapshot entry containing given value. Created entry doesn't have /// explicit memory storage. But it still can be asked for saving indexes, fields, resolving aliases,... !!! /// </summary> /// <param name="value">Value wrapped in snapshot entry</param> /// <returns>Created value entry</returns> public ReadSnapshotEntryBase CreateSnapshotEntry(MemoryEntry value) { return(createSnapshotEntry(value)); }
/// <summary> /// Widening operation between old and current memory entries /// </summary> /// <param name="old">Initial value before transaction has been started</param> /// <param name="current">Value computed during transaction</param> /// <returns>Widened memory entry</returns> public abstract MemoryEntry Widen(MemoryEntry old, MemoryEntry current);
/// <summary> /// Simplify handler that is used during commit on entries having more than SimplifyLimit possible values /// </summary> /// <param name="entry">Value computed during transaction</param> /// <returns>Simplified memory entry</returns> public abstract MemoryEntry Simplify(MemoryEntry entry);
/// <summary> /// Write at field of value (that is not object, undefined or anyvalue) /// </summary> /// <param name="fielded">Value which field is written</param> /// <param name="field">Field used for given value</param> /// <param name="writtenValue">Value that is written at specified field</param> /// <returns>Values that should be written back into value container</returns> public abstract IEnumerable <Value> WriteValueField(Value fielded, VariableIdentifier field, MemoryEntry writtenValue);
/// <summary> /// Write given value at memory represent by snasphot entry. No value copy operations can be proceeded /// </summary> /// <param name="context">Context snapshot where operation is proceeded</param> /// <param name="value">Written value</param> public void WriteMemoryWithoutCopy(SnapshotBase context, MemoryEntry value) { //TODO statistics reporting writeMemoryWithoutCopy(context, value); }
/// <summary> /// Write given value at memory represented by snapshot entry /// </summary> /// <param name="value">Written value</param> /// <param name="context">Context snapshot where operation is proceeded</param> /// <param name="forceStrongWrite">Determine that current write should be processed as strong</param> public void WriteMemory(SnapshotBase context, MemoryEntry value, bool forceStrongWrite = false) { //TODO statistics reporting writeMemory(context, value, forceStrongWrite); }
/// <summary> /// Write given value at memory represented by snapshot entry and doesn't process any /// array copy. Is needed for correct increment/decrement semantic. /// </summary> /// <param name="value">Written value</param> /// <param name="context">Context snapshot where operation is proceeded</param> protected abstract void writeMemoryWithoutCopy(SnapshotBase context, MemoryEntry value);
/// <summary> /// Write given value at memory represented by snapshot entry /// </summary> /// <param name="value">Written value</param> /// <param name="context">Context snapshot where operation is proceeded</param> /// <param name="forceStrongWrite">Determine that current write should be processed as strong</param> protected abstract void writeMemory(SnapshotBase context, MemoryEntry value, bool forceStrongWrite);