Reviewers: Michael Starzinger,

Message:
PTAL.

Happy to rename the thing if you have a better idea. "%_BreakInOptimizedCode"
maybe?

Description:
Add %_HDebugBreak() pseudo function call to insert int3/stop instructions into
optimized code

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

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

Affected files:
  M src/full-codegen.cc
  M src/hydrogen.cc
  M src/runtime.h


Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 73362619935159ce6e96c4cc47b3582baf754946..d73dc2e8c96dd15297887f3723ab3211175cfc17 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -940,6 +940,11 @@ void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) {
 }


+void FullCodeGenerator::EmitHDebugBreak(CallRuntime* expr) {
+  // Nothing to do, HDebugBreak only affects optimized code.
+}
+
+
 void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
   switch (expr->op()) {
     case Token::COMMA:
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index b03bf699389be7864587415c6143280159f27979..6a82b2d2766be5b74b5562dfa23116b24b8c944c 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -10945,6 +10945,11 @@ void HOptimizedGraphBuilder::GenerateGeneratorThrow(CallRuntime* call) {
 }


+void HOptimizedGraphBuilder::GenerateHDebugBreak(CallRuntime* call) {
+  AddInstruction(new(zone()) HDebugBreak());
+}
+
+
 #undef CHECK_BAILOUT
 #undef CHECK_ALIVE

Index: src/runtime.h
diff --git a/src/runtime.h b/src/runtime.h
index 4928e788160e13264e97fc19a684482dc867e4bc..e1b180f6527131aab4ca61db45f4e297c3a6bbb8 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -597,7 +597,8 @@ namespace internal {
F(GetCachedArrayIndex, 1, 1) \ F(FastAsciiArrayJoin, 2, 1) \ F(GeneratorNext, 2, 1) \
-  F(GeneratorThrow, 2, 1)
+ F(GeneratorThrow, 2, 1) \
+  F(HDebugBreak, 0, 0)


// ----------------------------------------------------------------------------


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