Add support for debugger statement to top-level compiler.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 4 Nov 2009 19:04:29 +0000 (19:04 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 4 Nov 2009 19:04:29 +0000 (19:04 +0000)
Review URL: http://codereview.chromium.org/366004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler.cc
src/fast-codegen.cc

index 32ce6f5d29419b623135a2eb8769d664ffaeefe4..8a0acfeb3d97f10d5e491fc5b90106d89abe32c1 100644 (file)
@@ -742,7 +742,7 @@ void CodeGenSelector::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
 
 
 void CodeGenSelector::VisitDebuggerStatement(DebuggerStatement* stmt) {
-  BAILOUT("DebuggerStatement");
+  // Debugger statement is supported.
 }
 
 
index ed83dca91716fb8cd427f096b00aca97d515a759..ad76b10cacde456c9cf7f1651ce67e5a8904f021 100644 (file)
@@ -369,7 +369,12 @@ void FastCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
 
 
 void FastCodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) {
-  UNREACHABLE();
+#ifdef ENABLE_DEBUGGER_SUPPORT
+  Comment cmnt(masm_, "[ DebuggerStatement");
+  SetStatementPosition(stmt);
+  __ CallRuntime(Runtime::kDebugBreak, 0);
+  // Ignore the return value.
+#endif
 }