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

Side by Side Diff: test/cctest/test-thread-termination.cc

Issue 1365803004: [presubmit] Fix whitespace/semicolon linter violations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « test/cctest/test-code-stubs-x87.cc ('k') | test/cctest/types-fuzz.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 v8::Local<v8::Context> context = 448 v8::Local<v8::Context> context =
449 v8::Context::New(CcTest::isolate(), NULL, global); 449 v8::Context::New(CcTest::isolate(), NULL, global);
450 v8::Context::Scope context_scope(context); 450 v8::Context::Scope context_scope(context);
451 451
452 v8::TryCatch try_catch(isolate); 452 v8::TryCatch try_catch(isolate);
453 static const char* terminate_and_loop = 453 static const char* terminate_and_loop =
454 "terminate(); for (var i = 0; i < 10000; i++);"; 454 "terminate(); for (var i = 0; i < 10000; i++);";
455 455
456 { // Postpone terminate execution interrupts. 456 { // Postpone terminate execution interrupts.
457 i::PostponeInterruptsScope p1(CcTest::i_isolate(), 457 i::PostponeInterruptsScope p1(CcTest::i_isolate(),
458 i::StackGuard::TERMINATE_EXECUTION) ; 458 i::StackGuard::TERMINATE_EXECUTION);
459 459
460 // API interrupts should still be triggered. 460 // API interrupts should still be triggered.
461 CcTest::isolate()->RequestInterrupt(&CounterCallback, NULL); 461 CcTest::isolate()->RequestInterrupt(&CounterCallback, NULL);
462 CHECK_EQ(0, callback_counter); 462 CHECK_EQ(0, callback_counter);
463 CompileRun(terminate_and_loop); 463 CompileRun(terminate_and_loop);
464 CHECK(!try_catch.HasTerminated()); 464 CHECK(!try_catch.HasTerminated());
465 CHECK_EQ(1, callback_counter); 465 CHECK_EQ(1, callback_counter);
466 466
467 { // Postpone API interrupts as well. 467 { // Postpone API interrupts as well.
468 i::PostponeInterruptsScope p2(CcTest::i_isolate(), 468 i::PostponeInterruptsScope p2(CcTest::i_isolate(),
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 CHECK(value->IsFunction()); 562 CHECK(value->IsFunction());
563 // The first stack check after terminate has been re-requested fails. 563 // The first stack check after terminate has been re-requested fails.
564 CHECK(CompileRun("1 + 1").IsEmpty()); 564 CHECK(CompileRun("1 + 1").IsEmpty());
565 CHECK(!isolate->IsExecutionTerminating()); 565 CHECK(!isolate->IsExecutionTerminating());
566 // V8 then recovers. 566 // V8 then recovers.
567 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value( 567 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value(
568 v8::Isolate::GetCurrent()->GetCurrentContext()); 568 v8::Isolate::GetCurrent()->GetCurrentContext());
569 CHECK_EQ(4, result.FromJust()); 569 CHECK_EQ(4, result.FromJust());
570 CHECK(!isolate->IsExecutionTerminating()); 570 CHECK(!isolate->IsExecutionTerminating());
571 } 571 }
OLDNEW
« no previous file with comments | « test/cctest/test-code-stubs-x87.cc ('k') | test/cctest/types-fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698