From 05b94f13c84c5b59acc1fe4f24c67bc76fc8b138 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Fri, 28 Jun 2013 15:48:38 +0000 Subject: [PATCH] Add %_DebugBreakInOptimizedCode() pseudo function call to insert int3/stop instructions into optimized code R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/17870002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15392 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/full-codegen.cc | 5 +++++ src/hydrogen.cc | 7 +++++++ src/runtime.h | 3 ++- test/mjsunit/fuzz-natives-part1.js | 6 +++++- test/mjsunit/fuzz-natives-part2.js | 5 ++++- test/mjsunit/fuzz-natives-part3.js | 7 ++++++- test/mjsunit/fuzz-natives-part4.js | 7 ++++++- 7 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/full-codegen.cc b/src/full-codegen.cc index 7336261993..c1350a14d9 100644 --- a/src/full-codegen.cc +++ b/src/full-codegen.cc @@ -940,6 +940,11 @@ void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) { } +void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) { + context()->Plug(handle(Smi::FromInt(0), isolate())); +} + + void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { switch (expr->op()) { case Token::COMMA: diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 2cf7af4326..a97c56293f 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -10635,6 +10635,13 @@ void HOptimizedGraphBuilder::GenerateGeneratorThrow(CallRuntime* call) { } +void HOptimizedGraphBuilder::GenerateDebugBreakInOptimizedCode( + CallRuntime* call) { + AddInstruction(new(zone()) HDebugBreak()); + return ast_context()->ReturnValue(graph()->GetConstant0()); +} + + #undef CHECK_BAILOUT #undef CHECK_ALIVE diff --git a/src/runtime.h b/src/runtime.h index 4928e78816..a54eb7c3c6 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(DebugBreakInOptimizedCode, 0, 1) // ---------------------------------------------------------------------------- diff --git a/test/mjsunit/fuzz-natives-part1.js b/test/mjsunit/fuzz-natives-part1.js index 6fd2c0889b..8ca523cc6f 100644 --- a/test/mjsunit/fuzz-natives-part1.js +++ b/test/mjsunit/fuzz-natives-part1.js @@ -163,6 +163,8 @@ var knownProblems = { "ResolvePossiblyDirectEval": true, "Log": true, "DeclareGlobals": true, + "ArrayConstructor": true, + "InternalArrayConstructor": true, "PromoteScheduledException": true, "DeleteHandleScopeExtensions": true, @@ -214,7 +216,9 @@ var knownProblems = { var currentlyUncallable = { // We need to find a way to test this without breaking the system. - "SystemBreak": true + "SystemBreak": true, + // Inserts an int3/stop instruction when run with --always-opt. + "_DebugBreakInOptimizedCode": true }; function testNatives() { diff --git a/test/mjsunit/fuzz-natives-part2.js b/test/mjsunit/fuzz-natives-part2.js index 463bd09855..ec84f35ada 100644 --- a/test/mjsunit/fuzz-natives-part2.js +++ b/test/mjsunit/fuzz-natives-part2.js @@ -153,6 +153,7 @@ var knownProblems = { "ParallelRecompile": true, "InstallRecompiledCode": true, "NotifyDeoptimized": true, + "NotifyStubFailure": true, "NotifyOSR": true, "CreateObjectLiteralBoilerplate": true, "CloneLiteralBoilerplate": true, @@ -215,7 +216,9 @@ var knownProblems = { var currentlyUncallable = { // We need to find a way to test this without breaking the system. - "SystemBreak": true + "SystemBreak": true, + // Inserts an int3/stop instruction when run with --always-opt. + "_DebugBreakInOptimizedCode": true }; function testNatives() { diff --git a/test/mjsunit/fuzz-natives-part3.js b/test/mjsunit/fuzz-natives-part3.js index fa64daa075..928fb4634f 100644 --- a/test/mjsunit/fuzz-natives-part3.js +++ b/test/mjsunit/fuzz-natives-part3.js @@ -153,6 +153,7 @@ var knownProblems = { "ParallelRecompile": true, "InstallRecompiledCode": true, "NotifyDeoptimized": true, + "NotifyStubFailure": true, "NotifyOSR": true, "CreateObjectLiteralBoilerplate": true, "CloneLiteralBoilerplate": true, @@ -162,6 +163,8 @@ var knownProblems = { "ResolvePossiblyDirectEval": true, "Log": true, "DeclareGlobals": true, + "ArrayConstructor": true, + "InternalArrayConstructor": true, "PromoteScheduledException": true, "DeleteHandleScopeExtensions": true, @@ -213,7 +216,9 @@ var knownProblems = { var currentlyUncallable = { // We need to find a way to test this without breaking the system. - "SystemBreak": true + "SystemBreak": true, + // Inserts an int3/stop instruction when run with --always-opt. + "_DebugBreakInOptimizedCode": true }; function testNatives() { diff --git a/test/mjsunit/fuzz-natives-part4.js b/test/mjsunit/fuzz-natives-part4.js index 4003df84fe..d47db3467e 100644 --- a/test/mjsunit/fuzz-natives-part4.js +++ b/test/mjsunit/fuzz-natives-part4.js @@ -153,6 +153,7 @@ var knownProblems = { "ParallelRecompile": true, "InstallRecompiledCode": true, "NotifyDeoptimized": true, + "NotifyStubFailure": true, "NotifyOSR": true, "CreateObjectLiteralBoilerplate": true, "CloneLiteralBoilerplate": true, @@ -162,6 +163,8 @@ var knownProblems = { "ResolvePossiblyDirectEval": true, "Log": true, "DeclareGlobals": true, + "ArrayConstructor": true, + "InternalArrayConstructor": true, "PromoteScheduledException": true, "DeleteHandleScopeExtensions": true, @@ -213,7 +216,9 @@ var knownProblems = { var currentlyUncallable = { // We need to find a way to test this without breaking the system. - "SystemBreak": true + "SystemBreak": true, + // Inserts an int3/stop instruction when run with --always-opt. + "_DebugBreakInOptimizedCode": true }; function testNatives() {