rename ArrayOpertion.LENGTH -> LEN for more consistency

This commit is contained in:
Volker Berlin 2019-08-11 13:06:31 +02:00
parent 3058348787
commit 7667c1a080
5 changed files with 7 additions and 7 deletions

View File

@ -1276,7 +1276,7 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
case SET: case SET:
opCode = ARRAY_SET; opCode = ARRAY_SET;
break; break;
case LENGTH: case LEN:
opCode = ARRAY_LEN; opCode = ARRAY_LEN;
break; break;
default: default:

View File

@ -643,7 +643,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
addArrayInstruction( ArrayOperator.NEW, type, codePos, lineNumber ); addArrayInstruction( ArrayOperator.NEW, type, codePos, lineNumber );
break; break;
case 190: // arraylength case 190: // arraylength
addArrayInstruction( ArrayOperator.LENGTH, ValueType.i32, codePos, lineNumber ); addArrayInstruction( ArrayOperator.LEN, ValueType.i32, codePos, lineNumber );
break; break;
case 191: // athrow case 191: // athrow
addBlockInstruction( WasmBlockOperator.THROW, null, codePos, lineNumber ); addBlockInstruction( WasmBlockOperator.THROW, null, codePos, lineNumber );

View File

@ -82,7 +82,7 @@ class WasmArrayInstruction extends WasmInstruction {
return type instanceof ValueType ? (ValueType)type : ValueType.anyref; return type instanceof ValueType ? (ValueType)type : ValueType.anyref;
case SET: case SET:
return null; return null;
case LENGTH: case LEN:
return ValueType.i32; return ValueType.i32;
default: default:
throw new WasmException( "Unknown array operation: " + op, -1 ); throw new WasmException( "Unknown array operation: " + op, -1 );
@ -98,7 +98,7 @@ class WasmArrayInstruction extends WasmInstruction {
case NEW: case NEW:
case GET: case GET:
return 2; return 2;
case LENGTH: case LEN:
return 1; return 1;
case SET: case SET:
return 3; return 3;

View File

@ -762,7 +762,7 @@ public class TextModuleWriter extends ModuleWriter {
case SET: case SET:
operation = "set"; operation = "set";
break; break;
case LENGTH: case LEN:
operation = "len"; operation = "len";
break; break;
default: default:

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2018 Volker Berlin (i-net software) Copyright 2018 - 2019 Volker Berlin (i-net software)
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -25,5 +25,5 @@ public enum ArrayOperator {
NEW, NEW,
GET, GET,
SET, SET,
LENGTH, LEN,
} }