Commit ea82d1c4 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

[counters]: solving endianness issue when API calls are made via the CallApiCallback builtin

Consistently using word sized loads on all architectures.

Original port: ea420655


Change-Id: I1083b977eb3c1688e67d68a69a9311bafbb52584
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1663994
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62259}
parent 63223901
......@@ -2844,7 +2844,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ cmp(r9, Operand(0));
__ b(ne, &profiler_enabled);
__ Move(r9, ExternalReference::address_of_runtime_stats_flag());
__ ldrb(r9, MemOperand(r9, 0));
__ ldr(r9, MemOperand(r9, 0));
__ cmp(r9, Operand(0));
__ b(ne, &profiler_enabled);
{
......
......@@ -3407,7 +3407,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ Ldrb(w10, MemOperand(x10));
__ Cbnz(w10, &profiler_enabled);
__ Mov(x10, ExternalReference::address_of_runtime_stats_flag());
__ Ldrb(w10, MemOperand(x10));
__ Ldrsw(w10, MemOperand(x10));
__ Cbnz(w10, &profiler_enabled);
{
// Call the api function directly.
......
......@@ -3025,7 +3025,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ cmpb(Operand(eax, 0), Immediate(0));
__ j(not_zero, &profiler_enabled);
__ Move(eax, Immediate(ExternalReference::address_of_runtime_stats_flag()));
__ cmpb(Operand(eax, 0), Immediate(0));
__ cmp(Operand(eax, 0), Immediate(0));
__ j(not_zero, &profiler_enabled);
{
// Call the api function directly.
......
......@@ -2835,7 +2835,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ lb(t9, MemOperand(t9, 0));
__ Branch(&profiler_enabled, ne, t9, Operand(zero_reg));
__ li(t9, ExternalReference::address_of_runtime_stats_flag());
__ lb(t9, MemOperand(t9, 0));
__ lw(t9, MemOperand(t9, 0));
__ Branch(&profiler_enabled, ne, t9, Operand(zero_reg));
{
// Call the api function directly.
......
......@@ -2875,7 +2875,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ Lb(t9, MemOperand(t9, 0));
__ Branch(&profiler_enabled, ne, t9, Operand(zero_reg));
__ li(t9, ExternalReference::address_of_runtime_stats_flag());
__ Lb(t9, MemOperand(t9, 0));
__ Lw(t9, MemOperand(t9, 0));
__ Branch(&profiler_enabled, ne, t9, Operand(zero_reg));
{
// Call the api function directly.
......
......@@ -2972,7 +2972,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
Label profiler_enabled, end_profiler_check;
__ bne(&profiler_enabled);
__ Move(scratch, ExternalReference::address_of_runtime_stats_flag());
__ lbz(scratch, MemOperand(scratch, 0));
__ lwz(scratch, MemOperand(scratch, 0));
__ cmpi(scratch, Operand::Zero());
__ bne(&profiler_enabled);
{
......
......@@ -3009,7 +3009,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
Label profiler_enabled, end_profiler_check;
__ bne(&profiler_enabled, Label::kNear);
__ Move(scratch, ExternalReference::address_of_runtime_stats_flag());
__ LoadlB(scratch, MemOperand(scratch, 0));
__ LoadlW(scratch, MemOperand(scratch, 0));
__ CmpP(scratch, Operand::Zero());
__ bne(&profiler_enabled, Label::kNear);
{
......
......@@ -3015,7 +3015,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ cmpb(Operand(rax, 0), Immediate(0));
__ j(not_zero, &profiler_enabled);
__ Move(rax, ExternalReference::address_of_runtime_stats_flag());
__ cmpb(Operand(rax, 0), Immediate(0));
__ cmpl(Operand(rax, 0), Immediate(0));
__ j(not_zero, &profiler_enabled);
{
// Call the api function directly.
......
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