Skip to content

Commit

Permalink
implementing #265 : introducing operator attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
arakov committed Sep 26, 2016
1 parent f8e0ddb commit 5f164a9
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 226 deletions.
6 changes: 6 additions & 0 deletions doc/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ In development:
------

xrev
* enumlist(#265) : enum list class cannot create an instance of base class, but it should be possible to declare
constructors which will return one of its values, enum list cannot be directly inherited, only using symbols

* branching operator : check if the class is enum list, find its member with sealed true-if method
* constructor returning constant values,...

* make sure not embeddable object is not stack allocated
* check primitive comparision operation
* optimize unbox : root expression / assigning
Expand Down
98 changes: 49 additions & 49 deletions elenasrc2/elc/bcwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,10 @@ void ByteCodeWriter :: loadBase(CommandTape& tape, LexicalType sourceType, ref_t
// bloadfi 1
tape.write(bcBLoadFI, 1, bpFrame);
break;
// case lxStaticField:
// // bloadr ref
// tape.write(bcBLoadR, sourceArgument | mskStatSymbolRef);
// break;
case lxStaticField:
// bloadr ref
tape.write(bcBLoadR, sourceArgument | mskStatSymbolRef);
break;
}
}

Expand Down Expand Up @@ -1816,14 +1816,14 @@ void ByteCodeWriter :: assignInt(CommandTape& tape, LexicalType target, int offs
tape.write(bcALoadAI, offset);
tape.write(bcNCopyB);
}
//else if (target == lxStaticField) {
// // bcopya
// // aloadr param
// // ncopyb
// tape.write(bcBCopyA);
// tape.write(bcALoadR, offset | mskStatSymbolRef);
// tape.write(bcNCopyB);
//}
else if (target == lxStaticField) {
// bcopya
// aloadr param
// ncopyb
tape.write(bcBCopyA);
tape.write(bcALoadR, offset | mskStatSymbolRef);
tape.write(bcNCopyB);
}
}

void ByteCodeWriter :: assignShort(CommandTape& tape, LexicalType target, int offset)
Expand Down Expand Up @@ -1862,14 +1862,14 @@ void ByteCodeWriter :: assignShort(CommandTape& tape, LexicalType target, int of
tape.write(bcALoadAI, offset);
tape.write(bcNCopyB);
}
//else if (target == lxStaticField) {
// // bcopya
// // aloadr param
// // ncopyb
// tape.write(bcBCopyA);
// tape.write(bcALoadR, offset | mskStatSymbolRef);
// tape.write(bcNCopyB);
//}
else if (target == lxStaticField) {
// bcopya
// aloadr param
// ncopyb
tape.write(bcBCopyA);
tape.write(bcALoadR, offset | mskStatSymbolRef);
tape.write(bcNCopyB);
}
}

void ByteCodeWriter :: assignByte(CommandTape& tape, LexicalType target, int offset)
Expand Down Expand Up @@ -1909,14 +1909,14 @@ void ByteCodeWriter :: assignByte(CommandTape& tape, LexicalType target, int off
tape.write(bcALoadAI, offset);
tape.write(bcNCopyB);
}
//else if (target == lxStaticField) {
// // bcopya
// // aloadr param
// // ncopyb
// tape.write(bcBCopyA);
// tape.write(bcALoadR, offset | mskStatSymbolRef);
// tape.write(bcNCopyB);
//}
else if (target == lxStaticField) {
// bcopya
// aloadr param
// ncopyb
tape.write(bcBCopyA);
tape.write(bcALoadR, offset | mskStatSymbolRef);
tape.write(bcNCopyB);
}
}

void ByteCodeWriter :: assignLong(CommandTape& tape, LexicalType target, int offset)
Expand Down Expand Up @@ -1971,14 +1971,14 @@ void ByteCodeWriter :: assignLong(CommandTape& tape, LexicalType target, int off
tape.write(bcALoadAI, offset);
tape.write(bcLCopyB);
}
//else if (target == lxStaticField) {
// // bcopya
// // aloadr param
// // lcopyb
// tape.write(bcBCopyA);
// tape.write(bcALoadR, offset | mskStatSymbolRef);
// tape.write(bcLCopyB);
//}
else if (target == lxStaticField) {
// bcopya
// aloadr param
// lcopyb
tape.write(bcBCopyA);
tape.write(bcALoadR, offset | mskStatSymbolRef);
tape.write(bcLCopyB);
}
}

void ByteCodeWriter :: assignStruct(CommandTape& tape, LexicalType target, int offset, int size)
Expand Down Expand Up @@ -3126,11 +3126,11 @@ void ByteCodeWriter :: pushObject(CommandTape& tape, LexicalType type, ref_t arg
}
else tape.write(bcPushAI, argument);
break;
// case lxStaticField:
// // aloadr r
// // pusha
// tape.write(bcALoadR, argument | mskStatSymbolRef);
// break;
case lxStaticField:
// aloadr r
// pusha
tape.write(bcALoadR, argument | mskStatSymbolRef);
break;
// case lxBlockLocal:
// // pushfi index
// tape.write(bcPushFI, argument, bpBlock);
Expand Down Expand Up @@ -3207,10 +3207,10 @@ void ByteCodeWriter :: loadObject(CommandTape& tape, LexicalType type, ref_t arg
}
else tape.write(bcALoadBI, argument);
break;
// case lxStaticField:
// // aloadr r
// tape.write(bcALoadR, argument | mskStatSymbolRef);
// break;
case lxStaticField:
// aloadr r
tape.write(bcALoadR, argument | mskStatSymbolRef);
break;
case lxFieldAddress:
// aloadfi 1
tape.write(bcALoadFI, 1, bpFrame);
Expand Down Expand Up @@ -3259,10 +3259,10 @@ void ByteCodeWriter :: saveObject(CommandTape& tape, LexicalType type, ref_t arg
tape.write(bcBLoadFI, 1, bpFrame);
tape.write(bcASaveBI, argument);
break;
// case lxStaticField:
// // asaver arg
// tape.write(bcASaveR, argument | mskStatSymbolRef);
// break;
case lxStaticField:
// asaver arg
tape.write(bcASaveR, argument | mskStatSymbolRef);
break;
default:
break;
}
Expand Down
Loading

0 comments on commit 5f164a9

Please sign in to comment.