Revision: 14880
Author:   [email protected]
Date:     Wed May 29 05:09:03 2013
Log:      Fix two CPU profiler tests on ARM and MIPS simulators

Use Simulator::get_pc instead of Simulator::get_register(pc) as the latter
will return value adjusted by Instruction::kPCReadOffset.

BUG=v8:2628
[email protected], [email protected]

Review URL: https://codereview.chromium.org/16154004
http://code.google.com/p/v8/source/detail?r=14880

Modified:
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/sampler.cc
 /branches/bleeding_edge/test/cctest/cctest.status

=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed May 29 03:47:55 2013 +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed May 29 05:09:03 2013
@@ -181,6 +181,7 @@
       __ add(fp, sp, Operand(2 * kPointerSize));
     }
     frame_is_built_ = true;
+    info_->AddNoFrameRange(0, masm_->pc_offset());
   }

   // Reserve space for the stack slots needed by the code.
@@ -2951,8 +2952,8 @@
   int no_frame_start = -1;
   if (NeedsEagerFrame()) {
     __ mov(sp, fp);
+    no_frame_start = masm_->pc_offset();
     __ ldm(ia_w, sp, fp.bit() | lr.bit());
-    no_frame_start = masm_->pc_offset();
   }
   if (instr->has_constant_parameter_count()) {
     int parameter_count = ToInteger32(instr->constant_parameter_count());
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue May 28 14:37:57 2013 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed May 29 05:09:03 2013
@@ -2584,8 +2584,8 @@
   int no_frame_start = -1;
   if (NeedsEagerFrame()) {
     __ mov(sp, fp);
-    __ Pop(ra, fp);
     no_frame_start = masm_->pc_offset();
+    __ Pop(ra, fp);
   }
   if (instr->has_constant_parameter_count()) {
     int parameter_count = ToInteger32(instr->constant_parameter_count());
=======================================
--- /branches/bleeding_edge/src/sampler.cc      Tue Apr 30 04:34:43 2013
+++ /branches/bleeding_edge/src/sampler.cc      Wed May 29 05:09:03 2013
@@ -234,13 +234,11 @@
   if (sample == NULL) sample = &sample_obj;

 #if defined(USE_SIMULATOR)
+  sample->pc = reinterpret_cast<Address>(sim->get_pc());
+  sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
 #if V8_TARGET_ARCH_ARM
-  sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc));
-  sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::r11));
 #elif V8_TARGET_ARCH_MIPS
-  sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc));
-  sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
   sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::fp));
 #endif  // V8_TARGET_ARCH_*
 #else
@@ -523,13 +521,11 @@
                          &count) == KERN_SUCCESS) {
       sample->state = isolate->current_vm_state();
 #if defined(USE_SIMULATOR)
-#if V8_TARGET_ARCH_ARM
- sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc));
+      sample->pc = reinterpret_cast<Address>(sim->get_pc());
sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
+#if V8_TARGET_ARCH_ARM
sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::r11));
 #elif V8_TARGET_ARCH_MIPS
- sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc)); - sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp)); sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::fp));
 #endif
 #else
@@ -577,13 +573,11 @@
     context.ContextFlags = CONTEXT_FULL;
     if (GetThreadContext(profiled_thread, &context) != 0) {
 #if defined(USE_SIMULATOR)
+      sample->pc = reinterpret_cast<Address>(sim->get_pc());
+ sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
 #if V8_TARGET_ARCH_ARM
- sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc)); - sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp)); sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::r11));
 #elif V8_TARGET_ARCH_MIPS
- sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc)); - sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp)); sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::fp));
 #endif
 #else
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.status Tue May 28 01:36:17 2013 +++ /branches/bleeding_edge/test/cctest/cctest.status Wed May 29 05:09:03 2013
@@ -69,15 +69,6 @@
 test-serialize/DeserializeAndRunScript2: SKIP
 test-serialize/DeserializeFromSecondSerialization: SKIP

-##############################################################################
-[ $arch == arm || $arch == mipsel ]
-
-# BUG(2628): Signal may come when pc is close to frame enter/exit code and on -# simulator the stack frame is not set up when it is expected to be for the pc
-# value.
-test-cpu-profiler/CollectCpuProfile: PASS || FAIL
-test-cpu-profiler/SampleWhenFrameIsNotSetup: PASS || FAIL
-
##############################################################################
 [ $arch == android_arm || $arch == android_ia32 ]

--
--
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/groups/opt_out.


Reply via email to