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:
opCode = ARRAY_SET;
break;
case LENGTH:
case LEN:
opCode = ARRAY_LEN;
break;
default:

View File

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

View File

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

View File

@ -762,7 +762,7 @@ public class TextModuleWriter extends ModuleWriter {
case SET:
operation = "set";
break;
case LENGTH:
case LEN:
operation = "len";
break;
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");
you may not use this file except in compliance with the License.
@ -25,5 +25,5 @@ public enum ArrayOperator {
NEW,
GET,
SET,
LENGTH,
LEN,
}