summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 13:01:17 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-14 13:15:12 -0400
commit17774c46a470dbcd35c9efd2c730acb396dc6539 (patch)
tree09528835ed4a8cd7231afaee41f29f78e37492ec /sc
parentffa18f56511a91294a3f45bdee9767595e8c03f5 (diff)
Disable jump command reordering of RPN tokens for OpenCL interpreter.
Change-Id: I03e1e8a8cda1ff88b1d65876ffc27605090f1f4d
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/data/grouptokenconverter.cxx4
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx14
3 files changed, 9 insertions, 11 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 0c2755bb132f..78c847e69aa1 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3678,6 +3678,8 @@ bool ScFormulaCell::InterpretFormulaGroup()
return false;
}
+ // The converted code does not have RPN tokens yet. The interpreter will
+ // generate them.
mxGroup->meCalcState = sc::GroupCalcRunning;
if (!sc::FormulaGroupInterpreter::getStatic()->interpret(*pDocument, mxGroup->mpTopCell->aPos, mxGroup, aCode))
{
diff --git a/sc/source/core/data/grouptokenconverter.cxx b/sc/source/core/data/grouptokenconverter.cxx
index 47585fd67619..a43efb05aa31 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -226,10 +226,6 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
}
}
- ScCompiler aComp(&mrDoc, mrPos, mrGroupTokens);
- aComp.SetGrammar(mrDoc.GetGrammar());
- aComp.CompileTokenArray(); // Regenerate RPN tokens.
-
return true;
}
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index d4873b64ef28..7066c4fc3ba8 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3433,20 +3433,20 @@ CompiledFormula* FormulaGroupInterpreterOpenCL::createCompiledFormula(ScDocument
ScFormulaCellGroup& rGroup,
ScTokenArray& rCode)
{
- ScTokenArray aConvertedCode;
- ScGroupTokenConverter aConverter(aConvertedCode, rDoc, *rGroup.mpTopCell, rTopPos);
- if (!aConverter.convert(rCode) || aConvertedCode.GetLen() == 0)
- return NULL;
-
SymbolTable::nR = rGroup.mnLength;
-
- return DynamicKernel::create(rDoc, rTopPos, aConvertedCode);
+ return DynamicKernel::create(rDoc, rTopPos, rCode);
}
bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
const ScAddress& rTopPos, ScFormulaCellGroupRef& xGroup,
ScTokenArray& rCode )
{
+ ScCompiler aComp(&rDoc, rTopPos, rCode);
+ aComp.SetGrammar(rDoc.GetGrammar());
+ // Disable special ordering for jump commands for the OpenCL interpreter.
+ aComp.EnableJumpCommandReorder(false);
+ aComp.CompileTokenArray(); // Regenerate RPN tokens.
+
DynamicKernel *pKernel = NULL;
boost::scoped_ptr<DynamicKernel> pLocalKernel;