Reviewers: danno, loislo, paul.l..., dusmil.imgtec, akos.palfi.imgtec, gergely.kis.imgtec,

Description:
MIPS64: CpuProfiler: fix for CollectDeoptEvents test.

Port a925f3f4784f8318f69a201a6b44aa94f97e4ba3

Original commit message:
The same idea as in https://codereview.chromium.org/984893003/

BUG=chromium:452067
LOG=n

Please review this at https://codereview.chromium.org/993233003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+25, -21 lines):
  M src/mips64/lithium-codegen-mips64.cc


Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index f392e6fffd92e124ccc3dcf9f09f028a73707a80..9e49fa11b3f2e7040f2e36d3d38621c832d7bc29 100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -303,7 +303,7 @@ bool LCodeGen::GenerateJumpTable() {
     Comment(";;; -------------------- Jump table --------------------");
   }
   Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
-  Label table_start;
+  Label table_start, call_deopt_entry;
   __ bind(&table_start);
   Label needs_frame;
   for (int i = 0; i < jump_table_.length(); i++) {
@@ -314,29 +314,33 @@ bool LCodeGen::GenerateJumpTable() {
     __ li(t9, Operand(ExternalReference::ForDeoptEntry(entry)));
     if (table_entry->needs_frame) {
       DCHECK(!info()->saves_caller_doubles());
-      if (needs_frame.is_bound()) {
-        __ Branch(&needs_frame);
-      } else {
-        __ bind(&needs_frame);
-        __ MultiPush(cp.bit() | fp.bit() | ra.bit());
- // This variant of deopt can only be used with stubs. Since we don't
-        // have a function pointer to install in the stack frame that we're
-        // building, install a special marker there instead.
-        DCHECK(info()->IsStub());
-        __ li(scratch0(), Operand(Smi::FromInt(StackFrame::STUB)));
-        __ push(scratch0());
-        __ Daddu(fp, sp,
-            Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
-        __ Call(t9);
-      }
+      Comment(";;; call deopt with frame");
+      __ MultiPush(cp.bit() | fp.bit() | ra.bit());
+      __ Call(&needs_frame);
     } else {
-      if (info()->saves_caller_doubles()) {
-        DCHECK(info()->IsStub());
-        RestoreCallerDoubles();
-      }
-      __ Call(t9);
+      __ Call(&call_deopt_entry);
     }
   }
+  if (needs_frame.is_linked()) {
+    __ bind(&needs_frame);
+    // This variant of deopt can only be used with stubs. Since we don't
+    // have a function pointer to install in the stack frame that we're
+    // building, install a special marker there instead.
+    DCHECK(info()->IsStub());
+    __ li(at, Operand(Smi::FromInt(StackFrame::STUB)));
+    __ push(at);
+ __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
+  }
+
+  Comment(";;; call deopt");
+  __ bind(&call_deopt_entry);
+
+  if (info()->saves_caller_doubles()) {
+    DCHECK(info()->IsStub());
+    RestoreCallerDoubles();
+  }
+  __ Jump(t9);
+
   __ RecordComment("]");

   // The deoptimization jump table is the last part of the instruction


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to