Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: test/cctest/test-debug.cc

Issue 359963004: Reland "Add mechanism to postpone interrupts selectively." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6413 matching lines...) Expand 10 before | Expand all | Expand 10 after
6424 // Count the number of breaks. 6424 // Count the number of breaks.
6425 break_point_hit_count++; 6425 break_point_hit_count++;
6426 6426
6427 i::HandleScope scope(isolate); 6427 i::HandleScope scope(isolate);
6428 message.GetJSON(); 6428 message.GetJSON();
6429 6429
6430 SendContinueCommand(); 6430 SendContinueCommand();
6431 } else if (message.IsEvent() && message.GetEvent() == v8::AfterCompile) { 6431 } else if (message.IsEvent() && message.GetEvent() == v8::AfterCompile) {
6432 i::HandleScope scope(isolate); 6432 i::HandleScope scope(isolate);
6433 6433
6434 bool is_debug_break = isolate->stack_guard()->CheckDebugBreak(); 6434 int current_count = break_point_hit_count;
6435 // Force DebugBreak flag while serializer is working.
6436 isolate->stack_guard()->RequestDebugBreak();
6437 6435
6438 // Force serialization to trigger some internal JS execution. 6436 // Force serialization to trigger some internal JS execution.
6439 message.GetJSON(); 6437 message.GetJSON();
6440 6438
6441 // Restore previous state. 6439 CHECK_EQ(current_count, break_point_hit_count);
6442 if (is_debug_break) {
6443 isolate->stack_guard()->RequestDebugBreak();
6444 } else {
6445 isolate->stack_guard()->ClearDebugBreak();
6446 }
6447 } 6440 }
6448 } 6441 }
6449 6442
6450 6443
6451 // Test that if DebugBreak is forced it is ignored when code from 6444 // Test that if DebugBreak is forced it is ignored when code from
6452 // debug-delay.js is executed. 6445 // debug-delay.js is executed.
6453 TEST(NoDebugBreakInAfterCompileMessageHandler) { 6446 TEST(NoDebugBreakInAfterCompileMessageHandler) {
6454 DebugLocalContext env; 6447 DebugLocalContext env;
6455 v8::HandleScope scope(env->GetIsolate()); 6448 v8::HandleScope scope(env->GetIsolate());
6456 6449
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
7406 TEST(DebugBreakOffThreadTerminate) { 7399 TEST(DebugBreakOffThreadTerminate) {
7407 DebugLocalContext env; 7400 DebugLocalContext env;
7408 v8::Isolate* isolate = env->GetIsolate(); 7401 v8::Isolate* isolate = env->GetIsolate();
7409 v8::HandleScope scope(isolate); 7402 v8::HandleScope scope(isolate);
7410 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); 7403 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate);
7411 TerminationThread terminator(isolate); 7404 TerminationThread terminator(isolate);
7412 terminator.Start(); 7405 terminator.Start();
7413 v8::Debug::DebugBreak(isolate); 7406 v8::Debug::DebugBreak(isolate);
7414 CompileRun("while (true);"); 7407 CompileRun("while (true);");
7415 } 7408 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698