mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-28 11:01:15 +00:00
small improvements, little bit faster decompilation by caching the number values of the strings
This commit is contained in:
+1
-2
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -52,7 +51,7 @@ public class AsciiToCharActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
int res = (int) (double) (EcmaScript.toNumber(value.getResult()));
|
||||
int res = (int) (double) (value.getResultAsNumber());
|
||||
if (res == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionDecrement;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -62,7 +62,7 @@ public class DecrementActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(object.getResult()) - 1;
|
||||
return object.getResultAsNumber() - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionIncrement;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -62,7 +62,7 @@ public class IncrementActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(object.getResult()) + 1;
|
||||
return object.getResultAsNumber() + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -52,7 +51,7 @@ public class MBAsciiToCharActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
int res = (int) (double) (EcmaScript.toNumber(value.getResult()));
|
||||
int res = (int) (double) (value.getResultAsNumber());
|
||||
if (res == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
+1
-2
@@ -27,7 +27,6 @@ import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionDecrement;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -63,7 +62,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(object.getResult());
|
||||
return object.getResultAsNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -27,7 +27,6 @@ import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionIncrement;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -63,7 +62,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(object.getResult());
|
||||
return object.getResultAsNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionStartDrag;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -59,7 +58,7 @@ public class StartDragActionItem extends ActionItem {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
boolean hasConstrains = true;
|
||||
if (constrain instanceof DirectValueActionItem) {
|
||||
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
|
||||
if (Double.compare(constrain.getResultAsNumber(), 0) == 0) {
|
||||
hasConstrains = false;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +97,7 @@ public class StartDragActionItem extends ActionItem {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
boolean hasConstrains = true;
|
||||
if (constrain instanceof DirectValueActionItem) {
|
||||
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
|
||||
if (Double.compare(constrain.getResultAsNumber(), 0) == 0) {
|
||||
hasConstrains = false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionToInteger;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -52,7 +51,7 @@ public class ToIntegerActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return Math.round(EcmaScript.toNumber(value.getResult()));
|
||||
return Math.round(value.getResultAsNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionToNumber;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -52,7 +51,7 @@ public class ToNumberActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(value.getResult());
|
||||
return value.getResultAsNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,7 +34,7 @@ public class BitAndActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return ((long) (double) EcmaScript.toNumber(leftSide.getResult())) & ((long) (double) EcmaScript.toNumber(rightSide.getResult()));
|
||||
return ((long) (double) leftSide.getResultAsNumber()) & ((long) (double) rightSide.getResultAsNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitOr;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,7 +34,7 @@ public class BitOrActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return ((long) (double) EcmaScript.toNumber(leftSide.getResult())) | ((long) (double) EcmaScript.toNumber(rightSide.getResult()));
|
||||
return ((long) (double) leftSide.getResultAsNumber()) | ((long) (double) rightSide.getResultAsNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitXor;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -37,7 +37,7 @@ public class BitXorActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return ((long) (double) EcmaScript.toNumber(leftSide.getResult())) ^ ((long) (double) EcmaScript.toNumber(rightSide.getResult()));
|
||||
return ((long) (double) leftSide.getResultAsNumber()) ^ ((long) (double) rightSide.getResultAsNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionDivide;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -35,8 +34,8 @@ public class DivideActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
Double leftResult = EcmaScript.toNumber(leftSide.getResult());
|
||||
Double rightResult = EcmaScript.toNumber(rightSide.getResult());
|
||||
Double leftResult = leftSide.getResultAsNumber();
|
||||
Double rightResult = rightSide.getResultAsNumber();
|
||||
if (Double.compare(rightResult, 0) == 0) {
|
||||
return leftResult < 0 ? Double.NEGATIVE_INFINITY
|
||||
: leftResult > 0 ? Double.POSITIVE_INFINITY : Double.NaN;
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,7 +34,7 @@ public class LShiftActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return ((int) (double) EcmaScript.toNumber(leftSide.getResult())) << ((int) (double) EcmaScript.toNumber(rightSide.getResult()));
|
||||
return ((int) (double) leftSide.getResultAsNumber()) << ((int) (double) rightSide.getResultAsNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionModulo;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -35,11 +34,11 @@ public class ModuloActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
Double rightResult = EcmaScript.toNumber(rightSide.getResult());
|
||||
Double rightResult = rightSide.getResultAsNumber();
|
||||
if (Double.isNaN(rightResult) || Double.compare(rightResult, 0) == 0) {
|
||||
return Double.NaN;
|
||||
}
|
||||
return ((long) (double) EcmaScript.toNumber(leftSide.getResult())) % ((long) (double) rightResult);
|
||||
return ((long) (double) leftSide.getResultAsNumber()) % ((long) (double) rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionMultiply;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,7 +34,7 @@ public class MultiplyActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return (EcmaScript.toNumber(leftSide.getResult())) * (EcmaScript.toNumber(rightSide.getResult()));
|
||||
return leftSide.getResultAsNumber() * rightSide.getResultAsNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-5
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
@@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionDecrement;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -47,7 +46,7 @@ public class PreDecrementActionItem extends UnaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(value.getResult()) - 1;
|
||||
return value.getResultAsNumber() - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-5
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
@@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionIncrement;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -47,7 +46,7 @@ public class PreIncrementActionItem extends UnaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(value.getResult()) + 1;
|
||||
return value.getResultAsNumber() + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -35,8 +34,8 @@ public class RShiftActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
long rightResult = ((long) (double) EcmaScript.toNumber(rightSide.getResult())) & 0x1f;
|
||||
return ((long) (double) EcmaScript.toNumber(leftSide.getResult())) >> rightResult;
|
||||
long rightResult = ((long) (double) rightSide.getResultAsNumber()) & 0x1f;
|
||||
return ((long) (double) leftSide.getResultAsNumber()) >> rightResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.␍ */
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionSubtract;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -37,7 +37,7 @@ public class SubtractActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return EcmaScript.toNumber(leftSide.getResult()) - EcmaScript.toNumber(rightSide.getResult());
|
||||
return leftSide.getResultAsNumber() - rightSide.getResultAsNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitURShift;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -35,8 +34,8 @@ public class URShiftActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
long leftResult = ((long) (double) EcmaScript.toNumber(leftSide.getResult())) & 0xffffffffL;
|
||||
long rightResult = ((long) (double) EcmaScript.toNumber(rightSide.getResult())) & 0x1f;
|
||||
long leftResult = ((long) (double) leftSide.getResultAsNumber()) & 0xffffffffL;
|
||||
long rightResult = ((long) (double) rightSide.getResultAsNumber()) & 0x1f;
|
||||
return leftResult >>> rightResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.BaseLocalData;
|
||||
import com.jpexs.decompiler.flash.action.Action;
|
||||
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
|
||||
import com.jpexs.decompiler.flash.action.model.StartDragActionItem;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
@@ -45,7 +44,7 @@ public class ActionStartDrag extends Action {
|
||||
|
||||
boolean hasConstrains = true;
|
||||
if (constrain instanceof DirectValueActionItem) {
|
||||
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
|
||||
if (Double.compare(constrain.getResultAsNumber(), 0) == 0) {
|
||||
hasConstrains = false;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +69,7 @@ public class ActionStartDrag extends Action {
|
||||
GraphTargetItem constrain = stack.peek(3);
|
||||
boolean hasConstrains = true;
|
||||
if (constrain instanceof DirectValueActionItem) {
|
||||
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
|
||||
if (Double.compare(constrain.getResultAsNumber(), 0) == 0) {
|
||||
hasConstrains = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user