Revision: 3111
Author: [email protected]
Date: Thu Oct 22 04:21:29 2009
Log: Add --trace flag to fast compiler.
Review URL: http://codereview.chromium.org/306026
http://code.google.com/p/v8/source/detail?r=3111

Modified:
  /branches/bleeding_edge/src/arm/fast-codegen-arm.cc
  /branches/bleeding_edge/src/ia32/fast-codegen-ia32.cc
  /branches/bleeding_edge/src/x64/fast-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/fast-codegen-arm.cc Thu Oct 22 03:07:45  
2009
+++ /branches/bleeding_edge/src/arm/fast-codegen-arm.cc Thu Oct 22 04:21:29  
2009
@@ -89,6 +89,10 @@
    { Comment cmnt(masm_, "[ Declarations");
      VisitDeclarations(fun->scope()->declarations());
    }
+
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }

    { Comment cmnt(masm_, "[ Body");
      VisitStatements(fun->body());
@@ -99,6 +103,13 @@
      // body.
      __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
      SetReturnPosition(fun);
+    if (FLAG_trace) {
+      // Push the return value on the stack as the parameter.
+      // Runtime::TraceExit returns its parameter in r0.
+      __ push(r0);
+      __ CallRuntime(Runtime::kTraceExit, 1);
+    }
+
      __ RecordJSReturn();
      __ mov(sp, fp);
      __ ldm(ia_w, sp, fp.bit() | lr.bit());
@@ -150,6 +161,14 @@
      ASSERT(expr->AsLiteral() != NULL);
      __ mov(r0, Operand(expr->AsLiteral()->handle()));
    }
+
+  if (FLAG_trace) {
+    // Push the return value on the stack as the parameter.
+    // Runtime::TraceExit returns its parameter in r0.
+    __ push(r0);
+    __ CallRuntime(Runtime::kTraceExit, 1);
+  }
+
    __ RecordJSReturn();
    __ mov(sp, fp);
    __ ldm(ia_w, sp, fp.bit() | lr.bit());
=======================================
--- /branches/bleeding_edge/src/ia32/fast-codegen-ia32.cc       Thu Oct 22  
03:07:45 2009
+++ /branches/bleeding_edge/src/ia32/fast-codegen-ia32.cc       Thu Oct 22  
04:21:29 2009
@@ -79,6 +79,10 @@
    { Comment cmnt(masm_, "[ Declarations");
      VisitDeclarations(fun->scope()->declarations());
    }
+
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }

    { Comment cmnt(masm_, "[ Body");
      VisitStatements(fun->body());
@@ -89,6 +93,11 @@
      // body.
      __ mov(eax, Factory::undefined_value());
      SetReturnPosition(fun);
+
+    if (FLAG_trace) {
+      __ push(eax);
+      __ CallRuntime(Runtime::kTraceExit, 1);
+    }
      __ RecordJSReturn();
      // Do not use the leave instruction here because it is too short to
      // patch with the code required by the debugger.
@@ -139,7 +148,12 @@
      ASSERT(expr->AsLiteral() != NULL);
      __ mov(eax, expr->AsLiteral()->handle());
    }
+  if (FLAG_trace) {
+    __ push(eax);
+    __ CallRuntime(Runtime::kTraceExit, 1);
+  }
    __ RecordJSReturn();
+
    // Do not use the leave instruction here because it is too short to
    // patch with the code required by the debugger.
    __ mov(esp, ebp);
=======================================
--- /branches/bleeding_edge/src/x64/fast-codegen-x64.cc Thu Oct 22 03:07:45  
2009
+++ /branches/bleeding_edge/src/x64/fast-codegen-x64.cc Thu Oct 22 04:21:29  
2009
@@ -78,6 +78,10 @@
    { Comment cmnt(masm_, "[ Declarations");
      VisitDeclarations(fun->scope()->declarations());
    }
+
+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }

    { Comment cmnt(masm_, "[ Body");
      VisitStatements(fun->body());
@@ -88,7 +92,12 @@
      // body.
      __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
      SetReturnPosition(fun);
+    if (FLAG_trace) {
+      __ push(rax);
+      __ CallRuntime(Runtime::kTraceExit, 1);
+    }
      __ RecordJSReturn();
+
      // Do not use the leave instruction here because it is too short to
      // patch with the code required by the debugger.
      __ movq(rsp, rbp);
@@ -147,6 +156,11 @@
      ASSERT(expr->AsLiteral() != NULL);
      __ Move(rax, expr->AsLiteral()->handle());
    }
+  if (FLAG_trace) {
+    __ push(rax);
+    __ CallRuntime(Runtime::kTraceExit, 1);
+  }
+
    __ RecordJSReturn();
    // Do not use the leave instruction here because it is too short to
    // patch with the code required by the debugger.

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to