Reviewers: Kevin Millikin,

Description:
Add --trace flag to fast compiler.

Please review this at http://codereview.chromium.org/306026

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

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


Index: src/ia32/fast-codegen-ia32.cc
===================================================================
--- src/ia32/fast-codegen-ia32.cc       (revision 3101)
+++ src/ia32/fast-codegen-ia32.cc       (working copy)
@@ -79,6 +79,10 @@
      VisitDeclarations(fun->scope()->declarations());
    }

+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+
    { Comment cmnt(masm_, "[ Body");
      VisitStatements(fun->body());
    }
@@ -88,6 +92,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.
@@ -138,7 +147,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);
Index: src/x64/fast-codegen-x64.cc
===================================================================
--- src/x64/fast-codegen-x64.cc (revision 3101)
+++ src/x64/fast-codegen-x64.cc (working copy)
@@ -78,6 +78,10 @@
      VisitDeclarations(fun->scope()->declarations());
    }

+  if (FLAG_trace) {
+    __ CallRuntime(Runtime::kTraceEnter, 0);
+  }
+
    { Comment cmnt(masm_, "[ Body");
      VisitStatements(fun->body());
    }
@@ -87,7 +91,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);
@@ -146,6 +155,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