PPC64: Fix return value checks for generated regexp code.
authormichael_dawson <michael_dawson@ca.ibm.com>
Fri, 27 Mar 2015 13:30:31 +0000 (06:30 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 27 Mar 2015 13:30:45 +0000 (13:30 +0000)
This fixes simulated debug-mode failures in the following tests:
  mjsunit/regexp-stack-overflow
  mjsunit/regress/regress-crbug-467047

R=mbrandy@us.ibm.com

BUG=

Review URL: https://codereview.chromium.org/1035003002

Cr-Commit-Position: refs/heads/master@{#27500}

src/ppc/code-stubs-ppc.cc

index 729bc61a9758544820232e814554ca5acfd47547..e03741e5571537b25facaba3e6da6cddb198d374 100644 (file)
@@ -2365,20 +2365,20 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
 
   __ LeaveExitFrame(false, no_reg, true);
 
-  // r3: result
+  // r3: result (int32)
   // subject: subject string (callee saved)
   // regexp_data: RegExp data (callee saved)
   // last_match_info_elements: Last match info elements (callee saved)
   // Check the result.
   Label success;
-  __ cmpi(r3, Operand(1));
+  __ cmpwi(r3, Operand(1));
   // We expect exactly one result since we force the called regexp to behave
   // as non-global.
   __ beq(&success);
   Label failure;
-  __ cmpi(r3, Operand(NativeRegExpMacroAssembler::FAILURE));
+  __ cmpwi(r3, Operand(NativeRegExpMacroAssembler::FAILURE));
   __ beq(&failure);
-  __ cmpi(r3, Operand(NativeRegExpMacroAssembler::EXCEPTION));
+  __ cmpwi(r3, Operand(NativeRegExpMacroAssembler::EXCEPTION));
   // If not exception it can only be retry. Handle that in the runtime system.
   __ bne(&runtime);
   // Result must now be exception. If there is no pending exception already a