From 02d9f159c96f46730c6a2f472521b11ec537a26c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 Nov 2015 20:27:16 -0800 Subject: detect minified fround --- src/emscripten-optimizer/optimizer-shared.cpp | 8 ++++---- src/emscripten-optimizer/optimizer.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/emscripten-optimizer') diff --git a/src/emscripten-optimizer/optimizer-shared.cpp b/src/emscripten-optimizer/optimizer-shared.cpp index ae346d756..e37408b19 100644 --- a/src/emscripten-optimizer/optimizer-shared.cpp +++ b/src/emscripten-optimizer/optimizer-shared.cpp @@ -129,7 +129,7 @@ static void abort_on(Ref node) { abort(); } -AsmSign detectSign(Ref node) { +AsmSign detectSign(Ref node, IString minifiedFround) { IString type = node[0]->getIString(); if (type == BINARY) { IString op = node[1]->getIString(); @@ -160,11 +160,11 @@ AsmSign detectSign(Ref node) { } else if (type == NAME) { return ASM_FLEXIBLE; } else if (type == CONDITIONAL) { - return detectSign(node[2]); + return detectSign(node[2], minifiedFround); } else if (type == CALL) { - if (node[1][0] == NAME && node[1][1] == MATH_FROUND) return ASM_NONSIGNED; + if (node[1][0] == NAME && (node[1][1] == MATH_FROUND || node[1][1] == minifiedFround)) return ASM_NONSIGNED; } else if (type == SEQ) { - return detectSign(node[2]); + return detectSign(node[2], minifiedFround); } abort_on(node); abort(); // avoid warning diff --git a/src/emscripten-optimizer/optimizer.h b/src/emscripten-optimizer/optimizer.h index fe1c18770..4720909a5 100644 --- a/src/emscripten-optimizer/optimizer.h +++ b/src/emscripten-optimizer/optimizer.h @@ -130,7 +130,7 @@ enum AsmSign { ASM_NONSIGNED = 3, }; -extern AsmSign detectSign(cashew::Ref node); +extern AsmSign detectSign(cashew::Ref node, cashew::IString minifiedFround); #endif // __optimizer_h__ -- cgit v1.2.3