Reviewers: Mads Ager,

Description:
IA32: Use the full compiler when debugging

The full compiler will now be used for all code compiler when debugging is
active. As the code generated by the full compiler is much simpler it will be
easier to make debugging work better when using that code.

To ensure that all code debugged is from the full compiler all functions will
have to be recompiled when starting debugging. Initialing debugging already
turns off the code cache.

Please review this at http://codereview.chromium.org/2120009/show

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

Affected files:
  M     src/compiler.cc
  M     src/debug.h
  M     src/flag-definitions.h
  M     test/cctest/test-log-stack-tracer.cc


Index: src/compiler.cc
===================================================================
--- src/compiler.cc     (revision 4675)
+++ src/compiler.cc     (working copy)
@@ -120,7 +120,21 @@
       ? info->scope()->is_global_scope()
       : (shared->is_toplevel() || shared->try_full_codegen());

-  if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) {
+  bool force_full_compiler = false;
+#ifdef V8_TARGET_ARCH_IA32
+ // On ia32 the full compiler can compile all code whereas the other platforms + // the constructs supported is checked by the associated syntax checker. When
+  // --always-full-compiler is used on ia32 the syntax checker is still in
+ // effect, but there is a special flag --force-full-compiler to ignore the
+  // syntax checker completely and use the full compiler for all code. Also
+  // when debugging on ia32 the full compiler will be used for all code.
+  force_full_compiler =
+      Debugger::IsDebuggerActive() || FLAG_force_full_compiler;
+#endif
+
+  if (force_full_compiler) {
+    return FullCodeGenerator::MakeCode(info);
+ } else if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) {
     FullCodeGenSyntaxChecker checker;
     checker.Check(function);
     if (checker.has_supported_syntax()) {
Index: src/debug.h
===================================================================
--- src/debug.h (revision 4675)
+++ src/debug.h (working copy)
@@ -693,8 +693,9 @@
   static void set_loading_debugger(bool v) { is_loading_debugger_ = v; }
static bool is_loading_debugger() { return Debugger::is_loading_debugger_; }

+  static bool IsDebuggerActive();
+
  private:
-  static bool IsDebuggerActive();
   static void ListenersChanged();

   static Mutex* debugger_access_;  // Mutex guarding debugger variables.
Index: src/flag-definitions.h
===================================================================
--- src/flag-definitions.h      (revision 4675)
+++ src/flag-definitions.h      (working copy)
@@ -149,6 +149,10 @@
 DEFINE_bool(fast_compiler, false, "enable speculative optimizing backend")
 DEFINE_bool(always_full_compiler, false,
             "try to use the dedicated run-once backend for all code")
+#ifdef V8_TARGET_ARCH_IA32
+DEFINE_bool(force_full_compiler, false,
+            "force use of the dedicated run-once backend for all code")
+#endif
 DEFINE_bool(always_fast_compiler, false,
             "try to use the speculative optimizing backend for all code")
 DEFINE_bool(trace_bailout, false,
Index: test/cctest/test-log-stack-tracer.cc
===================================================================
--- test/cctest/test-log-stack-tracer.cc        (revision 4675)
+++ test/cctest/test-log-stack-tracer.cc        (working copy)
@@ -273,6 +273,13 @@
 // StackTracer uses Top::c_entry_fp as a starting point for stack
 // walking.
 TEST(CFromJSStackTrace) {
+#ifdef V8_HOST_ARCH_IA32
+  // TODO(711) The hack of replacing the inline runtime function
+ // RandomHeapNumber with GetFrameNumber does not work with the way the full
+  // compiler generates inline runtime calls.
+  i::FLAG_force_full_compiler = false;
+#endif
+
   TickSample sample;
   InitTraceEnv(&sample);

@@ -308,6 +315,13 @@
 // Top::c_entry_fp value. In this case, StackTracer uses passed frame
 // pointer value as a starting point for stack walking.
 TEST(PureJSStackTrace) {
+#ifdef V8_HOST_ARCH_IA32
+  // TODO(711) The hack of replacing the inline runtime function
+ // RandomHeapNumber with GetFrameNumber does not work with the way the full
+  // compiler generates inline runtime calls.
+  i::FLAG_force_full_compiler = false;
+#endif
+
   TickSample sample;
   InitTraceEnv(&sample);



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

Reply via email to