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 6816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6827 // Count the number of breaks. | 6827 // Count the number of breaks. |
6828 break_point_hit_count++; | 6828 break_point_hit_count++; |
6829 | 6829 |
6830 i::HandleScope scope(isolate); | 6830 i::HandleScope scope(isolate); |
6831 message.GetJSON(); | 6831 message.GetJSON(); |
6832 | 6832 |
6833 SendContinueCommand(); | 6833 SendContinueCommand(); |
6834 } else if (message.IsEvent() && message.GetEvent() == v8::AfterCompile) { | 6834 } else if (message.IsEvent() && message.GetEvent() == v8::AfterCompile) { |
6835 i::HandleScope scope(isolate); | 6835 i::HandleScope scope(isolate); |
6836 | 6836 |
6837 bool is_debug_break = isolate->stack_guard()->IsDebugBreak(); | 6837 bool is_debug_break = isolate->stack_guard()->CheckDebugBreak(); |
6838 // Force DebugBreak flag while serializer is working. | 6838 // Force DebugBreak flag while serializer is working. |
6839 isolate->stack_guard()->DebugBreak(); | 6839 isolate->stack_guard()->RequestDebugBreak(); |
6840 | 6840 |
6841 // Force serialization to trigger some internal JS execution. | 6841 // Force serialization to trigger some internal JS execution. |
6842 message.GetJSON(); | 6842 message.GetJSON(); |
6843 | 6843 |
6844 // Restore previous state. | 6844 // Restore previous state. |
6845 if (is_debug_break) { | 6845 if (is_debug_break) { |
6846 isolate->stack_guard()->DebugBreak(); | 6846 isolate->stack_guard()->RequestDebugBreak(); |
6847 } else { | 6847 } else { |
6848 isolate->stack_guard()->Continue(i::DEBUGBREAK); | 6848 isolate->stack_guard()->ClearDebugBreak(); |
6849 } | 6849 } |
6850 } | 6850 } |
6851 } | 6851 } |
6852 | 6852 |
6853 | 6853 |
6854 // Test that if DebugBreak is forced it is ignored when code from | 6854 // Test that if DebugBreak is forced it is ignored when code from |
6855 // debug-delay.js is executed. | 6855 // debug-delay.js is executed. |
6856 TEST(NoDebugBreakInAfterCompileMessageHandler) { | 6856 TEST(NoDebugBreakInAfterCompileMessageHandler) { |
6857 DebugLocalContext env; | 6857 DebugLocalContext env; |
6858 v8::HandleScope scope(env->GetIsolate()); | 6858 v8::HandleScope scope(env->GetIsolate()); |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7683 env->Global()->Set(v8_str("add_debug_break"), add_debug_break); | 7683 env->Global()->Set(v8_str("add_debug_break"), add_debug_break); |
7684 | 7684 |
7685 CompileRun("(function loop() {" | 7685 CompileRun("(function loop() {" |
7686 " for (var j = 0; j < 1000; j++) {" | 7686 " for (var j = 0; j < 1000; j++) {" |
7687 " for (var i = 0; i < 1000; i++) {" | 7687 " for (var i = 0; i < 1000; i++) {" |
7688 " if (i == 999) add_debug_break();" | 7688 " if (i == 999) add_debug_break();" |
7689 " }" | 7689 " }" |
7690 " }" | 7690 " }" |
7691 "})()"); | 7691 "})()"); |
7692 } | 7692 } |
OLD | NEW |