|
|
Created:
4 years, 1 month ago by ivica.bogosavljevic Modified:
4 years, 1 month ago CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
DescriptionMIPS64: Fix VirtualObject field offset calculation on Big-endian architectures
If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it
on little endian architectures we will access to lower 4 bytes of the field using the same
base address as accessing the whole eight bytes
On big-endian architectures however we use base address to access the full 8 bytes, but base
address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess
fails on MIPS64 big endian.
We fix the issue by removing the assert that checks that offset is pointer size aligned.
TEST=mjsunit/regress/regress-crbug-648737
BUG=
Committed: https://crrev.com/848524756b555045f116a5e1fdb4d9feeef02562
Cr-Commit-Position: refs/heads/master@{#40772}
Patch Set 1 #Patch Set 2 : Add DCHECK for big-endian #
Total comments: 2
Patch Set 3 : Address code reveiw remarks #Messages
Total messages: 21 (11 generated)
Description was changed from ========== MIPS64: Fix If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737.js BUG= ========== to ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737.js BUG= ==========
ivica.bogosavljevic@imgtec.com changed reviewers: + jarin@chromium.org, mstarzinger@chromium.org
PTAL
Description was changed from ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737.js BUG= ========== to ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737 BUG= ==========
Reminder...
ivica.bogosavljevic@imgtec.com changed reviewers: + titzer@chromium.org
https://codereview.chromium.org/2453333002/diff/20001/src/compiler/escape-ana... File src/compiler/escape-analysis.cc (right): https://codereview.chromium.org/2453333002/diff/20001/src/compiler/escape-ana... src/compiler/escape-analysis.cc:1417: FieldAccessOf(node->op()).offset % kPointerSize == 0) { It seems this implies that the above predicate fails "more often" on big endian as well. I think this predicate and the above assert should be kept in sync. Can we hoist out the modulus computation into a {OffsetCanBePointerCoerced(int)} or similar so that we can use it in the DCHECK above as well as here?
https://codereview.chromium.org/2453333002/diff/20001/src/compiler/escape-ana... File src/compiler/escape-analysis.cc (right): https://codereview.chromium.org/2453333002/diff/20001/src/compiler/escape-ana... src/compiler/escape-analysis.cc:1417: FieldAccessOf(node->op()).offset % kPointerSize == 0) { On 2016/11/03 14:29:55, Michael Starzinger wrote: > It seems this implies that the above predicate fails "more often" on big endian > as well. I think this predicate and the above assert should be kept in sync. Can > we hoist out the modulus computation into a {OffsetCanBePointerCoerced(int)} or > similar so that we can use it in the DCHECK above as well as here? This is certainly true, but no tests are failing because of this. I will update the code according to your remarks and rerun the tests.
PTAL
LGTM. Thanks!
The CQ bit was checked by ivica.bogosavljevic@imgtec.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ivica.bogosavljevic@imgtec.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737 BUG= ========== to ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737 BUG= ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737 BUG= ========== to ========== MIPS64: Fix VirtualObject field offset calculation on Big-endian architectures If a HeapObject field is 8 bytes long and 8 bytes aligned, but we use only four bytes of it on little endian architectures we will access to lower 4 bytes of the field using the same base address as accessing the whole eight bytes On big-endian architectures however we use base address to access the full 8 bytes, but base address + 4 to access to lower 4 bytes. For this reason, the assert in OffsetForFieldAccess fails on MIPS64 big endian. We fix the issue by removing the assert that checks that offset is pointer size aligned. TEST=mjsunit/regress/regress-crbug-648737 BUG= Committed: https://crrev.com/848524756b555045f116a5e1fdb4d9feeef02562 Cr-Commit-Position: refs/heads/master@{#40772} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/848524756b555045f116a5e1fdb4d9feeef02562 Cr-Commit-Position: refs/heads/master@{#40772} |