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 5395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5406 } | 5406 } |
5407 | 5407 |
5408 | 5408 |
5409 static void ThreadedMessageHandler(const v8::Debug::Message& message) { | 5409 static void ThreadedMessageHandler(const v8::Debug::Message& message) { |
5410 static char print_buffer[1000]; | 5410 static char print_buffer[1000]; |
5411 v8::String::Value json(message.GetJSON()); | 5411 v8::String::Value json(message.GetJSON()); |
5412 Utf16ToAscii(*json, json.length(), print_buffer); | 5412 Utf16ToAscii(*json, json.length(), print_buffer); |
5413 if (IsBreakEventMessage(print_buffer)) { | 5413 if (IsBreakEventMessage(print_buffer)) { |
5414 // Check that we are inside the while loop. | 5414 // Check that we are inside the while loop. |
5415 int source_line = GetSourceLineFromBreakEventMessage(print_buffer); | 5415 int source_line = GetSourceLineFromBreakEventMessage(print_buffer); |
5416 CHECK(8 <= source_line && source_line <= 13); | 5416 CHECK(4 <= source_line && source_line <= 10); |
5417 threaded_debugging_barriers.barrier_2.Wait(); | 5417 threaded_debugging_barriers.barrier_2.Wait(); |
5418 } | 5418 } |
5419 } | 5419 } |
5420 | 5420 |
5421 | 5421 |
5422 void V8Thread::Run() { | 5422 void V8Thread::Run() { |
5423 const char* source = | 5423 const char* source = |
5424 "flag = true;\n" | 5424 "flag = true;\n" |
5425 "\n" | 5425 "\n" |
5426 "function foo() {\n" | 5426 "function foo() {\n" |
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8049 CompileRun("function foo() {}; foo();"); | 8049 CompileRun("function foo() {}; foo();"); |
8050 --after_compile_handler_depth; | 8050 --after_compile_handler_depth; |
8051 } | 8051 } |
8052 | 8052 |
8053 | 8053 |
8054 TEST(NoInterruptsInDebugListener) { | 8054 TEST(NoInterruptsInDebugListener) { |
8055 DebugLocalContext env; | 8055 DebugLocalContext env; |
8056 v8::Debug::SetDebugEventListener(env->GetIsolate(), NoInterruptsOnDebugEvent); | 8056 v8::Debug::SetDebugEventListener(env->GetIsolate(), NoInterruptsOnDebugEvent); |
8057 CompileRun("void(0);"); | 8057 CompileRun("void(0);"); |
8058 } | 8058 } |
OLD | NEW |