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

Consistently using word sized loads on all architectures.

Original port: ea4206556e


Change-Id: I1083b977eb3c1688e67d68a69a9311bafbb52584
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1663994
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62259}
This commit is contained in:
Milad Farazmand 2019-06-18 13:40:27 -04:00 committed by Commit Bot
parent 632239011d
commit ea82d1c4a5
8 changed files with 8 additions and 8 deletions

View File

@ -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);
{

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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);
{

View File

@ -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);
{

View File

@ -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.