Changeset 64 for trunk/Forms


Ignore:
Timestamp:
Dec 4, 2014, 2:59:28 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Now commands cmInc, cmDec, cmPointerInc, cmPointerDec and cmSet use numeric parameter to merge multiple small steps to one unary operation with numeric parameter. Optimization is done on TTarget side and not on each specific targets.
  • Added: Optimization to eliminate redundant source code.
  • Added: Optimization level option in Options dialog.
Location:
trunk/Forms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r63 r64  
    194194    FCurrentTarget.OnChangeState := TargetStateChanged;
    195195    FCurrentTarget.OnLog := TargetLogExecute;
     196    FCurrentTarget.OptimizationLevel := Core.OptimizationLevel;
    196197    FCurrentTarget.Messages.OnChange := MessagesChanged;
    197198  end;
     
    469470    //OptionsForm.SaveToInterpretter(CurrentTarget);
    470471    OptionsForm.Save;
     472    if Assigned(CurrentTarget) then
     473      CurrentTarget.OptimizationLevel := Core.OptimizationLevel;
    471474  end;
    472475end;
     
    476479  with CurrentTarget do begin
    477480    AProgramStop.Execute;
    478     Optimization := coNormal;
    479481    SourceCode := FormSourceCode.MemoSource.Text;
    480482    ProjectFileName := Core.Project.FileName;
  • trunk/Forms/UFormOptions.lfm

    r59 r64  
    11object OptionsForm: TOptionsForm
    22  Left = 415
    3   Height = 279
     3  Height = 339
    44  Top = 210
    55  Width = 468
    66  Caption = 'Options'
    7   ClientHeight = 279
     7  ClientHeight = 339
    88  ClientWidth = 468
    99  OnShow = FormShow
     
    1212    Left = 389
    1313    Height = 25
    14     Top = 247
     14    Top = 307
    1515    Width = 75
    1616    Anchors = [akRight, akBottom]
     
    2323    Left = 304
    2424    Height = 25
    25     Top = 247
     25    Top = 307
    2626    Width = 75
    2727    Anchors = [akRight, akBottom]
     
    8080    TabOrder = 4
    8181  end
    82   object ComboBoxLanguage: TComboBox
    83     Left = 248
    84     Height = 37
    85     Top = 83
    86     Width = 188
    87     ItemHeight = 0
    88     Style = csDropDownList
    89     TabOrder = 5
    90   end
    9182  object SpinEditDPIX: TSpinEdit
    9283    Left = 104
     
    9687    MaxValue = 1000
    9788    MinValue = 1
    98     TabOrder = 6
     89    TabOrder = 5
    9990    Value = 1
    10091  end
     
    114105    MaxValue = 1000
    115106    MinValue = 1
    116     TabOrder = 7
     107    TabOrder = 6
    117108    Value = 1
    118109  end
     
    134125    Caption = 'Automatic DPI'
    135126    OnChange = CheckBoxDPIAutoChange
     127    TabOrder = 7
     128  end
     129  object Label4: TLabel
     130    Left = 16
     131    Height = 25
     132    Top = 248
     133    Width = 221
     134    Caption = 'Compiler optimizations:'
     135    ParentColor = False
     136  end
     137  object ComboBoxLanguage: TComboBox
     138    Left = 248
     139    Height = 37
     140    Top = 83
     141    Width = 188
     142    ItemHeight = 0
     143    Style = csDropDownList
    136144    TabOrder = 8
    137145  end
     146  object ComboBoxOptimizatipn: TComboBox
     147    Left = 256
     148    Height = 37
     149    Top = 240
     150    Width = 188
     151    ItemHeight = 0
     152    Items.Strings = (
     153      'None'
     154      'Normal'
     155    )
     156    Style = csDropDownList
     157    TabOrder = 9
     158  end
    138159end
  • trunk/Forms/UFormOptions.lrt

    r59 r64  
    99TOPTIONSFORM.LABELX.CAPTION=x
    1010TOPTIONSFORM.CHECKBOXDPIAUTO.CAPTION=Automatic DPI
     11TOPTIONSFORM.LABEL4.CAPTION=Compiler optimizations:
  • trunk/Forms/UFormOptions.pas

    r59 r64  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Spin, UTargetInterpretter;
     9  Spin, UTargetInterpretter, UTarget;
    1010
    1111type
     
    1919    CheckBoxDPIAuto: TCheckBox;
    2020    ComboBoxLanguage: TComboBox;
     21    ComboBoxOptimizatipn: TComboBox;
    2122    Label1: TLabel;
    2223    Label2: TLabel;
    2324    Label3: TLabel;
     25    Label4: TLabel;
    2426    LabelDPI: TLabel;
    2527    LabelX: TLabel;
     
    7880  SpinEditDPIY.Value := Core.ScaleDPI.DPI.Y;
    7981  CheckBoxDPIAuto.Checked := Core.ScaleDPI.AutoDetect;
     82  ComboBoxOptimizatipn.ItemIndex := Integer(Core.OptimizationLevel);
    8083  UpdateInterface;
    8184end;
     
    8689  Core.ScaleDPI.DPI.Y := SpinEditDPIY.Value;
    8790  Core.ScaleDPI.AutoDetect := CheckBoxDPIAuto.Checked;
     91  Core.OptimizationLevel := TCompilerOptimization(ComboBoxOptimizatipn.ItemIndex);
    8892end;
    8993
  • trunk/Forms/UFormTargetCode.lfm

    r48 r64  
    77  ClientHeight = 240
    88  ClientWidth = 320
    9   LCLVersion = '1.1'
     9  LCLVersion = '1.3'
    1010  object MemoTarget: TMemo
    1111    Left = 0
     
    1414    Width = 320
    1515    Align = alClient
     16    Font.Name = 'Courier New'
     17    ParentFont = False
    1618    PopupMenu = PopupMenuTarget
    1719    ReadOnly = True
Note: See TracChangeset for help on using the changeset viewer.