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 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2720 uint16_t buffer[kBufferSize]; | 2720 uint16_t buffer[kBufferSize]; |
2721 | 2721 |
2722 const char* command_111 = "{\"seq\":111," | 2722 const char* command_111 = "{\"seq\":111," |
2723 "\"type\":\"request\"," | 2723 "\"type\":\"request\"," |
2724 "\"command\":\"evaluate\"," | 2724 "\"command\":\"evaluate\"," |
2725 "\"arguments\":{" | 2725 "\"arguments\":{" |
2726 " \"global\":true," | 2726 " \"global\":true," |
2727 " \"expression\":\"v1\",\"disable_break\":true" | 2727 " \"expression\":\"v1\",\"disable_break\":true" |
2728 "}}"; | 2728 "}}"; |
2729 | 2729 |
2730 v8::Isolate* isolate = CcTest::default_isolate(); | 2730 v8::Isolate* isolate = CcTest::isolate(); |
2731 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_111, buffer)); | 2731 v8::Debug::SendCommand(isolate, buffer, AsciiToUtf16(command_111, buffer)); |
2732 | 2732 |
2733 const char* command_112 = "{\"seq\":112," | 2733 const char* command_112 = "{\"seq\":112," |
2734 "\"type\":\"request\"," | 2734 "\"type\":\"request\"," |
2735 "\"command\":\"evaluate\"," | 2735 "\"command\":\"evaluate\"," |
2736 "\"arguments\":{" | 2736 "\"arguments\":{" |
2737 " \"global\":true," | 2737 " \"global\":true," |
2738 " \"expression\":\"getAnimal()\",\"disable_break\":true" | 2738 " \"expression\":\"getAnimal()\",\"disable_break\":true" |
2739 "}}"; | 2739 "}}"; |
2740 | 2740 |
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4884 | 4884 |
4885 /* Interleaved sequence of actions by the two threads:*/ | 4885 /* Interleaved sequence of actions by the two threads:*/ |
4886 // Main thread compiles and runs source_1 | 4886 // Main thread compiles and runs source_1 |
4887 message_queue_barriers.semaphore_1.Signal(); | 4887 message_queue_barriers.semaphore_1.Signal(); |
4888 message_queue_barriers.barrier_1.Wait(); | 4888 message_queue_barriers.barrier_1.Wait(); |
4889 // Post 6 commands, filling the command queue and making it expand. | 4889 // Post 6 commands, filling the command queue and making it expand. |
4890 // These calls return immediately, but the commands stay on the queue | 4890 // These calls return immediately, but the commands stay on the queue |
4891 // until the execution of source_2. | 4891 // until the execution of source_2. |
4892 // Note: AsciiToUtf16 executes before SendCommand, so command is copied | 4892 // Note: AsciiToUtf16 executes before SendCommand, so command is copied |
4893 // to buffer before buffer is sent to SendCommand. | 4893 // to buffer before buffer is sent to SendCommand. |
4894 v8::Isolate* isolate = CcTest::default_isolate(); | 4894 v8::Isolate* isolate = CcTest::isolate(); |
4895 v8::Debug::SendCommand(isolate, buffer_1, AsciiToUtf16(command_1, buffer_1)); | 4895 v8::Debug::SendCommand(isolate, buffer_1, AsciiToUtf16(command_1, buffer_1)); |
4896 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_2, buffer_2)); | 4896 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_2, buffer_2)); |
4897 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); | 4897 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); |
4898 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); | 4898 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); |
4899 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); | 4899 v8::Debug::SendCommand(isolate, buffer_2, AsciiToUtf16(command_3, buffer_2)); |
4900 message_queue_barriers.barrier_2.Wait(); | 4900 message_queue_barriers.barrier_2.Wait(); |
4901 // Main thread compiles and runs source_2. | 4901 // Main thread compiles and runs source_2. |
4902 // Queued commands are executed at the start of compilation of source_2( | 4902 // Queued commands are executed at the start of compilation of source_2( |
4903 // beforeCompile event). | 4903 // beforeCompile event). |
4904 // Free the message handler to process all the messages from the queue. 7 | 4904 // Free the message handler to process all the messages from the queue. 7 |
(...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7549 TEST(LiveEditDisabled) { | 7549 TEST(LiveEditDisabled) { |
7550 v8::internal::FLAG_allow_natives_syntax = true; | 7550 v8::internal::FLAG_allow_natives_syntax = true; |
7551 LocalContext env; | 7551 LocalContext env; |
7552 v8::HandleScope scope(env->GetIsolate()); | 7552 v8::HandleScope scope(env->GetIsolate()); |
7553 v8::Debug::SetLiveEditEnabled(false), env->GetIsolate(); | 7553 v8::Debug::SetLiveEditEnabled(false), env->GetIsolate(); |
7554 CompileRun("%LiveEditCompareStrings('', '')"); | 7554 CompileRun("%LiveEditCompareStrings('', '')"); |
7555 } | 7555 } |
7556 | 7556 |
7557 | 7557 |
7558 #endif // ENABLE_DEBUGGER_SUPPORT | 7558 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |