Reviewers: danno,

Message:
Hello, Daniel.
For the comments in lithim-ia32.h:

If I use BitField to represent both is_call and position value, which type
should be used to define the whole data? because the "position"
is int. And if I define one int to represent this two value, it will report
error. If we define it as "long", is it too big?


Description:
Patch to enhance the source code line information for profiler.

This patch is to enhance the source code line information for profiler.

For the Hydrogen compilation, most of the source code line information
is not copied from the HInstruction the to corresponding LInstruction.

This patch defines the position_ field of LInstruction and copies the
sorce code position value from the HInstruction.

When Generating the native code, we use RecordPosition(..) function to
write LInstruction's position value to position recorder.

For the MIPS and arm platform, I did not touch because I have no devices
to verify the modification on it.

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

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/ia32/lithium-codegen-ia32.cc
  M     src/ia32/lithium-ia32.h
  M     src/ia32/lithium-ia32.cc
  M     src/x64/lithium-codegen-x64.cc
  M     src/x64/lithium-x64.h
  M     src/x64/lithium-x64.cc


Index: src/ia32/lithium-codegen-ia32.cc
===================================================================
--- src/ia32/lithium-codegen-ia32.cc    (revision 15925)
+++ src/ia32/lithium-codegen-ia32.cc    (working copy)
@@ -350,6 +350,9 @@

     if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr);

+    int pos = instr->position();
+    if (pos >= 0) RecordPosition(pos);
+
     instr->CompileToNative(this);

     if (!CpuFeatures::IsSupported(SSE2)) {
Index: src/ia32/lithium-ia32.cc
===================================================================
--- src/ia32/lithium-ia32.cc    (revision 15925)
+++ src/ia32/lithium-ia32.cc    (working copy)
@@ -956,6 +956,8 @@
     }
 #endif

+    instr->set_position(position_);
+
     if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
       instr = AssignPointerMap(instr);
     }
Index: src/ia32/lithium-ia32.h
===================================================================
--- src/ia32/lithium-ia32.h     (revision 15925)
+++ src/ia32/lithium-ia32.h     (working copy)
@@ -212,7 +212,8 @@
   LInstruction()
       : environment_(NULL),
         hydrogen_value_(NULL),
-        is_call_(false) { }
+        is_call_(false),
+        position_(RelocInfo::kNoPosition) { }
   virtual ~LInstruction() { }

   virtual void CompileToNative(LCodeGen* generator) = 0;
@@ -251,6 +252,8 @@
   LPointerMap* pointer_map() const { return pointer_map_.get(); }
   bool HasPointerMap() const { return pointer_map_.is_set(); }

+  void set_position(int pos) { position_ = pos; }
+  int position() { return position_; }

   void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
   HValue* hydrogen_value() const { return hydrogen_value_; }
@@ -300,6 +303,7 @@
   SetOncePointer<LPointerMap> pointer_map_;
   HValue* hydrogen_value_;
   bool is_call_;
+  int position_;
 };


Index: src/x64/lithium-codegen-x64.cc
===================================================================
--- src/x64/lithium-codegen-x64.cc      (revision 15927)
+++ src/x64/lithium-codegen-x64.cc      (working copy)
@@ -273,6 +273,9 @@
               instr->Mnemonic());
     }

+    int pos = instr->position();
+    if (pos >= 0) RecordPosition(pos);
+
     instr->CompileToNative(this);
   }
   EnsureSpaceForLazyDeopt(Deoptimizer::patch_size());
Index: src/x64/lithium-x64.cc
===================================================================
--- src/x64/lithium-x64.cc      (revision 15927)
+++ src/x64/lithium-x64.cc      (working copy)
@@ -900,6 +900,8 @@
     }
 #endif

+    instr->set_position(position_);
+
     if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
       instr = AssignPointerMap(instr);
     }
Index: src/x64/lithium-x64.h
===================================================================
--- src/x64/lithium-x64.h       (revision 15927)
+++ src/x64/lithium-x64.h       (working copy)
@@ -210,7 +210,8 @@
   LInstruction()
       :  environment_(NULL),
          hydrogen_value_(NULL),
-         is_call_(false) { }
+         is_call_(false),
+         position_(RelocInfo::kNoPosition) { }

   virtual ~LInstruction() { }

@@ -250,6 +251,9 @@
   LPointerMap* pointer_map() const { return pointer_map_.get(); }
   bool HasPointerMap() const { return pointer_map_.is_set(); }

+  void set_position(int pos) { position_ = pos; }
+  int position() { return position_; }
+
   void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
   HValue* hydrogen_value() const { return hydrogen_value_; }

@@ -291,6 +295,7 @@
   SetOncePointer<LPointerMap> pointer_map_;
   HValue* hydrogen_value_;
   bool is_call_;
+  int position_;
 };




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