| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 7190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7201 } | 7201 } |
| 7202 | 7202 |
| 7203 | 7203 |
| 7204 // Test that setting the terminate execution flag during debug break processing. | 7204 // Test that setting the terminate execution flag during debug break processing. |
| 7205 static void TestDebugBreakInLoop(const char* loop_head, | 7205 static void TestDebugBreakInLoop(const char* loop_head, |
| 7206 const char** loop_bodies, | 7206 const char** loop_bodies, |
| 7207 const char* loop_tail) { | 7207 const char* loop_tail) { |
| 7208 // Receive 100 breaks for each test and then terminate JavaScript execution. | 7208 // Receive 100 breaks for each test and then terminate JavaScript execution. |
| 7209 static const int kBreaksPerTest = 100; | 7209 static const int kBreaksPerTest = 100; |
| 7210 | 7210 |
| 7211 for (int i = 0; i < 1 && loop_bodies[i] != NULL; i++) { | 7211 for (int i = 0; loop_bodies[i] != NULL; i++) { |
| 7212 // Perform a lazy deoptimization after various numbers of breaks | 7212 // Perform a lazy deoptimization after various numbers of breaks |
| 7213 // have been hit. | 7213 // have been hit. |
| 7214 for (int j = 0; j < 10; j++) { | 7214 for (int j = 0; j < 11; j++) { |
| 7215 break_point_hit_count_deoptimize = j; | 7215 break_point_hit_count_deoptimize = j; |
| 7216 if (j == 10) { | 7216 if (j == 10) { |
| 7217 break_point_hit_count_deoptimize = kBreaksPerTest; | 7217 break_point_hit_count_deoptimize = kBreaksPerTest; |
| 7218 } | 7218 } |
| 7219 | 7219 |
| 7220 break_point_hit_count = 0; | 7220 break_point_hit_count = 0; |
| 7221 max_break_point_hit_count = kBreaksPerTest; | 7221 max_break_point_hit_count = kBreaksPerTest; |
| 7222 terminate_after_max_break_point_hit = true; | 7222 terminate_after_max_break_point_hit = true; |
| 7223 | 7223 |
| 7224 EmbeddedVector<char, 1024> buffer; | 7224 EmbeddedVector<char, 1024> buffer; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7341 "g(false); \n" | 7341 "g(false); \n" |
| 7342 "%OptimizeFunctionOnNextCall(g); \n" | 7342 "%OptimizeFunctionOnNextCall(g); \n" |
| 7343 "g(true);"; | 7343 "g(true);"; |
| 7344 v8::Debug::SetDebugEventListener(DebugBreakInlineListener); | 7344 v8::Debug::SetDebugEventListener(DebugBreakInlineListener); |
| 7345 inline_script = v8::Script::Compile(v8::String::New(source)); | 7345 inline_script = v8::Script::Compile(v8::String::New(source)); |
| 7346 inline_script->Run(); | 7346 inline_script->Run(); |
| 7347 } | 7347 } |
| 7348 | 7348 |
| 7349 | 7349 |
| 7350 #endif // ENABLE_DEBUGGER_SUPPORT | 7350 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |