Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /MLRISC/trunk/mltree/operand-table.sml
ViewVC logotype

Diff of /MLRISC/trunk/mltree/operand-table.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 591, Mon Apr 3 01:19:20 2000 UTC revision 641, Thu May 11 01:16:45 2000 UTC
# Line 14  Line 14 
14     datatype const =     datatype const =
15       IMMED of int           (* integer operand *)       IMMED of int           (* integer operand *)
16     | OPERAND of I.operand   (* other operand *)     | OPERAND of I.operand   (* other operand *)
17     | LABEL of Label.label   (* a label *)     (*| LABEL of Label.label*)   (* a label *)
18    
19     datatype operandTable =     datatype operandTable =
20        TABLE of        TABLE of
21        {  immTable   : value HA.array,        {  immTable   : value HA.array,
22           labelTable : (Label.label,value) HT.hash_table,           (*labelTable : (Label.label,value) HT.hash_table,*)
23           opnTable   : (I.operand,value) HT.hash_table,           opnTable   : (I.operand,value) HT.hash_table,
24           constTable : const HA.array,           constTable : const HA.array,
25           nextImmed  : int ref           nextImmed  : int ref
# Line 41  Line 41 
41         fun eqLabel(Label.Label{id=x,...},Label.Label{id=y,...}) = x=y         fun eqLabel(Label.Label{id=x,...},Label.Label{id=y,...}) = x=y
42         val immTable   = HA.array''(37,newImmed)         val immTable   = HA.array''(37,newImmed)
43         val opnTable   = HT.mkTable(Props.hashOpn,Props.eqOpn) (32,NoOperand)         val opnTable   = HT.mkTable(Props.hashOpn,Props.eqOpn) (32,NoOperand)
44         val labelTable = HT.mkTable(hashLabel,eqLabel) (32,NoLabel)         (*val labelTable = HT.mkTable(hashLabel,eqLabel) (32,NoLabel)*)
45     in  TABLE{ immTable   = immTable,     in  TABLE{ immTable   = immTable,
46                labelTable = labelTable,                (*labelTable = labelTable,*)
47                opnTable   = opnTable,                opnTable   = opnTable,
48                constTable = constTable,                constTable = constTable,
49                nextImmed  = nextImmed                nextImmed  = nextImmed
# Line 55  Line 55 
55     fun immed(TABLE{immTable, ...}) i = HA.sub(immTable,i)     fun immed(TABLE{immTable, ...}) i = HA.sub(immTable,i)
56    
57     (* lookup/insert a label *)     (* lookup/insert a label *)
58     fun label(TABLE{labelTable,constTable,nextImmed,...}) =     (*fun label(TABLE{labelTable,constTable,nextImmed,...}) =
59     let val look = HT.lookup labelTable     let val look = HT.lookup labelTable
60         val ins  = HT.insert labelTable         val ins  = HT.insert labelTable
61         fun lookup l = look l handle NoLabel =>         fun lookup l = look l handle NoLabel =>
# Line 63  Line 63 
63                 val _ = nextImmed := v - 1                 val _ = nextImmed := v - 1
64             in  HA.update(constTable,v,LABEL l); ins(l,v); v end             in  HA.update(constTable,v,LABEL l); ins(l,v); v end
65     in  lookup end     in  lookup end
66       *)
67    
68     (* lookup/insert an operand *)     (* lookup/insert an operand *)
69     fun operand(TABLE{opnTable,constTable,nextImmed,...}) =     fun operand(TABLE{opnTable,constTable,nextImmed,...}) =

Legend:
Removed from v.591  
changed lines
  Added in v.641

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0