Avoid to add zero offset in BaseIndex.

https://bugs.webkit.org/show_bug.cgi?id=125215

Patch by László Langó <lango@inf.u-szeged.hu> on 2013-12-04
Reviewed by Michael Saboff.

When using cloop do not generate offsets additions for BaseIndex if the offset is zero.

* offlineasm/cloop.rb:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2b3238e7
2013-12-04 László Langó <lango@inf.u-szeged.hu>
Avoid to add zero offset in BaseIndex.
https://bugs.webkit.org/show_bug.cgi?id=125215
Reviewed by Michael Saboff.
When using cloop do not generate offsets additions for BaseIndex if the offset is zero.
* offlineasm/cloop.rb:
2013-12-04 Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Fix !ENABLE(JAVASCRIPT_DEBUGGER) build.
......
......@@ -261,7 +261,11 @@ class BaseIndex
end
end
def pointerExpr
"#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift}) + #{offset.clValue}"
if offset.value == 0
"#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift})"
else
"#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift}) + #{offset.clValue}"
end
end
def int8MemRef
"*CAST<int8_t*>(#{pointerExpr})"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment